谁知道如何在71x_init.s中添加remapping代码? 已有的代码如下,但这个代码有点问题。 ; define remapping ; If you need to remap memory before entring the main program ; uncomment next ligne #define remapping
; Then define which memory to remap to address 0x00000000 ; Uncomment next line if you want to remap RAM #define remap_ram
; Uncomment next line if you want to remap FLASH ; #define remap_flash
; Uncomment next line if you want to remap EXT FLASH ; #define remap_extflash
#ifdef remapping #ifdef remap_flash MOV r0, #FLASH_mask #endif #ifdef remap_ram MOV r0, #RAM_mask #endif #ifdef remap_extflash MOV r0, #EXTFLASH_mask #endif
LDR r1, =CPM_Base_addr LDRH r2, [r1, #BOOTCR_off_addr]; Read BOOTCR Register BIC r2, r2, #0x03 ; Reset the two LSB bits of BOOTCR ORR r2, r2, r0 ; change the two LSB bits of BOOTCR STRH r2, [r1, #BOOTCR_off_addr]; Write BOOTCR Register #endif
有一段ads1.2的代码,但我不知道如何改为IAR for ARM的: IMPORT |Image$$RO$$Limit| ; End of ROM code (=start of ROM data) IMPORT |Image$$RW$$Base| ; Base of RAM to initialise IMPORT |Image$$ZI$$Base| ; Base and limit of area IMPORT |Image$$ZI$$Limit| ; to zero initialise
;******************************************************** ;* Copy and paste RW data/zero initialized data * ;******************************************************** LDR r0, =|Image$$RO$$Limit| ; Get pointer to ROM data LDR r1, =|Image$$RW$$Base| ; and RAM copy LDR r3, =|Image$$ZI$$Base| ;Zero init base => top of initialised data CMP r0, r1 ; Check that they are different BEQ %F1 0 CMP r1, r3 ; Copy init data LDRCC r2, [r0], #4 ;--> LDRCC r2, [r0] + ADD r0, r0, #4 STRCC r2, [r1], #4 ;--> STRCC r2, [r1] + ADD r1, r1, #4 BCC %B0 1 LDR r1, =|Image$$ZI$$Limit| ; Top of zero init segment MOV r2, #0 2 CMP r3, r1 ; Zero init STRCC r2, [r3], #4 BCC %B2 上述代码可以将要remapping的内容写入boot 0x00000000。但是如何改为IAR for ARM的格式哪?有谁知道,先谢了! |