Typically, since the STM32F429I-DISCO motherboard has a built-in ST-LINK/V2 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 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 SRAM, or where all of the SRAM and SDRAM is required for application run-time use.
Since the stand-alone STM32F429I-DISCO motherboard has limited I/O there is no support for either RedBoot or GDB stubs by default.
Nevertheless, it is still possible to program a GDB stub or RedBoot ROM image into on-chip Flash and download and debug via a serial UART, if pins for the UART are available. 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. By default for serial communications, all versions run with 8 bits, no parity, and 1 stop bit at 115200 baud. This rate can be changed in the eCos configuration used for building the GDB stub ROM image.
Preparing ST-LINK/V2 interface
The support for using the on-chip ITM stimulus ports for diagnostic and instrumentation output requires that the ST-LINK/V2 firmware is at least version V2.J17.SO. The firmware for the ST-LINK/V2 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 v17:
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748
Unfortunately the official firmware updater is only available for the Windows platform at the moment. From a Windows machine:
Ensure that the Windows PC and STM32F429I-DISCO board are disconnected.
Download the STM32 ST-LINK Utility from ST's website.
The page titled “STSW-LINK004 STM32 ST-LINK utility” provides a free download of the utility http://www.st.com/web/en/catalog/tools/PF258168
Install the ST-LINK Utility software on your Windows PC.
Simply unzip the downloaded file stsw-link004.zip and run the STM32 ST-LINK Utility_v3.0.0.exe that was contained within it. Follow the on-screen instructions. This will install both the utility application and the ST-LINK/V2 USB driver.
Connect the STM32F429I-DISCO board to the PC.
Connect the STM32F429I-DISCO board to the PC using the ST supplied mini-B USB cable. Windows should correctly identify the USB device and load the device driver. Windows Device Manager should now show “STMicroelectronics STLink dongle” under “Universal Serial Bus controllers”.
Run the ST-LINK Utility and ensure the ST-LINK firmware is up to date.
From the Windows “Start” menu run the “STM32 ST-LINK Utility”. Click on the connect icon, or select Target->Connect from the menu. This should confirm that a successful connection can be made to the board. To update the on-board ST-LINK/V2 firmware select ST-LINK->Firmware Update from the menu. In the ST-LINK dialog box that then appears click on the Device Connect button. This will likely result in a message “ST-Link is not in DFU mode. Please restart it.”. In this case simply disconnect the board from the PC and then reconnect it after a couple of seconds, then click the OK button on the message. In the original ST-Link dialog box click Device Connect again. The dialog box should now report the current on-board and available firmware versions, and enable you to upgrade the board by pressing the Yes >>>> button. We have tested the system with firmware version V2.J17.SO and would recommend this version as a minimum. Clicking Yes >>>> will cause a progress bar in the dialog to be animated and should eventually result in a “Update Successful” message. You can then close the various dialogs and exit the ST-LINK Utility. Disconnect and reconnect the board and it is now ready for use with OpenOCD.
Programming ROM images
Since the STM32F429I-DISCO board has a built-in ST-LINK/V2 SWD interface, if the CN4 jumpers are closed then the micro USB host connection (CN1) and suitable host software (e.g. The OpenOCD package openocd tool) can be used to program the flash. Normally a default 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