ARM-USB-OCD + OpenOCD + IAR troubles

Started by masverter, February 28, 2013, 08:24:12 am

Previous topic - Next topic


Hello, Guys!
I use Olimex ARM-USB-OCD device + OpenOCD + IAR to debug my project based NXP LPC1759. I performed all instructions of "Manual_IAR.pdf" document, but debug is not work. When I press "Download and debug" GDB server show a lot of errors and warnings as showed below.
Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
Block write error
the target is not running when halt was requested stopping gdb

This leads to bad code downloading and not starting from "main".
When I use Eclipse, I run program with follow commands for debugger ("Run commands"):
target remote localhost:3333
symbol-file xxx_flash.elf
monitor reset
monitor sleep 500
monitor soft_reset_halt
monitor flash erase_sector 0 0 29
monitor flash write_image .\\xxx_flash.hex 0x00
thbreak main

and it work fine.
I know that OpenOCD 0.4.0 has first debug session bug, but running OpenOCD 0.6.1 not fix this problem.
Please tell me how I must configure my IAR project to debug perform fine.


Hello masverter,

Here's what you can try - run openocd from eclipse (the configuration that works for you) without uploading or running anything, just connect successfully. Then in IAR, go to Project Options -> Debugger, choose GDB server and in the tab "Extra options" use the command line options which work for you in Eclipse. It's the same openOCD server, maybe just a different GDB version, but I believe It should work.

Best regards,
Software developer at Olimex