Slotcar Installation Instructions

Z DCEwiki
Skočit na navigaci Skočit na vyhledávání

Matlab

  • Recommended is version 2012 or newer.
  • If you have x86 operating system you must install x86 matlab version. Same with x64 version. Otherwise RTWT toolbox will not work.

Toolboxes that you need:

  • Real-Time Windows Target toolbox
  • Embedded Coder
  • MATLAB Coder

Matlab c compilator

Supported C compilers by matlab.

Important! You have to find which versions of C compilers are compatible with your version of Matlab

We recommend you to install windows SDK or visual studio To install compiler use the mex -setup command in Matlab enviroment.

Real-time windows target toolbox

  • install commnad rtwintgt -setup
  • You can check if toolbox is alive by rtwho command
  • Known issue: If you have a problem with simulation. For example it will stuck while starting simulation and in terminal shows up warning which says something about rtwt toolbox, then try to reinstall toolbox.

Libusb

- driver package for Nordic receiver to PC.

  1. Download the zip with libusb-win32-bin folder
  2. Unzip
  3. Plug Nordic in USB
  4. Start inf-wizard.exe in folder bin
  5. Install according to instructions for nRF24LU1
  6. In Windows 8, you might need to allow unsubscrubed drivers. To do that, press WinKey+I, then Change setting of the PC (Zmenit nastaveni pocitace) in the bottom. Select Update and Restore (Aktualizace a obnoveni), then Restore (Obnoveni) and Startup with extended setting (Spusteni s rozsirenym nastavenim). Click Restart. After restart, find something like "Use unsubsribed drivers".

Eclipse installation

  1. Install toolchain -> donwload https://launchpad.net/gcc-arm-embedded -> do next next method but Select The option Add path to enviroment variable.
  2. Download eclipse http://www.eclipse.org/cdt/ and Java JDK or JRE if you don't have it already.
  3. Install GNU ARM eclipse plugin -> http://gnuarmeclipse.livius.net/blog/plugins-install/
  4. Add the project to your eclipse. Right click in project Explorer -> Import -> General -> Existing project into workspace -> select the Path where you have stored the project -> select project "slotcar".
  5. Uploading code to a car is provided by Run button (green circle with an arrow inside). By default is set Automatic build on Load.
  6. All settings to compilation is in Project properties -> C/C++ Build -> Settings -> Tool Settings
  7. Maybe you will have to set path to tool chain Project properties -> C/C++ Build -> Settings -> Toolchains -> Global path. For example: C:\Program Files (x86)\GNU Tools ARM Embedded\4.8 2014q2\bin
  8. When you want to add some new folders to project with source codes, then you have to include them here Project properties -> C/C++ Build -> Settings -> Tool Settings -> C Compiler or Assmbler -> Includes. So you let compiler know where to find header files.
  9. C files are compiled automatically so when you have some incomplete in your project you have to exclude them from build
  10. Assembler files must be named with .S (big S not small)

Working with Discovery Kit and Keil

  • Install Keil Microvision - https://www.keil.com/download/ - this is not necessary, but it allows debugging in the discovery kit
  • After installation, in Plugins select Keil:STM32F4
  • Install the driver in <Installation folder>/ARM/STlink/USBDriver with the name STLink_winusb_install.exe.
  • You can test the connection, after plugging the USB Mini cable to the board STM32 Discovery Kit (it also powers it),by running the file <Installation folder>/ARM/STlink/ST-LInkUpgrade. If the device connects, everything is OK. If not, you need update the driver. The driver can be found here: http://www.st.com/web/en/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 (usually for Win 8.0 and 8.1).
  • Download the project from GIT - the folder is Zigbee Application Processor
  • Open the project and build it.
  • Right-click the project name, select "Options for ..." and go to Debug card. In the use filed, select STLink and then click Setting next to it. In the port field, select "SW". Click Ok. On the Utilities card, click "Settings". Click "Add" and select "STM32F4xx Flash". Click OK and OK to get back.
  • Click on the "Load" button in the main window. The target should be updated with the code from project.

