https://github.com/muka/mbed-stm32-test
Testing mbed on STM32 board
https://github.com/muka/mbed-stm32-test
Last synced: about 2 months ago
JSON representation
Testing mbed on STM32 board
- Host: GitHub
- URL: https://github.com/muka/mbed-stm32-test
- Owner: muka
- Created: 2018-04-15T16:10:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-04T12:53:41.000Z (about 7 years ago)
- Last Synced: 2025-02-05T05:18:04.655Z (4 months ago)
- Language: Makefile
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mbed on STM32 notes
## Setup
### ARM toolchain
`sudo apt install binutils-arm-none-eabi gcc-arm-none-eabi gdb-arm-none-eabi libnewlib-arm-none-eabi`
### openocd
```sh
sudo npm i -g xpm
xpm install @gnu-mcu-eclipse/openocd --global#install openocd rules (ensure the version matches!)
sudo ln -s ~/opt/xPacks/@gnu-mcu-eclipse/openocd/0.10.0-7.1/.content/contrib/60-openocd.rules /etc/udev/rules.d/
sudo service udev restartsudo ln -s ~/opt/xPacks/@gnu-mcu-eclipse/openocd/0.10.0-7.1/.content/bin/openocd /usr/bin/openocd
# check install
openocd -v# run server, see in ~/opt/xPacks/@gnu-mcu-eclipse/openocd/0.10.0-7.1/.content/scripts/board to match yours eg
# openocd -f ~/opt/xPacks/@gnu-mcu-eclipse/openocd/0.10.0-7.1/.content/scripts/board/.cfg```
### mbed CLI
```sh
sudo apt install mercurial # required to access mbed repos
pip install mbed-cli
mbed-cli
```Setting defaults
```
mbed toolchain GCC_ARM
mbed config GCC_ARM_PATH /usr/bin
mbed target NUCLEO_F429ZI
```Exporting to a vscode project
`mbed export -i vscode_gcc_arm`
See vscode setup for details on the configuration (mainly `launch.json`)
## Running
Start openocd in the repo directory (`-d` flag will provide more details)
`openocd -d1`
Receiving messages from serial printing
`screen /dev/ttyACM0 9600`
## Build
Debug build profile
`mbed compile --profile mbed-os/tools/profiles/debug.json`
## Links
- OpenOCD install https://gnu-mcu-eclipse.github.io/openocd/install/
- mbed export to vscode https://os.mbed.com/docs/v5.8/tutorials/visual-studio-code.html
- debug with printf https://docs.mbed.com/docs/mbed-os-handbook/en/latest/debugging/printf/