lpcware

Using GDB to debug and restart LPC 4357

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by philippschrader on Mon Dec 22 11:41:03 MST 2014
Hi,

I'm trying to set up our build system that lets us use LPCXpresso's gdb to debug the 4357 applications. I've gotten to the point where I can flash code and debug the M4 portion of it.
This is the gdb script I use for the M4 code:


set trace-commands on
set logging on
target extended-remote | crt_emu_cm_redlink -g -2 -vendor=NXP -pLPC4357 -ResetScript=LPC18LPC43InternalFLASHBootResetscript.scp -reset= -CoreIndex=0 -flash-driver=LPC18x7_43x7_2x512_BootA.cfx
b main


First question: How do I reset execution using gdb commands? In LPCXpresso I can just hit the little "Restart" icon and I can restart execution that way. The traditional "monitor reset" in gdb just tells me "Target does not support this command."

Second question: How do I debug the M0 code at the same time? LPCXpresso works beautifully for this, but I can't figure it out with gdb. Here's the M0 gdb script I use, but it seems to attach to the M4 core no matter what I try to do:


set trace-commands on
set logging on
target extended-remote | crt_emu_cm_redlink -g -2 -vendor=NXP -pLPC4357-M0 -attach -reset= -CoreIndex=1 -flash-driver=LPC18x7_43x7_2x512_BootA.cfx
b main

Outcomes