If working remotely, everything is terminal. No GUI like stm32cubeide to use for firmware debugging. I need to use openOCD now. I am using a stm32f407 discovery board for the following tests.
3. install stm32cubeMX
Generate a project with makefile.
4. go the project directory and make the project.
5. make a cfg file
cd /usr/local/share/openocd/scripts/board
boris@boris-T420:/usr/local/share/openocd/scripts/board$ sudo cp stm32f4discovery.cfg stm32f407discovery_boris.cfg
6. Terminal 1: launch openOCD to connect to the board
openocd -f /usr/local/share/openocd/scripts/board/stm32f407discovery_boris.cfg
You can see the following problem:
7. edit the cfg file
Now it works:
8. Terminal 2: start GDB
go to the project directory, go to build/
PATH/TO/PROJECT/build$ arm-none-eabi-gdb openocd_practice.elf
9. now in gdb teminal, start debuging: