LPC5516 SRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC5516 SRAM

59 Views
1123HENRY
Contributor I

我正在使用LPC5516芯片

想通过SWD协议将芯片程序写入SRAM,并跑起来

但是发现程序并未写入SRAM

 

我已经通过SWD读到了芯片的IDCODE,并且完成了一些初始化,例如halt住内核之类的。

只是将程序写入0x04000000后,回读这段地址,发现读取到的数据是0.

 

通过例程,我将一些AHB的SRAM clock使用SWD协议进行开启,如:

SYSCON->AHBCLKCTRLSET[0] = SYSCON_AHBCLKCTRL0_SRAM_CTRL1_MASK | SYSCON_AHBCLKCTRL0_SRAM_CTRL2_MASK;

但是执行完上述程序后,写入到SRAM的程序回读还是0.

 

能否帮忙分析一下出现这个情况的原因

LPC551X-S1X 

 

0 Kudos
Reply
4 Replies

14 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

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

 

 

0 Kudos
Reply

11 Views
1123HENRY
Contributor I

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?

JLINK.png

err.png

 

0 Kudos
Reply

36 Views
db16122
Contributor IV

more error log to share?

0 Kudos
Reply

25 Views
1123HENRY
Contributor I

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.

test1.png

test2.png

test3.png

test4.png

  

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2395165%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3ELPC5516%20SRAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2395165%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20the%20LPC5516%20chip.%3C%2FP%3E%3CP%3EI%20want%20to%20write%20the%20chip%20program%20into%20SRAM%20using%20the%20SWD%20protocol%20and%20run%20it.%3C%2FP%3E%3CP%3EHowever%2C%20it%20was%20discovered%20that%20the%20program%20was%20not%20written%20to%20SRAM.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20have%20read%20the%20chip's%20IDCODE%20through%20SWD%20and%20completed%20some%20initializations%2C%20such%20as%20halting%20the%20kernel.%3C%2FP%3E%3CP%3EAfter%20writing%20the%20program%20to%200x04000000%20and%20reading%20back%20at%20that%20address%2C%20it%20was%20found%20that%20the%20data%20read%20was%200.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThrough%20the%20example%20code%2C%20I%20enabled%20some%20AHB%20SRAM%20clocks%20using%20the%20SWD%20protocol%2C%20such%20as%3A%3C%2FP%3E%3CP%3E%3CSPAN%3ESYSCON-%26gt%3BAHBCLKCTRLSET%5B0%5D%20%3D%20SYSCON_AHBCLKCTRL0_SRAM_CTRL1_MASK%20%7C%20SYSCON_AHBCLKCTRL0_SRAM_CTRL2_MASK%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EHowever%2C%20after%20executing%20the%20above%20program%2C%20the%20program%20readback%20value%20written%20to%20SRAM%20is%20still%200.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ECould%20you%20please%20help%20analyze%20the%20reasons%20for%20this%20situation%3F%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FLPC551X-S1X%2Fpd-p%2FLPC551X-S1X%22%20class%3D%22lia-product-mention%22%20data-product%3D%22840-1%22%20target%3D%22_blank%22%3ELPC551X-S1X%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2395792%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC5516%20SRAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2395792%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E1.%26nbsp%3BI%20have%20try%20to%20write%200x20000000%20with%20my%20hex%2C%20same%20as%20write%26nbsp%3B0x4000000%3C%2FP%3E%3CP%3E2.%20I%20have%20compare%20the%20JLINK%26nbsp%3B%3CSPAN%3E%26nbsp%3BSWD%20waveforms%2C%20I%20can't%20understand%20the%26nbsp%3B%26nbsp%3Bwaveforms%2C%20it%E2%80%98s%20Weird%20%2Cbefore%20set%200xE000EDF0%2C%20it%20send%20something%20with%20ack%20error%2C%20and%20then%20set%200xE000EDF0%20with%200xA05F0003%2C%20then%20read%200xE000EDF0%2C%20the%20value%20is%200x03030003%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Emy%20SWD%26nbsp%3Bwaveforms%20is%20read%20the%20chip%20IDCODE%2C%20and%20then%20init%20the%20chip%2C%20when%20i%20set%200xE000EDF0%20with%200xA05F0003%2C%20read%20back%20is%200x0.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ECould%20you%20please%20give%20me%20a%20Jlink%20script%3F%20i%20want%20to%20know%20what%20is%20send%20before%20enter%20debug%20mode.%3C%2FP%3E%3CP%3Ebefore%20enter%20debug%20mode%2C%20What%20needs%20to%20be%20enabled%20for%20this%20chip%3F%20or%20some%20register%20need%20to%20set%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JLINK.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22JLINK.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392431iF6C3A0437E3E5F5F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JLINK.png%22%20alt%3D%22JLINK.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22err.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22err.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392433iD56BC595813E3BAD%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22err.png%22%20alt%3D%22err.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2395745%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC5516%20SRAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2395745%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F250180%22%20target%3D%22_blank%22%3E%401123HENRY%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CP%3E1)%20Please%20try%20programming%20the%20SRAM%20at%20address%200x20000000%20instead%20of%20the%20SRAMX%20region%20at%200x04000000.%3C%2FP%3E%0A%3CP%3E2)%20Please%20use%20MCUXpresso%20IDE%20or%20LinkFlash%20with%20an%20external%20debugger%20to%20program%20the%20SRAM%2C%20capture%20the%20SWD%20signals%2Fwaveforms%2C%20and%20compare%20them%20with%20the%20waveforms%20observed%20in%20your%20programmer.%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EAlice%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2395672%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC5516%20SRAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2395672%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20used%20my%20own%20chip%20to%20send%20SWD%20instructions%20to%20debug%20the%20LPC5516%20chip.%20I%20attempted%20to%20write%20to%20the%200xE000EDF0%20register%2C%20trying%20to%20enable%20debugging%2C%20but%20it%20didn't%20work.%3C%2FP%3E%3CP%3EThen%2C%20I%20attempted%20to%20write%20to%20the%20SRAM%2C%20but%20found%20that%20the%20write%20operation%20failed.%20It%20seems%20that%20the%20device%20did%20not%20enter%20the%20debugging%20mode.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22test1.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22test1.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392409iBCF91933808776E8%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22test1.png%22%20alt%3D%22test1.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22test2.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22test2.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392410i4CC37A33807D3CAE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22test2.png%22%20alt%3D%22test2.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22test3.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22test3.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392411iAE4721B9E83F7D79%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22test3.png%22%20alt%3D%22test3.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22test4.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22test4.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392412i5DA4FDB0D943CD71%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22test4.png%22%20alt%3D%22test4.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%E2%80%83%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2395289%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC5516%20SRAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2395289%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Emore%20error%20log%20to%20share%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E