查看: 2693|回复: 1

WRITEW 命令怎么用--DSC 连接命令(已解决)

[复制链接]
  • TA的每日心情
    开心
    2018-9-14 09:26
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

    70

    主题

    329

    帖子

    0

    高级会员

    Rank: 4

    积分
    952
    最后登录
    2021-1-4
    发表于 2013-10-4 15:32:55 | 显示全部楼层 |阅读模式
    我在连接命令文件里先用 WRITEW 0x00000000;
     
    但是在elf文件的相应地址上,看不到数据,
     
    大家知道怎么用这个命令吗?
     
    我想用这个命令在程序空间中写一定数量的常量到flash
    回复

    使用道具 举报

    该用户从未签到

    0

    主题

    43

    帖子

    0

    注册会员

    Rank: 2

    积分
    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
     
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-9-27 12:09 , Processed in 0.080661 second(s), 20 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表