Name
Setup — Preparing the STM32F746G-DISCO Board for eCos Development
Overview
Typically, since the STM32F746G-DISCO motherboard has a built-in ST-LINK/V2-1 interface providing hardware debug support, eCos applications are loaded and run via the debugger arm-eabi-gdb or via the Eclipse IDE. The debugger then communicates with the “GDB server” provided by the relevant host ST-LINK/V2-1 support tool being used (e.g. OpenOCD).
Normally for release applications the ROM
startup
type would be used, with the application programmed into the on-chip
flash for execution when the board boots. It is still possible to use
the hardware debugging support to debug such flash-based ROM
applications, and this may be the desired approach if the application
is too large for execution from on-chip SRAM, or where all of the SRAM
and SDRAM is required for application run-time use.
If off-chip non-volatile memory (NVM) is used to hold the main application then the board can boot from the internal flash using a suitable boot loader. For example, the eCosPro BootUp ROM loader, where the BootUp code can start the main application (after an optional update sequence).
If required, it is still possible to program a GDB stub or
RedBoot ROM
image into on-chip Flash and
download and debug via a serial connection (using the relevant CN4
pins). In that case, eCos applications are configured
for RAM
startup and then downloaded and run on the
board via the debugger arm-eabi-gdb, or via the
Eclipse IDE as appropriate.
Preparing ST-LINK/V2-1 interface
The support for using the on-chip ITM stimulus ports for diagnostic
and instrumentation output requires that the ST-LINK/V2-1 firmware is at
least version V2.J24.S11
. The firmware for the
ST-LINK/V2-1 interface can be checked, and updated if needed, using a
tool available from STMicroelectronics. The firmware version is also
reported when the openocd command is executed
(using a suitable configuration file). For example, the following
OpenOCD output reports JTAG v24
:
Info : STLINK v2 JTAG v24 API v2 SWIM v11 VID 0x0483 PID 0x374B
The user should refer to the ST “ST-LINK/V2-1 firmware upgrade” (RN0093) Release Note, which provides detail on the host requirements for upgrading the ST-Link firmware on Linux, Mac OS X and Windows hosts.
Programming ROM images
Since the STM32F746G-DISCO board has a built-in ST-LINK/V2-1 SWD interface, the USB host connection (CN14) and suitable host software (e.g. The OpenOCD package openocd tool) can be used to program the flash.
The openocd GDB server can directly program flash based applications from the GDB load command.
Note | |
---|---|
The openocd command being used should have been configured and built to support the ST-LINK/V2-1 interface. This is achieved by specifying the --enable-stlink when configuring the OpenOCD build. Additional information on running openocd may be found in the OpenOCD notes. |
For example, assuming that openocd is running on the same host as GDB, and is connected to the target board the following will program the “bootup.elf” application into the on-chip flash:
$arm-eabi-gdb install/bin/bootup.elf
GNU gdb (eCosCentric GNU tools 4.7.3j) 7.8.2 [ … GDB output elided … ] (gdb) target remote localhost:3333 hal_reset_vsr () atpath
/hal_misc.c:171 (gdb)load
Loading section .rom_vectors, size 0x14 lma 0x8000000 Loading section .text, size 0x3adc lma 0x8000018 Loading section .rodata, size 0x6c0 lma 0x8003af8 Loading section .data, size 0x6dc lma 0x80041b8 Start address 0x8000018, load size 18572 Transfer rate: 14 KB/sec, 4643 bytes/write. (gdb)
Alternatively, the openocd telnet interface can be
used to manually program the flash. By default
the openocd session provides a comand-line via
port 4444
. Consult the OpenOCD documentation for
more details if a non-default openocd configuration
is being used.
With a telnet connection established to the openocd any binary data can easily be written to the on-chip flash. e.g.
$telnet localhost 4444
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Open On-Chip Debugger >flash write_image test.bin 0x08000000
wrote 32518 bytes from file test.bin in 1.073942s (29.569 KiB/s)
To create a binary for flash programming the arm-eabi-objcopy command is used. This converts the, ELF format, linked application into a raw binary. For example:
$ arm-eabi-objcopy -O binary programname
programname
.bin
2024-12-10 | eCosPro Non-Commercial Public License |