I am using the LPC5516 chip.
I want to write the chip program into SRAM using the SWD protocol and run it.
However, it was discovered that the program was not written to SRAM.
I have read the chip's IDCODE through SWD and completed some initializations, such as halting the kernel.
After writing the program to 0x04000000 and reading back at that address, it was found that the data read was 0.
Through the example code, I enabled some AHB SRAM clocks using the SWD protocol, such as:
SYSCON->AHBCLKCTRLSET[0] = SYSCON_AHBCLKCTRL0_SRAM_CTRL1_MASK | SYSCON_AHBCLKCTRL0_SRAM_CTRL2_MASK;
However, after executing the above program, the program readback value written to SRAM is still 0.
Could you please help analyze the reasons for this situation?
1. I have try to write 0x20000000 with my hex, same as write 0x4000000
2. I have compare the JLINK SWD waveforms, I can't understand the waveforms, it‘s Weird ,before set 0xE000EDF0, it send something with ack error, and then set 0xE000EDF0 with 0xA05F0003, then read 0xE000EDF0, the value is 0x03030003。
my SWD waveforms is read the chip IDCODE, and then init the chip, when i set 0xE000EDF0 with 0xA05F0003, read back is 0x0.
Could you please give me a Jlink script? i want to know what is send before enter debug mode.
before enter debug mode, What needs to be enabled for this chip? or some register need to set?
Hello @1123HENRY
1) Please try programming the SRAM at address 0x20000000 instead of the SRAMX region at 0x04000000.
2) Please use MCUXpresso IDE or LinkFlash with an external debugger to program the SRAM, capture the SWD signals/waveforms, and compare them with the waveforms observed in your programmer.
BR
Alice
I used my own chip to send SWD instructions to debug the LPC5516 chip. I attempted to write to the 0xE000EDF0 register, trying to enable debugging, but it didn't work.
Then, I attempted to write to the SRAM, but found that the write operation failed. It seems that the device did not enter the debugging mode.
more error log to share?