在线时间3 小时
UID423742
注册时间2013-3-28
NXP金币0
该用户从未签到
注册会员

- 积分
- 159
- 最后登录
- 1970-1-1
|
发表于 2013-10-10 16:58:19
|
显示全部楼层
RE:WRITEW 命令怎么用--DSC 连接命令(正解)
1)此命令只能写Flash
2)WRITEW 命令必须写入link command 文件中
Writing Data Directly to Memory
You can write data directly to memory using the WRITEx command in the linker
command file. The WRITEB command writes a byte, the WRITEH command writes two
bytes, and the WRITEW command writes four bytes. You insert the data at the section’s
current address.
this is an example I copied in flash_smd.cmd
MEMORY {
.pIntvectorBoot(RWX): ORIGIN = 0x00000000, LENGTH = 0x000000F0 # Reset and cop vectors
.pFlashConfig (RWX): ORIGIN = 0x00000200, LENGTH = 0x00000008 # Reserved for Flash IFR value
.ppFlash (RWX): ORIGIN = 0x00000208, LENGTH = 0x0001F1F5 # Primary flash for user code
.DelayT (RWX): ORIGIN = 0x0001F3FD, LENGTH = 0x00000003 # Bootloading delay time & user code start position
.pFlash (RWX): ORIGIN = 0x0001F400, LENGTH = 0x00000C00 # Primary flash for bootloader, 3Kwords
.xRAM_bss (RW) : ORIGIN = 0x00000000, LENGTH = 0x00000800 # 2Kwords for bss
.xRAM_data (RWX): ORIGIN = 0x00000800, LENGTH = 0x00000200 # 0.5Kwords for global variables
.xRAM (RW) : ORIGIN = 0x00000A00, LENGTH = 0x00001600 # 5.5Kwords for heaps and stacks
.pRAM_code (RWX): ORIGIN = 0x00062000, LENGTH = 0x00002000 # 8Kwords for code
.xRAM_code (RW) : ORIGIN = 0x00002000, LENGTH = 0x00002000 # mirror of .pRAM_code
}
.FlashConfig :
{
WRITEH(0xFFFF); # 0, back door key
WRITEH(0xFFFF); # 1, back door key
WRITEH(0xFFFF); # 2, back door key
WRITEH(0xFFFF); # 3, back door key
WRITEH(0xFFFF); # 4, p-flash protection bits
WRITEH(0xFFFF); # 5, p-flash protection bits
# WRITEH(0xFFFF); # 6, opt register and security byte
WRITEH(0xFFBE); # 6, opt register and security byte
WRITEH(0xFFFF); # 7, eeprom and d-flash protection bits
} > .pFlashConfig
|
|