How to build program code larger than 32KB

17 posts / 0 new
Last post
toughworld
Offline
Last seen:2 years 12 months ago
Joined:2015-05-12 09:55
How to build program code larger than 32KB

My program came to be larger than 32kb,Then can I build progam larger than 32KB.Of cource the code has to be store in external memory instead of the 32KB OTP.

Device:
MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi toughworld,

Hi toughworld,

If your program exceeds the 32KB of the keil evaluation limit you can either aquire a full licence of keil or you can try to port you project to the GNU toolchain. There is a corresponding document in the application Notes section AN-B-024.pdf that has a short explanation about the porting procedure. The document isn't fully explanatory and the procedure isn't stable, the team is working on that in order to have a better description and a more standarized procedure.

Thanks MT_dialog

toughworld
Offline
Last seen:2 years 12 months ago
Joined:2015-05-12 09:55
对不起,我没有做我的工作

对不起,我没把问题说清楚。我有驾照基尔。那个编译时的错误是错误:L6406E:执行区域中没有与.ANY选择器匹配的prf_utils.o(.constdata)…的空间,这似乎与scatter文件有关。

MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi toughworld,

Hi toughworld,

似乎从散点文件分配的空间不够,您将不得不重新排列散点文件以容纳更大的应用程序为了做到这一点,您可以尝试以下提示,考虑到您正在使用延长睡眠和您的代码不会驻留到OTP:

1. Increase the ER_IROM5 by changing the scatterfile and setting the ER_IROM5 to ER_IROM5 0x20000440 0x7bc0 to gain 0xff space.

2通过删除RW\u IRAM50增加ER\u IROM5中的代码空间,并在ER\u IROM5部分中添加可用空间。您也可以将RW\u IRAM51移动到其他地址。包含非保留堆的一个可能的候选者是ziu RET20部分。通过这样做,从0x20000440到0x200009000的连续内存区将可用于源代码和RW数据。要执行此操作,请遵循以下说明。

a. Remove the RW_IRAM50 and RW_IRAM51 sections

b、 将ER\u IROM5的大小更改为ER\u IROM5 0X20000440(0x9000-0x440)

c. The non retention heap will be moved, say in ZI_RET20, by adding the following line jump_table.o(heap_mem_area_not_ret) in both ZI_RET20 definitions.

Please check the UM-B-011.pdf file for more info regarding the memory map and the scatter files.

Thanks MT_dialog

toughworld
Offline
Last seen:2 years 12 months ago
Joined:2015-05-12 09:55
谢谢,我明白了。

谢谢,我明白了。

凯茜
Offline
Last seen:2 years 1 month ago
Joined:2016-07-29 10:01
嗨,Dialog

嗨,Dialog

如果我像你在散点文件中说的那样做修改,那么代码RO和数据RW的大小将大于32KB,小于35KB。我记得smartsnippets对十六进制闪烁有限制(32KB)。在那种情况下我怎么能闪一下呢?

Thanks a lot.

MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caiziee,

Hi caiziee,

I dont think that Smart Snippets will complain if you try to burn a binary 35KB, but you can always use hex2bin utilty in order to convert the .hex file into a .bin and then burn it to your flash.

Thanks MT_dialog

凯茜
Offline
Last seen:2 years 1 month ago
Joined:2016-07-29 10:01
嗨,Dialog

嗨,Dialog
When I use fromelf.exe from Keil, the bin file generated from hex turns to be quite big.
hex file size: 103KB.
bin file size: 515KB.

凯茜
Offline
Last seen:2 years 1 month ago
Joined:2016-07-29 10:01
嗨,Dialog

嗨,Dialog
I have tried this, but it failed.
因为在我们的应用程序中,有许多部分是在scatter config文件中定义的。地址不连续。当我使用hex2时bin.exe文件,我得到这个输出:
Lowest address = 00000000
Highest address = 00080857
Pad Byte = FF
8-bit Checksum = 9C
当我用智能片段闪过,I got an error "Size of data of selected file plus offset exceeds SPI FLASH memory size (131072 bytes)".

Could you please give me more hints about this? Thank you in advance.

MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caiziee,

Hi caiziee,

This is something related with your application, as mentioned in the other posthttps://support.dialog semiconductor.com/forums/post/dialog-smartbond-bl。。。is responsible that the linker outputs such a large binary. Please check your other post.

Thanks MT_dialog

凯茜
Offline
Last seen:2 years 1 month ago
Joined:2016-07-29 10:01
Thanks, Dialog.

Thanks, Dialog.

Ankit
Offline
Last seen:10 months 3 weeks ago
Joined:2017-05-24 07:42
Hi,

Hi,

I am using keil evaluation version. I am also facing same error.

1. Can I change ER_IROM5 and RW_IRAM50 section size? What will happen if I do so in keil evaluation version?
2决定截面尺寸的参数是什么?
3. Is there any documentation which explains about ER_IROM5 , RW_IRAM50 and other section mentioned in scatter file?

MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi Ankit,

Hi Ankit,

1. By just changing the scatter file, the keil wont complain, but if you try to build a code that is larger than 32K then keil will notify you about the limitation.

2. What do you mean on what parameters ? due to the OTP image space limitation, the available amount of memory in the scatter file is decided to be 32K.

3. You will be able to find some info regarding the memory placement in the UM-B-011.pdf document.

Thanks MT_dialog

zwffcb
Offline
Last seen:2 months 1 week ago
Joined:2017-04-18 10:26
Hi !

Hi !
I modified the .sct file according to the steps you said.
Remove the RW_IRAM50 and RW_IRAM51 sections and move jump_table.o(heap_mem_area_not_ret) in ZI_RET20 .
但是RW\u IRAM50呢?忽略它?

#if (USE_MEMORY_MAP == EXT_SLEEP_SETUP)
.ANY (retention_mem_area0) ; application data
#endif
.ANY (+ZI)

thanks!

MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi zwffcb,

Hi zwffcb,

Yes, you can totally remove the IRAM50 area, this area is reserved on the sysram since the map file is designed in order to operate under the 32KB limitation so any extra space should be allocated for additional uses, since you are trying to enlarge your code, you wont be using the OTP (for deep sleep etc), thus you can eliminate that area.

Thanks MT_dialog

zwffcb
Offline
Last seen:2 months 1 week ago
Joined:2017-04-18 10:26
Hi MT\u对话框

Hi MT\u对话框
谢谢你的回答。

1. Can I change these space address (LR_IROM1 to LR_IROM5) ,Because I still need little space to store my code.
谢谢。

MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi zwffcb,

Hi zwffcb,

更改散点文件以获得一些额外的代码空间并不是那么简单,内存区域(由散点文件定义)中的某些位置无法提交,以回答您关于更改LR\u IROM1上的地址空间的问题。armm0要求IVT从0x0开始,这就是LR\u IROM1所定义的,如果你改变了这个定义,你会搞乱IVT,结果不会很好。

Thanks MT_dialog