7个帖子/ 0新
Last post
CD
Offline
Last seen:3 years 9 months ago
加入:2015-11-18 02:51
使用保留RAM区域

Hi all,

Please let me ask the question about the usage for “Retention RAM” and “SysRAM(page0,1)”.
我们正在努力收缩代码大小。(RAM区域(代码)小于我们的想法......)
我已经阅读了UM-B-011文档,但我仍然无法置信使用这些区域。

=My condition=
- Use Extended Sleep
- BLE_CONNECTION_MAX_USER = 1

=My understandings=
Regarding the UM-B-011, Sizes of ATT, ENV and MSG heaps are:
ATT 1036 Bytes
ENV 360 Bytes
msg 1324字节
and these heaps are allocated to LR_RETENTION_RAM2 depending on Scatter file.
(I also checked real map file.)
And “arch_main.o (BLE_exchange_memory)” is also allocated to LR_RETENTION_RAM2 area.

我列出了地图文件作为下文:
--------
Load Region LR_RETENTION_RAM2 (Base: 0x00080768, Size: 0x00000000, Max: 0x00002898, ABSOLUTE)

执行区域zi_ret20(基数:0x00080768,大小:0x00000a8c,max:0x000022b8,绝对,uninit)

Base Addr Size Type Attr Idx E Section Name Object

0x00080768 0x0000040c Zero RW 541 heap_db_area jump_table.o
0x00080b74 0x00000154 Zero RW 542 heap_env_area jump_table.o
0x00080cc8 0x0000052c Zero RW 544 heap_msg_area jump_table.o

Execution Region ZI_RET21 (Base: 0x00082a20, Size: 0x000005e0, Max: 0x000005e0, ABSOLUTE)

Base Addr Size Type Attr Idx E Section Name Object

0x00082a20 0x000005de Zero RW 287 BLE_exchange_memory arch_main.o
--------
Regarding this .map file, 0x82a20 - (0x80cc8 + 0x52c) = 0x182c (Bytes) seems empty. So we can use this area freely.
> Question 1. Is it correct??

If question 1 is correct, we can use these area to book any variables as __attribute((section(“retention_mem_area0"),zero_init)). There are two places where retention_mem_area0 is defined in Scatter file. (When ext-sleep usage) And if first place(0x20008000) for retention_mem_area0 is not enough to allocate retentioned variables, those variables will be allocated to second place(0x80768-).
>问题2.是否正确?(实际上,我测试了,似乎工作......)

I could move some variables from 0x200000000 area to 0x80000 area, but I couldn’t move code like function() in some_file.c by just adding "some_file.o" to LR_RETENTION_RAM2 region. I got error while writing code to Flash Memory via SmartSnipetts… Is it proper behavior? I think this is proper because I had not defined "some_file.o" to scatter_file as “Executed Region”.
>问题3.是否可以将函数/代码(不变量)移动到此游离保留区域(0x811f4 - 0x82a20)编辑散点图,如执行的区域或其他东西?

If I could have any comment on this, it would be much appreciated.
谢谢very much for your supports in advance.

最好的祝福,
CD

设备:
MT_dialog
Offline
Last seen:1 month 14 hours ago
工作人员
加入:2015-06-08 11:34
嗨CD,

嗨CD,

Yes you can use the region to place data inside. The thing is that when you are in extended sleep the sysram doesn't turns off so all the sysram is retained, when you use the __attribute((section(“retention_mem_area0"),zero_init)) if your retention is full, extra variables will be placed in the sysram and whenever you 've instructed in your scatterfile to place variables with the specific attribute (retention_mem_area0). I suppose that what you 've experienced with the Smart Snippets tool is correct. In order to move functions from the sysram to the retention RAM (0x80000 area for example) you have to declare new execution regions in 0x80000 in the allready existing Load Regions.

Thanks MT_dialog

CD
Offline
Last seen:3 years 9 months ago
加入:2015-11-18 02:51
Hi MT_dialog,

Hi MT_dialog,

非常感谢你的回复。
我可以理解我们可以使用此保留区域进行数据。实际上,它很好。
"Moving the data from SysRAM to Retention RAM"apparentlymakes the memory area on 0x20000000 getting more rooms to code, I think. (Because we don't use 0x80000 area in default except STACK and HEAP. Of course total size is almost same, though...)
- 这是正确的吗?(现在我对DA14583的代码大小限制有问题....我正在寻找警惕以减少/制作代码的房间。即使我将数据移动到Ret.ram区域,大小0x20000000地区不会让房间......我以这种方式假设为0x20000000的房间进行编码。)

Regarding the Execution Region(ER), still I got the error from SmartSnippets....

Read 0 bytes from file ble_app_barebone_580.hex. 15684 bytes have been ignored because their record address was greater or equal to 0x80000.

I'm just testing to move "user_barebone.o" to Retention area on BLE APP Barebone example. I tried to change the SDK standard scatter file "scatterfile_common.sct" to like attached file. But I can't make it yet. What's wrong about my scatter file?? (The sample scatter file is a complex little bit, but I modified it referring bootloader.sct in Secondary boot loader example, and I hope it works.... but it could not yet.)

If anyone could advise me, it would be much much appreciated.

最好的祝福,
CD

盲文
Offline
Last seen:2 years 3 months ago
加入:2016-07-29 10:01
Hi, have you solved this

Hi, have you solved this problem? I am facing the same problem as yours, could you share your solution?

MT_dialog
Offline
Last seen:1 month 14 hours ago
工作人员
加入:2015-06-08 11:34
嗨CD,

嗨CD,

A dialog's local member will contact you for more details on this.

Thanks MT_dialog

盲文
Offline
Last seen:2 years 3 months ago
加入:2016-07-29 10:01
嗨,对话,我也遇到了这个

嗨,对话,我也遇到了这个problem. My application is limited by the code size. I also hope place some function.o to LR_RETENTION_RAM2 . Could you give me an example to follow? Thanks.

MT_dialog
Offline
Last seen:1 month 14 hours ago
工作人员
加入:2015-06-08 11:34
Hi caiziee,

Hi caiziee,

As mentioned in your other post, we will contact you directly on this since there isn't an example that exceeds the 32KB of code that you can compile with the evaluation version of Keil.

Thanks MT_dialog