OpenOCD Debugging


#1

Hello!

Today i’ve received my onethinx-demoboard. I’m using it with an kitprog2 (upgraded to kitprog3). Programming the module with the “hello-world” project works fine, joining my LNS works. But when i try to a start a debug session the following error occures:
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
Remote replied unexpectedly to ‘vMustReplyEmpty’: PacketSize=3fff;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
Remote replied unexpectedly to ‘vMustReplyEmpty’: PacketSize=3fff;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+
Remote replied unexpectedly to ‘vMustReplyEmpty’: PacketSize=3fff;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+

Currently I can’t identify the problem.


#2

Hi Philipp,

Are you able to post the full log?


#3

Hello Rolf,

I’m using the following toolbox version:
ModusToolbox-core 1.0.0.3169
Cypress SDK 1.0.0.10118
Pre-Installed 1.0.0.0

I’ve run the scripts an mentioned in the README:
OpenOCD: <extracted_location>/tools/openocd-1.0/udev_rules/install_rules.sh => worked
WICED Boards: <extracted_location>/tools/wiced-tools-1.0/install_driver/install_rules.sh => this script is not available in my download of the toolbox
Firmware Loader: <extracted_location>/tools/fw-loader-1.0/udev_rules/install_rules.sh => worked
with the toolbox i opened the “hello world” project(s) and tried to debug with the following error log:
*Open On-Chip Debugger 0.10.0+dev-1.0.0.226 (2018-11-09-17:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1500 kHz
Warn : Transport “swd” was already selected
swd
0
adapter speed: 1000 kHz
** Auto-acquire enabled, use “set ENABLE_ACQUIRE 0” to disable
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : VTarget = 4.844 V
Info : kitprog3: acquiring PSoC device…
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x6ba02477
Info : psoc6.cpu.cm4: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Started by GNU MCU Eclipse
Error: DP initialisation failed
Info : kitprog3: acquiring PSoC device…
Info : SWD DPIDR 0x6ba02477

Failed to acquire PSoC 6 device in Test Mode

** SFlash SiliconID: 0xE2072200
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x16002008
Error: mem2array: Read @ 0x16002004, w=4, cnt=1, failed
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x16002008
Error: mem2array: Read @ 0x16002004, w=4, cnt=1, failed
** psoc6.cpu.cm4: Ran after reset and before halt…
target halted due to debug-request, current mode: Thread
xPSR: 0xa1000000 pc: 0x10000afa msp: 0x0803ef98
Started by GNU MCU Eclipse
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting ‘gdb’ connection on tcp/3333
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x4025f010
Warn : FLASHC.GEOMETRY is not accessible, assuming device is PSoC6BLE2
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x4025f010
Warn : FLASHC.GEOMETRY is not accessible, assuming Flash Size is 1024 kB
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x4025f010
Warn : FLASHC.GEOMETRY is not accessible, assuming device is PSoC6BLE2
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x4025f010
Info : SWD DPIDR 0x6ba02477
Warn : FLASHC.GEOMETRY is not accessible, assuming device is PSoC6BLE2
Error: Failed to read memory at 0x4025f010
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x4025f010
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x4025f010
Warn : FLASHC.GEOMETRY is not accessible, assuming device is PSoC6BLE2
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x4025f010
Error: GDB missing ack(2) - assumed good
Info : dropped ‘gdb’ connection
shutdown command invoked*

and the error error from my first post.
I hope that helps.

kind regards,
Philipp


#4

Hi Phillip,

Because parts of the memory are protected, you are seeing the warning messages as you posted.

However, at the final step you get:
Error: GDB missing ack(2) - assumed good
Info : dropped ‘gdb’ connection
Which points to a lost connection.

Could you please add the following commands to OpenOCD command line? (Modus>Debug Configurations>GDB OpenOCD Debugging> … Debug(KitProg3)>Debugger>Config Options)

-c "set ENABLE_ACQUIRE 0" - this line should be added before -c “source [find target/psoc6.cfg]”
-c "reset_config srst_only;adapter_nsrst_delay 1000" - this line should be added after -c “source [find target/psoc6.cfg]”

We’ve seen this behavior an very few boards before and we might have to look into that further.

Please let us know the outcome.


#5

Hi Rolf,

thank you for your reply - i tried your suggestion and it worked, now I’m able to debug and step through the code.

kind regards,
Philipp


#6

Hi Philipp,

Are you also able to see which one of the two lines did make the difference? It’s good to know for us and others as well.

Thanks!
Rolf


#7

Hi Rolf,

the line -c “set ENABLE_ACQUIRE 0” makes the debugging work. This are my config options:
-s “{cy_tools_path:openocd}/scripts" -s "{workspace_loc}/OnethinxCore_00_config/GeneratedSource”
-c “source [find interface/kitprog3.cfg]”
-c “transport select swd”
-c “set ENABLE_CM0 0”
-c “set ENABLE_ACQUIRE 0”
-c “source [find target/psoc6.cfg]”
-c “puts stderr {Started by GNU MCU Eclipse}”
-c “init; reset init”

hope that helps.
kind regards,
Philipp