AnsweredAssumed Answered

Any idea how to enable and download in external ram?

Question asked by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by goffi on Fri Jun 14 01:50:16 MST 2013

I have a dev board from embedded artists with lpc4357.


I'm trying to enable the external ram (with iar+jlink) and download the program on it.


In my .mac file i put these lines but i have problems on the commented parts:


//SystemInit


 


//MemoryPinInit


__writeMemory32(0x000000f3, 0x4008609c, "Memory" );


__writeMemory32(0x000000f3, 0x400860a0, "Memory" );


__writeMemory32(0x000000f3, 0x400860a4, "Memory" );


__writeMemory32(0x000000f3, 0x400860a8, "Memory" );


__writeMemory32(0x000000f3, 0x400860ac, "Memory" );


__writeMemory32(0x000000f3, 0x400860b0, "Memory" );


__writeMemory32(0x000000f3, 0x400860b4, "Memory" );


__writeMemory32(0x000000f3, 0x400860b8, "Memory" );


__writeMemory32(0x000000f2, 0x40086290, "Memory" );


__writeMemory32(0x000000f2, 0x40086294, "Memory" );


__writeMemory32(0x000000f2, 0x40086298, "Memory" );


__writeMemory32(0x000000f2, 0x4008629c, "Memory" );


__writeMemory32(0x000000f2, 0x40086280, "Memory" );


__writeMemory32(0x000000f2, 0x40086284, "Memory" );


__writeMemory32(0x000000f2, 0x40086288, "Memory" );


__writeMemory32(0x000000f2, 0x4008628c, "Memory" );


__writeMemory32(0x000000f2, 0x40086688, "Memory" );


__writeMemory32(0x000000f2, 0x4008668c, "Memory" );


__writeMemory32(0x000000f2, 0x40086690, "Memory" );


__writeMemory32(0x000000f2, 0x40086694, "Memory" );


__writeMemory32(0x000000f2, 0x40086698, "Memory" );


__writeMemory32(0x000000f2, 0x4008669c, "Memory" );


__writeMemory32(0x000000f2, 0x400866a0, "Memory" );


__writeMemory32(0x000000f2, 0x400866a4, "Memory" );


__writeMemory32(0x000000f3, 0x40086714, "Memory" );


__writeMemory32(0x000000f3, 0x40086718, "Memory" );


__writeMemory32(0x000000f3, 0x4008671c, "Memory" );


__writeMemory32(0x000000f3, 0x40086720, "Memory" );


__writeMemory32(0x000000f3, 0x40086724, "Memory" );


__writeMemory32(0x000000f3, 0x40086728, "Memory" );


__writeMemory32(0x000000f3, 0x4008672c, "Memory" );


__writeMemory32(0x000000f3, 0x40086730, "Memory" );


__writeMemory32(0x000000f3, 0x40086124, "Memory" );


__writeMemory32(0x000000f3, 0x40086128, "Memory" );


__writeMemory32(0x000000f3, 0x4008612c, "Memory" );


__writeMemory32(0x000000f3, 0x40086130, "Memory" );


__writeMemory32(0x000000f3, 0x40086134, "Memory" );


__writeMemory32(0x000000f2, 0x40086080, "Memory" );


__writeMemory32(0x000000f2, 0x40086084, "Memory" );


__writeMemory32(0x000000f2, 0x40086088, "Memory" );


__writeMemory32(0x000000f3, 0x40086120, "Memory" );


__writeMemory32(0x000000f3, 0x4008611c, "Memory" );


__writeMemory32(0x000000f2, 0x40086118, "Memory" );


__writeMemory32(0x000000f2, 0x40086108, "Memory" );


__writeMemory32(0x000000f2, 0x40086104, "Memory" );


__writeMemory32(0x000000f2, 0x40086100, "Memory" );


__writeMemory32(0x000000f1, 0x40086320, "Memory" );


__writeMemory32(0x000000f1, 0x4008631c, "Memory" );


__writeMemory32(0x000000f2, 0x400866c0, "Memory" );


