|
From: R. D. <rdi...@ya...> - 2014-02-14 09:35:23
|
Hi all: I am using the git head version of OpenOCD since 13th Jan 2014, and I have updated and recompiled again on 10th Feb 2014. The target board is an STM32F429I-DISCO, and I am using the supplied configuration file "board/stm32f429discovery.cfg" . The microcontroller on that board is an STM32F429, that is, an STM32 from the STM32F4xx family. I have been using both the integrated ST-Link/V2 SWD probe and an external JTAG adapter. The GDB script I have written tries to flash and start the firmware the first time around with the following GDB commands: monitor reset halt # Disable the Independent Watchdog while stopped under the debugger # by setting the DBG_IWDG_STOP bit. set *0xE0042008 = (*0xE0042008) | 0x1000 load hbreak <some routine of mine> continue Every now and then, after the 'continue' command, the program counter register is right, but the stack pointer register is wrong, so the firmware crashes right at the beginning. I have even added temporary code to specifically catch this issue right at the beginning of the reset handler. The CPU has a Cortex-M4F core and is supposed to read both the entry point and the stack pointer addresses from the first 2 entries of the reset vector table. If I reset again manually with GDB command "monitor reset halt" and try to restart with "continue", then it works fine, so the firmware was correctly flashed the first time around. OpenOCD's log is: ---------8<---------8<---------8<--------- Open On-Chip Debugger 0.8.0-dev-00345-gddef369 (2014-02-10-13:56) Licensed under GNU GPL v2 ... srst_only separate srst_nogate srst_open_drain connect_deassert_srst Info : This adapter doesn't support configurable speed Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748 Info : using stlink api v2 Info : Target voltage: 2.880282 Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. Info : accepting 'gdb' connection from 3333 Info : device id = 0x10036419 Info : flash size = 2048kbytes undefined debug reason 7 - target needs reset target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08014178 msp: 0x20030000 target state: halted target halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x20000042 msp: 0x20030000 ---------8<---------8<---------8<--------- Has anybody experienced this problem? Any suggestions? Please copy me on any answers, as I am not actively reading this list. Thanks, rdiez |