November 23, 2024, 04:09:45 AM

Toolchain setup for STM32-P407

Started by dimaie, February 16, 2014, 05:56:57 PM

Previous topic - Next topic

dimaie

Hi,

I am trying to setup a toolchain to get a blinking led example running on STM32-P407 and ARM-USB-OCD but without any success. I am getting the following log from OCD when starting a debug session:

Open On-Chip Debugger 0.6.1 (2012-10-07-10:34)
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f2x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f2x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
Info : stm32f2x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection from 3333
Info : device id = 0x10016413
Info : flash size = 1024kbytes
Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
Info : JTAG tap: stm32f2x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f2x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08012774 msp: 0x20003e68
background polling: on
TAP: stm32f2x.cpu (enabled)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08012774 msp: 0x20003e68
Info : device id = 0x10016413
Info : flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
6796 bytes written at address 0x00000000
downloaded 6796 bytes in 0.109375s (60.679 KiB/s)
Info : JTAG tap: stm32f2x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f2x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
Warn : Invalid ACK 0 in JTAG-DP transaction
Warn : Invalid ACK 0 in JTAG-DP transaction
Polling target failed, GDB will be halted. Polling again in 100ms
Warn : The target is not in the halted nor running stated, stepi/continue ignored.
Warn : Invalid ACK 0 in JTAG-DP transaction
Warn : Invalid ACK 0 in JTAG-DP transaction
Warn : Block read error address 0x8012774
Warn : Invalid ACK 0 in JTAG-DP transaction
Polling target failed, GDB will be halted. Polling again in 300ms


The last few statements are repeatable and I am wondering if anybody could point to the right direction.

So far I have done the following:

1. Downloaded the target board configuration and the processor id from 0x06411041 to 0x06413041 because the first one did not seem to be correct. After this I seem to get a valid initialisation sequence:

Open On-Chip Debugger 0.6.1 (2012-10-07-10:34)
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f2x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f2x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
Info : stm32f2x.cpu: hardware has 6 breakpoints, 4 watchpoints

2. Cloned the project for the board STM32-P207 and modified it project.cfg to point to the target board configuration modified in the step 1.

3. Did steps 1 and 2 on Win 7 and Win XP machines just in case if it is a debugger driver issue.

4. Setup a telnet connection with the board and tried few commands manually it works fine until I load the executable file and run it. When the code is executed I am again getting

Warn : Invalid ACK 0 in JTAG-DP transaction
Polling target failed, GDB will be halted. Polling again in 300ms.

5. Setup the latest versions of Eclipse CDT, yagarto, OCD just in case if the debugger firmware is not compatible with Olimex setup and tried the project once again with the same results.

Does anybody have a working in Eclipse/OCD 'hello world' project for STM32-P407 and ARM-USB-OCD? Is there a way to make sure that the debugger is working correctly?

Thanks a lot.

Regards,
Dmitry

JohnS

Without your cfg details I doubt anyone can help but in any case you might do better on the oocd ML.
They'll want the cfg(s) and -d3 from oocd.

I expect they'll want -d3 from oocd 0.7.0 or even current git (or whatever it is).

hmm, for a different board I had to remove the
cortex_m3 reset_config sysresetreq
might be worth trying.

John

STM32P407User

I was able to download a program to the flash using the serial port.  The user guide has the following instructions, however, the Step 2 is incorrect.  They need to be open.

Step 0. It is good idea to revert all jumpers to default positions in the beginning
Step 1. Change jumper B0_1/B0_0 to B0_1 position (as said in the table print – "Boot Mode:System Memory")
Step 2. Close RST_E and BOOT0_E (below RS232 connectors)
Step 3. Close TX_BOOT_E and RX_BOOT_E by soldering. They are located on the back of the board near CAN connector.
Step 4. Download, install the Flash Loader Demo (from the STM32F407 web page, resources window)
Step 5. Connect RS232 and run the Flash Loader Application, the target is STM32F4_1024K (check the screenshots below).