__writeMemory32(0x000000f2, 0x400866bc, "Memory" );


__writeMemory32(0x000000f3, 0x40086700, "Memory" );


__writeMemory32(0x000000f3, 0x40086704, "Memory" );


__writeMemory32(0x000000f3, 0x40086708, "Memory" );


__writeMemory32(0x000000f3, 0x4008670c, "Memory" );


__writeMemory32(0x000000f3, 0x40086710, "Memory" );


__writeMemory32(0x000000f3, 0x40086510, "Memory" );


__writeMemory32(0x000000f3, 0x40086090, "Memory" );


__writeMemory32(0x000000f1, 0x40086318, "Memory" );


__writeMemory32(0x000000f2, 0x400866b4, "Memory" );


__writeMemory32(0x000000f2, 0x400866a8, "Memory" );


__writeMemory32(0x000000f3, 0x40086324, "Memory" );


__writeMemory32(0x000000f3, 0x40086098, "Memory" );


__writeMemory32(0x000000f3, 0x40086310, "Memory" );


__writeMemory32(0x000000f3, 0x40086314, "Memory" );


__writeMemory32(0x000000f3, 0x4008632c, "Memory" );


__writeMemory32(0x000000f3, 0x40086330, "Memory" );


__writeMemory32(0x000000f3, 0x40086328, "Memory" );


__writeMemory32(0x000000f2, 0x40086680, "Memory" );


__writeMemory32(0x000000f3, 0x40086734, "Memory" );


__writeMemory32(0x000000f3, 0x4008608c, "Memory" );


__writeMemory32(0x000000f3, 0x40086090, "Memory" );


__writeMemory32(0x000000f3, 0x40086094, "Memory" );


__writeMemory32(0x000000f3, 0x40086098, "Memory" );


 


//EMCFlashInit


__writeMemory32(0xc28f5c29, 0x4000520c, "Memory" );


__writeMemory32(0xc28f5c29, 0x40005210, "Memory" );


__writeMemory32(0x00000001, 0x40005000, "Memory" );


__writeMemory32(0x00000081, 0x40005200, "Memory" );


__writeMemory32(0xc28f5c29, 0x40005208, "Memory" );


__writeMemory32(0x00080000, 0x40005200, "Memory" );


 


//CGU_Init


__var temp;


 


//CGU_SetXTALOSC


temp = __readMemory32( 0x40050018, "Memory" );


temp = temp & 0xfffffffb;


__writeMemory32( temp, 0x40050018, "Memory" );


 


//CGU_EnableEntity


temp = __readMemory32( 0x40050018, "Memory" );


temp = temp & 0xfffffffe;


__writeMemory32( temp, 0x40050018, "Memory" );


 


//CGU_EntityConnect


//temp = __readMemory32( 0x40053630, "Memory" );


//temp = (temp & 0xf0ffffff) | 0x06000000 | 0x00000800;


//__writeMemory32( temp, 0x40053630, "Memory" );


//__writeMemory32( 0x06000803, 0x40053630, "Memory" );


 


//CGU_SetPLL1


temp = __readMemory32( 0x40050044, "Memory" );


temp = (temp & 0xff00cc3d);


__writeMemory32( temp, 0x40050044, "Memory" );


 


temp = __readMemory32( 0x40050044, "Memory" );


temp = temp | 0x00050140;


__writeMemory32( temp, 0x40050044, "Memory" );


 


//CGU_EnableEntity


temp = __readMemory32( 0x40050044, "Memory" );


temp = temp & 0xfffffffe;


__writeMemory32( temp, 0x40050044, "Memory" );


 


//while(40050040) == 0


 


//CGU_EntityConnect


//temp = __readMemory32( 0x40055610, "Memory" );


//temp = (temp & 0xf0ffffff)| 0x09000000 | 0x00000800;


//__writeMemory32( temp, 0x40055610, "Memory" );


__writeMemory32( 0x09000800, 0x40055610, "Memory" );


 


 


//CGU_SetPLL0


