Skip to content

1_0_Setup_ChibiStudio_Windows

Alex Au edited this page Sep 14, 2018 · 12 revisions

In Windows 10

*make sure that you have java 32-bit version installed first, if not download and install the x86 setup file here
  1. Clone or download and unzip this repository by running git clone https://github.com/robomasterhkust/RMTutorialF103

    • if you donot have git installed yet, download the zip file and unzip it, 7-zip is recommended for unzipping.
    • From now on we will denote ${repo_folder} as the path to your copy of this repository.
  2. install the ST-Link driver by running ${repo_folder}/stlinkDriver/en.stsw-link009/dpinst_amd64.exe .

  3. Download and unzip ChibiStudio_PreviewXXX.zip to your C:\, if not, you have to modify all the directory in the start_gcc70.bat file to match with your path.

  4. Run the provided Eclipse IDE through the "Chibi Studio GCC 7.0" shortcut.

  5. Upon start of eclipse, there may appear a annoying welcome screen, close it with the option to not show it next time.

  6. Check that you are in the correct "Perspective", we will only use C/C++ and Debug perspective, the adding and switching perspective buttons are located at the top right corner by default. *

  7. File -> Import.. -> choose "C/C++" then "Existing Code as Makefile Project"

  8. In the "Existing Code Location" session, choose ${repo_folder}. Choose "none" for "Toolchain for Indexer Settings"

  9. You can now compile the code by selecting the imported project ("RMInternalF103DevBoard") in your "Project Explorer", then click the hammer button on the top toolbar (or right click->Build Project or Ctrl-B) to build the project.


Flashing and Debugging with ST-LINK

Following procedures need both the ST-LINK and board CONNECTED

support for ST-link flashing and debugging is configured for eclipse and VSCode, setting up for other IDEs are not stated here

  1. Import all the debug launch settings by going File-> import-> Under "Run/Debug" choose Launch configurations -> select ${repo_folder}/eclipse -> check the checkbox near "eclipse" -> continue everything
  2. Open the Debug perspective
  3. In the Project Explorer select the "RMTutorialF103", you probably need to click Window->Show View->Other->General-> Project Explorer to show that in the debug perspective. Remember to select your project before running any debug processes below.
  4. To Flash with ST-Link, connect the all the devices, run "Run"->"External Tools"->"Flash with OpenOCD with STLink"
  5. (Just in case if you do not find the "debugWindows" configuration under Run->Debug Configurations after importing) Setup openocd debug in eclipse: go to Run-> Debug Configurations, create a new configuration under "GDB Hardware Debugging", input the followings:
    • Main tab-> C/C++ Application: build\RMInternalDev.elf
    • Debugger-> GDB Command: arm-none-eabi-gdb
    • Debugger-> Remote Target: Generic TCP/IP , localhost , 3333
    • Click apply then save.
  6. To Debug with ST-Link, connect the all the devices, run "Run"->"External Tools"->"Debug with OpenOCD with STLink", do this after flashing. Then click "Run"->"Debug Configurations"->"GDB Hardware Debugging"->"debugWindows"
    • in some cases the ${project_loc} variable is not interpreted by eclipse well, make sure that you have selected the "RMTutorialF103" project in your project explorer before launching the External Tools , or force such a config by going to "Run"->"External tools"-> "External tools configuration", change the ${project_loc} to ${repo_folder} in the "Flash with OpenOCD with STLink" and "Debug with OpenOCD with STLink" configurations

More about debugging will be in next page.

* in eclipse the openocd and gdb server may still be running after finishing your work, check the "Debug" tab in the debug perspective
* you can do the setup with other IDEs or editors but these will not be covered here