cancel
Showing results for 
Search instead for 
Did you mean: 

How to use OpenOCD to program the STM32F469 Discovery Board?

Matt Barclay
Associate
Posted on October 13, 2017 at 18:16

Hello,

I am trying to program the ST Discovery Demo binary on the board.  This is the pre-built file provided with STM32Cube_FW_F4_V1.16.0.  I am calling OpenOCD like this:

cd STM32Cube_FW_F4_V1.16.0/Projects/STM32469I-Discovery/Demonstrations/Binary

$HOME/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.16.0.201708311556/tools/openocd/bin/openocd \

-s $HOME/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_2.1.2.201709081530/resources/openocd/st_scripts \

-s $HOME/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_2.1.2.201709081530/resources/openocd/scripts \

-f st_board/stm32f469i_disco.cfg \

-c 'program STM32469I-Disco_Demo_V1.2.0_FULL.hex verify reset exit'

OpenOCD outputs the following:

Open On-Chip Debugger 0.10.0-dev-00004-gcef2a8c-dirty (2017-08-31-14:01)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 1800 kHz

adapter_nsrst_delay: 100

Info : clock speed 1800 kHz

Info : STLINK v2 JTAG v25 API v2 M v13 VID 0x0483 PID 0x374B

Info : using stlink api v2

Info : Target voltage: 3.240473

Info : Stlink adapter speed set to 1800 kHz

Info : STM32F469.cpu: hardware has 6 breakpoints, 4 watchpoints

can't read 'ENABLE_LOW_POWER': no such variable

in procedure 'program'

in procedure 'init' called at file 'embedded:startup.tcl', line 473

in procedure 'ocd_bouncer'

Info : Stlink adapter speed set to 1800 kHz

adapter speed: 1800 kHz

can't read 'ENABLE_LOW_POWER': no such variable

in procedure 'program'

in procedure 'reset' called at file 'embedded:startup.tcl', line 478

in procedure 'ocd_bouncer'

in procedure 'ocd_process_reset'

in procedure 'ocd_process_reset_inner' called at file 'embedded:startup.tcl', line 248

in procedure 'STM32F469.cpu' called at file 'embedded:startup.tcl', line 299

in procedure 'ocd_bouncer'

STM32F469.cpu: target state: halted

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x080aeb28 msp: 0x20002c50

configuring PLL

Info : Stlink adapter speed set to 1800 kHz

adapter speed: 1800 kHz

** Programming Started **

auto erase enabled

Info : device id = 0x10006434

Info : flash size = 2048kbytes

STM32F469.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x20000046 msp: 0x20002c50

Warn : no flash bank found for address 90000000

wrote 786432 bytes from file STM32469I-Disco_Demo_V1.2.0_FULL.hex in 25.377024s (30.264 KiB/s)

** Programming Finished **

** Verify Started **

STM32F469.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002c50

STM32F469.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002c50

Error: checksum mismatch - attempting binary compare

diff 0 address 0x90000000. Was 0x00 instead of 0x99

diff 1 address 0x90000001. Was 0x00 instead of 0xa5

*** LOTS OF THESE ***

*** LOTS OF THESE ***

diff 127 address 0x9000007f. Was 0x00 instead of 0xa5

More than 128 errors, the rest are not printed.

** Verify Failed **

shutdown command invoked

What am I doing wrong?  Shouldn't this work?

#openocd #stm32f469i-disco
3 REPLIES 3
James Murray
Senior
Posted on March 09, 2018 at 15:20

I'm getting a very similar problem trying to load what I think is the default firmware to the STM32F769UI-DISCO.

When I rebuild the application in Eclipse with STM32 workbench I get that same verification error. By manually pressing the reset button the discovery board boots and the example firmware is running but all of the graphics are scrambled.

Loading using external tools (gdb / openocd) I don't get errors but the graphics are still scrambled. It seems like something in the memory management is incorrect, do the graphics need to be loaded to the off-chip memory instead somehow?

How to return the Discovery board to its factory state?

James

Posted on March 10, 2018 at 20:42

 ,

 ,

In case you get this:

Warn : no flash bank found for address 90000000

Parts of the firmware (in particular bitmaps) are located in the external spi flash, not in the controllers internal flash. To program/erase the external spi flash as well, you need the patch openocd, see

http://openocd.zylin.com/ ♯ /c/4321/

 ,
Posted on March 12, 2018 at 00:48

Good info. Thanks.

James