temp = __readMemory32( 0x40050020, "Memory" );


temp = temp | 0x00000001;


__writeMemory32( temp, 0x40050020, "Memory" );


 


__writeMemory32( 0x00202062, 0x40050028, "Memory" );


__writeMemory32( 0x04167ffa, 0x40050024, "Memory" );


__writeMemory32( 0x0600001c, 0x40050020, "Memory" );


 


//CGU_EnableEntity


temp = __readMemory32( 0x40050020, "Memory" );


temp = temp & 0xfffffffe;


__writeMemory32( temp, 0x40050020, "Memory" );


 


 


//CGU_EntityConnect


//temp = __readMemory32( 0x40054c80, "Memory" );


//temp = ( temp & 0xf0ffffff ) | 0x07000000 | 0x00000800;


//__writeMemory32( temp, 0x40054c80, "Memory" );


__writeMemory32( 0x07000800, 0x40054c80, "Memory" );


 


 


//CGU_EnableEntity


__writeMemory32( 0x00000010, 0x400860cc, "Memory" );


 


//CGU_EntityConnect


//temp = __readMemory32( 0x400562d0 );


//temp = ( temp & 0xf0ffffff ) | 0x03000000 | 0x00000800;


//__writeMemory32( temp, 0x400562d0, "Memory" );


__writeMemory32( 0x03000800, 0x400562d0, "Memory" );


 


 


//CGU_EnableEntity


 __writeMemory32( 0x00000013, 0x40086600, "Memory" );


 


//CGU_EntityConnect


//temp = __readMemory32( 0x40055fa0 );


//temp = ( temp & 0xf0ffffff ) | 0x02000000 | 0x00000800;


//__writeMemory32( temp, 0x40055fa0, "Memory" );


__writeMemory32( 0x02000800, 0x40055fa0, "Memory" );


 


 


//vEMC_InitSRDRAM


__writeMemory32(0x00005555, 0x40086d00, "Memory" );


__writeMemory32(0x00000001, 0x40005000, "Memory" );


__writeMemory32(0x00000000, 0x40005008, "Memory" );


__writeMemory32(0x00004700, 0x40005100, "Memory" );


__writeMemory32(0x00004700, 0x40005140, "Memory" );


__writeMemory32(0x00000303, 0x40005104, "Memory" );


__writeMemory32(0x00000303, 0x40005144, "Memory" );


__writeMemory32(0x00000001, 0x40005028, "Memory" );


__writeMemory32(0x00000002, 0x40005030, "Memory" );


__writeMemory32(0x00000005, 0x40005034, "Memory" );


__writeMemory32(0x00000008, 0x40005038, "Memory" );


__writeMemory32(0x00000001, 0x4000503c, "Memory" );


__writeMemory32(0x00000005, 0x40005040, "Memory" );


__writeMemory32(0x00000001, 0x40005044, "Memory" );


__writeMemory32(0x00000008, 0x40005048, "Memory" );


__writeMemory32(0x00000008, 0x4000504c, "Memory" );


__writeMemory32(0x00000008, 0x40005050, "Memory" );


__writeMemory32(0x00000001, 0x40005054, "Memory" );


__writeMemory32(0x00000001, 0x40005058, "Memory" );


__writeMemory32(0x00000183, 0x40005020, "Memory" );


__delay( 100 );


__writeMemory32(0x00000103, 0x40005020, "Memory" );


__writeMemory32(0x00000002, 0x40005024, "Memory" );


__delay( 100 );


__writeMemory32(0x00000076, 0x40005024, "Memory" );


__writeMemory32(0x00000083, 0x40005020, "Memory" );


__writeMemory32(0x00000000, 0x40005020, "Memory" );


__writeMemory32(0x00084700, 0x40005100, "Memory" );


__writeMemory32(0x00084700, 0x40005120, "Memory" );


__writeMemory32(0x00084700, 0x40005140, "Memory" );


__writeMemory32(0x00084700, 0x40005160, "Memory" );


<div>Any help is appreciate! Thanks</div>

Outcomes