Tools necessary to work with Texas Instruments CC2530

  • The code for the device can be compiled in the IAR Workbench for 8051 processors. Unfortunatelly this is not free software, there is only 30-day evaluation licence. Therefore we use the prebuilt "ZNP" software. This is a software which provides SPI interface to send and received data through ZigBee.
  • The Z-Stack from TI, which also contains "ZNP" project, can be downloaded here: http://www.ti.com/tool/z-stack. Select Z-Stack Home.
  • In the installation folder, browse to \Projects\zstack\ZAP\ZNP-HexFiles\. There are several hex files with ZNP. Select CC2530ZNP-Pro.hex. This is the file we work with.
  • Download the Flash programmer from TI from http://www.ti.com/tool/flash-programmer. Use version 1 SW. This allows you to upload the firmware to CC2530 through Smart RF05 Evaluation Board (we have two such boards). Install the software.
  • Also Smart RF Studio 7 might be useful. Download it from here: http://www.ti.com/tool/SMARTRFTM-STUDIO. This software allows to monitor the ZigBee networks.

OLD installation instructions

First install all necessary software. For Windows 8.1, please follow installation described below for Eclipse.

1) YAGARTO - a compiler suitable for Windows 7 and 8, not Windows 8.1.

2) WinAVR

3) Libusb - driver package for Nordic receiver to PC.

  1. Download the zip with libusb-win32-bin folder
  2. Unzip
  3. Plug Nordic in USB
  4. Start inf-wizard.exe in folder bin
  5. Install according to instructions for nRF24LU1
  6. In Windows 8, you might need to allow unsubscrubed drivers. To do that, press WinKey+I, then Change setting of the PC (Zmenit nastaveni pocitace) in the bottom. Select Update and Restore (Aktualizace a obnoveni), then Restore (Obnoveni) and Startup with extended setting (Spusteni s rozsirenym nastavenim). Click Restart. After restart, find something like "Use unsubsribed drivers".

4) MinGW - includes program make for use with makefile.

  • http://www.mingw.org/ - download and install it
  • browse to the installanion folder, find the folder with "make.exe" and put the path to the folder to the system path. to do this, go to Control Panels, System, Advanced System Settings (Upresnit nastaveni systemu). On the Advanced card (Upresnit), click in the bottom Environment variables (Promenne prostredi). Add the path to the line with variable Path.

5) GnuWin32 - alternative (smaller size) to MinGW. After installation, add the bin folder to the system PATH variable (Control Panels ->System->Configure system ->Specify-> System variables). DO NOT USE SPACE AFTER THE SEMICOLON.

5) Matlab c compilator

  1. First install SDK kit before installing Matlab.
  2. Install the Windows SDK package, mainly the Visual C++ Compilers
    1. For Windows 8 and 8.1 - SDK doesn't work! You need to install another distribution like Visual Studio
  3. Use the mex -setup command in Matlab enviroment and select appropriate compiler.


Eclipse installation

  1. Download Eclipse of version at least Kepler from http://www.eclipse.org/downloads/. Recommended pakcege is that for C/C++ developers.
  2. In Eclipse, install new plugin. Go to Help -> Install new software. In the field Work with, type http://gnuarmeclipse.sourceforge.net/updates and press Enter. After a while, list of possible plugins appears. Check all of them and click Next and finish the import. Restart Eclipse. Troubleshoot: if the import reports an error that it needs additional package, it is usually CDT. Then you must install CDT package from Kepler - http://download.eclipse.org/releases/kepler and check Programming Languages -> C/C++ Development Tools and SDK.
  3. Install GCC and make version 4.7-2013-q3 from https://launchpad.net/gcc-arm-embedded.
  4. Import project from GIT into Eclipse. Copy the folder from GIT Platoon_implementation/onboard/fw into your working directory. Then in Eclipse click File -> Import -> General -> Existing project into workspace. Browse to your working directory and select the project Slot_car in folder ending with Eclipse. Finish the import.
  5. Right click the project name, select Properties and select C/C++ Build. Expand and select Environment. Edit Path and add the path to the binary folder from the installation of GCC in step 3)
  • Somethink like: "C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q3\bin"
  1. Build the project by clicking the hammer in the upper left.
  2. Problems on Windows 8.1. Cannot build project: In the project, create folder .dep and in the Makefile, comment the line close to the end in the section clean:. the line containd -rm -fR .dep. Must be commented. On Windows 8.1 the system cannot create folders for some reason. Also create in the folder of main file a folder with the name .dep.

If the project obtained from GIT does not build with error Not found program make, use this procedure. Delete the project in Eclipse, but keep files. Create a new Empty C project in the same location with the same project name. Cick Ok to override the project settings. It should include all files linked in the previous project. Then right click the project name, select Properties and in the C/C++ build menu, unlick Generate Makefile automatically. In the Build location part, delete Debug and keep only "${workspace_loc:/Slot_cars_project}". Then click the Hammer and it should build using the given Makefile.


Back to slotcars