3楼说得对。<br /><br />我改了启动代码:<br />;scatter des file test<br />; IMPORT |Image$$RO$$Limit| ; End of ROM code (=start of ROM data)<br /> IMPORT |Image$$SDRAM1$$Limit| ; End of ROM code (=start of ROM data)<br />; IMPORT |Image$$RW$$Base| ; Base of RAM to initialise<br /> IMPORT |Image$$SDRAM2$$Base| ; Base of RAM to initialise<br />; IMPORT |Image$$ZI$$Base| ; Base and limit of area<br /> IMPORT |Image$$SDRAM2$$ZI$$Base| ; Base and limit of area<br />; IMPORT |Image$$ZI$$Limit| ; to zero initialise;<br /> IMPORT |Image$$SDRAM2$$ZI$$Limit| ; to zero initialise;<br /><br /><br />;scatter des file test<br /> LDR r0, =|Image$$SDRAM1$$Limit| ; Get pointer to ROM data<br /> LDR r1, =|Image$$SDRAM2$$Base| ; and RAM copy<br /> LDR r3, =|Image$$SDRAM2$$ZI$$Base| <br /> ;Zero init base => top of initialised data<br /> <br /> CMP r0, r1 ; Check that they are different<br /> BEQ %F1<br />0 <br /> CMP r1, r3 ; Copy init data<br /> LDRCC r2, [r0], #4 ;--> LDRCC r2, [r0] + ADD r0, r0, #4 <br /> STRCC r2, [r1], #4 ;--> STRCC r2, [r1] + ADD r1, r1, #4<br /> BCC %B0<br />1 <br /> LDR r1, =|Image$$SDRAM2$$ZI$$Limit| ; Top of zero init segment<br /> MOV r2, #0<br />2 <br /> CMP r3, r1 ; Zero init<br /> STRCC r2, [r3], #4<br /> BCC %B2<br /><br /><br />-----------------------------------<br />还是很麻烦的,呵呵。<br />
|