We use CubeMX to generate the code. You can choose whether to use Keil or GNU Tools chain.
The code consists of the FreeRTOS. Some cmsis_os API is implemented.
Current board information:
stm32f410RB
flash size: 128k
clock freqz: 96MHz
For Keil:
- Keil Project is at MDK-ARM/ dir
For open source software:
-
Compiler: GNU Tools Chain(Windows)
- For Linux
sudo apt install gcc-arm-none-eabi
- For Linux
-
Adapter to board: OpenOCD for Windows for Linux
- For Linux DO NOT USE
sudo apt install openocd
. The version is BUGGY.
- For Linux DO NOT USE
-
Editor: VS code
NOTE
under the dir \Middlewares\Third_Party\FreeRTOS\Source\portable the GCC/ dir is for GNU Tools, the RVDS/ dir is for Keil. Make sure the file exist before you compile the code. The CubeMX may delete one of them when generating the code for another tool chains. A backup of GCC dir is at the root dir.
Add the OpenOCD
to you environment variable PATH
.
Add the arm-none-eabi-gcc
to your environment variable PATH
.
Install the GNU Tools Chain
sudo apt install gcc-arm-none eabi
Install the OpenOCD-0.10.0
cd $YOUR_DOWNLOAD_PATH$/openocd-0.10.0
./configure && make
sudo make install
To enable openocd can launch with proper permission(e.g. without sudo)
sudo cp ./contrib/60-openocd.rules /etc/udev/rules.d/
sudo udevadm trigger
Install extension Cortex-Debug
in VS Code.
Install extension C/C++
in VS Code.
Make sure your directory is call Pilot
NOT Pilot-Master
or sth else.
There are two ways to build the project:
-
type
make
in the terminal -
run task Build in VS code
To upload the project. Also two ways to do it
- type
make upload
in the terminal - run task Upload Program in VS code
Debug-> Start Debug(Press F5) to start debugging.