-
Notifications
You must be signed in to change notification settings - Fork 5
1_0_Setup_ChibiStudio_Windows
*make sure that you have java 32-bit version installed first, if not download and install the x86 setup file here
-
Clone or download and unzip this repository by running
git clone https://github.com/robomasterhkust/RMTutorialF103
-
install the ST-Link driver by running ${repo_folder}/stlinkDriver/en.stsw-link009/dpinst_amd64.exe .
-
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.
-
Run the provided Eclipse IDE through the "Chibi Studio GCC 7.0" shortcut.
-
Upon start of eclipse, there may appear a annoying welcome screen, close it with the option to not show it next time.
-
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. *
-
File -> Import.. -> choose "C/C++" then "Existing Code as Makefile Project"
-
In the "Existing Code Location" session, choose ${repo_folder}. Choose "none" for "Toolchain for Indexer Settings"
-
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.
support for ST-link flashing and debugging is configured for eclipse and VSCode, setting up for other IDEs are not stated here
- 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
- Open the Debug perspective
- 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.
- To Flash with ST-Link, connect the all the devices, run "Run"->"External Tools"->"Flash with OpenOCD with STLink"
- (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.
- Main tab-> C/C++ Application:
- 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.
Written by Alex Au 2018 for HKUST ENTERPRIZE Robomaster team.