Skip to content

Commit

Permalink
DOC: STM32F4 add example flash/reset/debug information.
Browse files Browse the repository at this point in the history
* Information on how to flash NuttX firmware to STM32F4 target was missing
  in the documentation and asked by new users on the dev@ list.
* Example on how to Flash, Reset, Debug with OpenOCD is now added to docs.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <[email protected]>
  • Loading branch information
cederom committed Sep 27, 2024
1 parent 4bce5ad commit 45810ef
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Documentation/platforms/arm/stm32f4/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,33 @@ Protected Mode Build
If you do this a lot, you will probably want to invest a little time
to develop a tool to automate these steps.

Flashing and Debugging
======================

NuttX firmware Flashing with STLink probe and OpenOCD::

openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c 'program nuttx.bin 0x08000000; reset run; exit'

Remote target Reset with STLink probe and OpenOCD::

openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c 'init; reset run; exit'

Remote target Debug with STLink probe and OpenOCD:

1. You need to have NuttX built with debug symbols, see :ref:`debugging`.

2. Launch the OpenOCD GDB server::

openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c 'init; reset halt'

3. You can now attach to remote OpenOCD GDB server with your favorite debugger,
for instance gdb::

arm-none-eabi-gdb --tui nuttx -ex 'target extended-remote localhost:3333'
(gdb) monitor reset halt
(gdb) breakpoint nsh_main
(gdb) continue

Supported Boards
================

Expand Down

0 comments on commit 45810ef

Please sign in to comment.