STM32-E407 OpenOCD with ARM-USB-OCD

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

kb1gtt
Posts: 41
Joined: Sat Jul 09, 2016 11:29 am
Has thanked: 11 times
Been thanked: 2 times

STM32-E407 OpenOCD with ARM-USB-OCD

Postby kb1gtt » Fri Nov 06, 2020 9:35 pm

I'm trying to program a Olimex STM32-E407 with a ARM-USB-OCD. The power LED is bright and the ribbon cable is connected. The console notes "Polling target stm32f4x.cpu failed, trying to reexamine" and I do not get the desired debugger. I launch via pull down "OpenOCD no interface" then I choose the below config file. Are there any suggestions on how I can get this programming cable to allow debugging?

Code: Select all

source [find interface/ftdi/olimex-arm-usb-ocd.cfg]

transport select jtag

# increase working area to 64KB
#set WORKAREASIZE 0x10000

source [find target/stm32f4x.cfg]

reset_config srst_only


Below is a copy of the console.

Code: Select all

Open On-Chip Debugger 0.10.0+dev-01135-gdca1c6ca1-dirty (2020-03-17-11:50)
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 2000 kHz
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020 (STMicroelectronics), part: 0x6413, ver: 0x0)
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : stm32f4x.cpu: external reset detected
Info : Listening on port 3333 for gdb connections
Error: Invalid ACK (0) in DAP response
Polling target stm32f4x.cpu failed, trying to reexamine
Error: Invalid ACK (0) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response
Error: Invalid ACK (7) in DAP response


This is win10 pro 64 bit environment.

kb1gtt
Posts: 41
Joined: Sat Jul 09, 2016 11:29 am
Has thanked: 11 times
Been thanked: 2 times

Re: STM32-E407 OpenOCD with ARM-USB-OCD

Postby kb1gtt » Thu Nov 19, 2020 7:20 pm

To create some breadcrumb for either me or someone else to find. I'm posting these notes about how I got the Olimex ARM-USB-OCD to program and debug a Olimex STM32-E407 using ChibiStudio.

-- Get Debugger working
1) Install WinUSB driver with zadig-2.5 for BOTH interfaces, see Olimex manual for some additional information. Verify Device manager shows with out a warning. As well Plug the ribbon cable into the JTAG header, and plug in the USB cables to both the ARM-USB-OCD and the STM32-E407 board. Make sure the power jumper is selected and the red LED is bright.

2) Save the below contents to blah\ChibiStudio\tools\openocd\scripts\board\olimex_stm32-E407.cfg

Code: Select all

# This is an Olimex STM32-E407 board with a single STM32F407 chip.

source [find interface/ftdi/olimex-arm-usb-ocd.cfg]

transport select jtag

# increase working area to 64KB
set WORKAREASIZE 0x10000

source [find target/stm32f4x.cfg]

# Take note the schematic only shows the trst line on this board.
reset_config trst_only

3) From pull down as shown below, set the screens as noted in these pictures.
eclipse_ARM-USB-OCD_screenshots.png

Key command which are text selectable are below

Code: Select all

-c "telnet_port 4444" -s "${env_var:CHIBISTUDIO}/tools/openocd/scripts" -f C:\ChibiStudio\tools\openocd\scripts\board\olimex_stm32-E407.cfg

4) Compile project you need .elf file, select this elf file then follow the screen captures noted below.
eclipse_ARM-USB-OCD_Debuger.png

If all goes well, you'll get similar results.

Take note your make file will also want to be similar to the below with no optimization -O0 and -g3.

Code: Select all

USE_OPT = -O0 -g3 -ggdb -fomit-frame-pointer -falign-functions=16


That should be the major stuff, happy programming.


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 28 guests