打印
[DSC]

请教 CodeWarrior 固定数组到ram地址?(已解决)

[复制链接]
3189|9
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
itelectron|  楼主 | 2014-10-9 12:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
FSL_TICS_ZJJ| | 2014-10-9 13:38 | 只看该作者
楼主你好!
你可以参考下这个帖子:https://bbs.21ic.com/icview-696256-1-1.html
当然需要把地址改为你RAM的地址,然后再加入定义数据的代码。
这个是kinetis方面的,你可以试下行不行,如果不行,我会帮你转给DSC工程师。

使用特权

评论回复
板凳
itelectron|  楼主 | 2014-10-9 19:09 | 只看该作者
FSL_TICS_ZJJ 发表于 2014-10-9 13:38
楼主你好!
你可以参考下这个帖子:https://bbs.21ic.com/icview-696256-1-1.html
当然需要把地址改为你RAM ...

   MEMORY
{
    .p_interrupts_flash_ROM (RX)  : ORIGIN = 0x0000,   LENGTH = 0x00A4   # reserved for 5682x interrupts
    .p_flash_ROM            (RX)  : ORIGIN = 0x00A4,   LENGTH = 0x3F5C   # pROM is 16K words total

     # p_flash_ROM_data mirrors x_internal_RAM, mapping to origin and length
     # the "X" flag in "RX" tells the debugger flash p-memory.
     # the p-memory flash is directed to the address determined by AT
     # in the data_in_p_flash_ROM section definition  
     
    .p_flash_ROM_data       (RX)  : ORIGIN = 0x0001,   LENGTH = 0x0FFF # internal xRAM mirror

#   .p_reserved_1                 : ORIGIN = 0x4000,   LENGTH = 0x1C000   
    .p_boot_flash_ROM       (RX)  : ORIGIN = 0x20000,  LENGTH = 0x1000   # 4K words
#   .p_reserved_2                 : ORIGIN = 0x21000,  LENGTH = 0xE800   # 58K words   
    .p_internal_RAM         (RWX) : ORIGIN = 0x2F800,  LENGTH = 0x0800   # 2K words   
#   .p_reserved_3                 : ORIGIN = 0x30000,  LENGTH = 0x0000   
    .x_internal_RAM         (RW)  : ORIGIN = 0x0001,   LENGTH = 0x0FFF   # 4K x 16
    .x_flash_ROM            (R)   : ORIGIN = 0x1000,   LENGTH = 0x1000   # 4K x 16
#   .x_reserved_1                 : ORIGIN = 0x2000,   LENGTH = 0xD000   
    .x_onchip_peripherals   (RW)  : ORIGIN = 0xF000,   LENGTH = 0x1000   # n/a w/SDM
#   .x_reserved_2                 : ORIGIN = 0x010000, LENGTH = 0xFEFF00 # n/a
    .x_EOnCE                (RW)  : ORIGIN = 0xFFFF00, LENGTH = 0x0000   # n/a w/SDM
}

.mydata :
    {
      __RAM_SYMBOLS = .;
      . =ALIGN(4);
      KEEP(*(.ramsymbols))
      . =ALIGN(4);
    }>x_internal_RAM

使用特权

评论回复
地板
itelectron|  楼主 | 2014-10-9 19:10 | 只看该作者
本帖最后由 itelectron 于 2014-10-9 19:11 编辑

不行 提示 错误
__attribute__((section (".ramsymbols"))) char test[4] ={0x55,0xAA,0x55,0xaa};



Link Error   : Linker command file error at line 142
File not found: KEEP

Link Error   : Linker command file error at line 142
Expecting




使用特权

评论回复
5
itelectron|  楼主 | 2014-10-9 19:10 | 只看该作者
用的是 CodeWarrior for DSC56800E v8.3

使用特权

评论回复
6
FSL_TICS_ZJJ| | 2014-10-10 09:03 | 只看该作者
好的,待会我会把你的题转给我们的DSC工程师,他会帮你解答,还请耐心等待下。

使用特权

评论回复
7
xiangjunrong| | 2014-10-10 13:22 | 只看该作者
In your application code, define the array in this way.
#pragma define_section mysection ".mysection.data" RW
/* 2. Specify the data to be put into the section. */
#pragma section mysection begin
int a[10] = {'00','10','12','13','14','15','16','17','18','19'};
int b[10];
#pragma section mysection end

You have to modify the link file in this way:
//0x3000 adress and the length is 0xBFFF,pls refer to sdm_pROM_xRAM.cmd file for detail inf.
//                .x_Data1 (RW): ORIGIN =0x3000,LENGTH = 0xBFFF #internal data memory space  
//       .ApplDat:
//        {
//        * (.mysection.data)
//        }> .x_Data1

使用特权

评论回复
8
FSL_TICS_ZJJ| | 2014-10-10 14:09 | 只看该作者
楼主你好,7楼是我们飞思卡尔的DSC工程师,你可以按照他的方法做下试试。
如果还有问题,欢迎继续交流。

使用特权

评论回复
9
itelectron|  楼主 | 2014-10-11 13:42 | 只看该作者
FSL_TICS_ZJJ 发表于 2014-10-10 14:09
楼主你好,7楼是我们飞思卡尔的DSC工程师,你可以按照他的方法做下试试。
如果还有问题,欢迎继续交流。 ...

问题勉强解决 有没有更便捷的方法

比如    char test[4]  at 0x1000;

还有就是7楼的方法 定义的 段  会不会被 覆盖掉  比如 我在  其他地方  定义一个数组  char test2[400]

使用特权

评论回复
10
FSL_TICS_ZJJ| | 2014-10-11 13:46 | 只看该作者
itelectron 发表于 2014-10-11 13:42
问题勉强解决 有没有更便捷的方法

比如    char test[4]  at 0x1000;

你分配好的段,就是用于之前变量定义用的,如果额外定义变量,不会被划分到分配好的段里面,所以不会被覆盖。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:MARK: zhi kan ji shu

274

主题

2762

帖子

8

粉丝