ChibiStudio is a IDE based on Eclipse for Windows. It is created by the ChibiOS/RT developer to include everything you need to get started including GNU tools, GCC and OpenOCD.
1) Download ChibiStudio http://sourceforge.net/projects/chibios/files/ChibiStudio/
Current version at the time of this post is Preview5.
Extract the file to your C:\ drive.
**Note** ChibiStudio is compressed with 7z, you can decompress it with 7-zip or izArc.
You can put the ChibiStudio shortcut (C:\ChibiStudio\Chibi Studio.lnk) you want: Desktop, Start Menu, etc.
2) You now need to set the paths. Everything needed is in the C:\ChibiStudio\tools directory. In particular:
- C:\ChibiStudio\tools\GNU Tools ARM Embedded\4.7 2013q2\bin
- C:\ChibiStudio\tools\yagarto-tools\bin
- C:\ChibiStudio\tools\openocd\bin
You can set these manually under Computer > Properties > Advanced System Settings > Environment Variables...
Or using a tool such as Windows Path Editor. Note, if you have no UserPath set then drag and drop will not work. Copy the code below and put it into a text file named setPath.bat and run it. **Note** Only do this if you do not have any other User Variable defined Path, it will overwrite it.
Code: Select all
setx PATH "C:\ChibiStudio\tools\GNU Tools ARM Embedded\4.7 2013q2\bin";C:\ChibiStudio\tools\yagarto-tools\bin;C:\ChibiStudio\tools\openocd\bin
4) Test out that you have the path setup correctly. Open up the command prompt and change to the rusEFI firmware directory.
You should be able run 'make' and compile the firmware with no errors.
5) Open ChibiStudio
File > Import... > General > Existing Project into Workspace. Next.
Select root directory. Select the firmware directory.
Under "Workspace" add it to the Common working set.
6) You should now have a 'chibios_template' under Common. **ToDo: Edit the files distributed with rusEFI so it has its own project name**. You can rename this to rusEFI by right clicking on the project or using F2.
7) Now you have to copy the compile settings from another project.
**Note** This is the easiest way to do this. Hopefully in the future I learn enough about eclipse to do this from scratch.
Open ARMCM4-STM32F407-DISCOVERY under ChibiOS/RT STM32 Demos by right clicking on it and selecting "Open Project".
Right click on the rusEFI project and select Properties. Then select C/C++ Build then "Manage Configurations".
Delete 'Default' and confirm, then press "New...".
Create a name ('Default') and 'Import from projects.'
Select ARMCM4-STM32F407-Discovery>Default.
Now delete the 'Release'.
**Note**: You can do this without deleting Default first, however you can not name your new configuration 'Default'.
8) Now you can build your project. Right click on the rusEFI project folder and select "Clean Project". This is necessary to clean out the old build files from the test build we did above.
Right click again and select "Build Project". The build should complete without any problems.
10) Setup Debug
Select "Run > Debug Configuration" from the Menu or click ot the dropdown next to the small bug and select "Debug Configuration".
Right click on the "ARMCM4-STM32F406-DISCOVERY (OpenOCD, Flash, Run)" and select "Duplicate". Rename the project to "rusEFI (OpenOCD, Flash, and Run.
Under C/C++ Application, change it to ./build/rusefi.elf
Next to Project select browse and select rusEFI.
Select "Apply" and then "Close". (If you click on Debug it will attempt to debug the project, not yet)
11) To start the debug process you must first launch OpenOCD.
You can do this from the External Tools configuration drop down. (The Play symbol with the toolbox).
Open OCD on ST-Link v2 (prompts for .cfg target configuration), and select C:\ChibiStudio\tools\openocd\scripts\board\stm32f4discovery.cfg
This will start OpenOCD and prepare it for debugging.
12) Now select 'rusEFI' under the debug menu. It should automatically download the program and break as soon as it enters main().
13) Create a 'Run' configuration.
** Note: You must have ST-Link installed for this**.
Edit run configuration from Run Menu > Run Configurations....
Right click on C/C++ Application and create a new configuration.
Name it "Run rusEFI".
Browse to and select ST-LINK_CLI.exe, for Windows 7 x64 it should be:
C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe
Under the Arguments tab enter:
-c SWD HOTPLUG -P build/rusefi.hex -Rst
This will allow you to flash and run directly from the Gui.
And that's all there is to it. Now you can either debug or run your program just by pressing the debug icon or run icons (or keyboard shortcuts) and have the application automatically downloaded.
ChibiStudio/Eclipse also hase some nice features like a built in terminal: