Constant Table in FLASH

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Constant Table in FLASH

跳至解决方案
552 次查看
LI_Dave
Contributor III

I've done a fair bit of poking around but haven't found a clear explanation of how to do this.  Has anyone done this and can share their findings?

 

Thanks,

Dave

标签 (1)
0 项奖励
1 解答
449 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Dave,

we can allocate constant table in flash with code

const int my_const_array[5] __attribute__((section(".myData"))) = {0x11,0x22,0x33,0x44};

here section .myData is in Flash and  is defined in ld file.

see attached for sample code and video.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
1 回复
450 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Dave,

we can allocate constant table in flash with code

const int my_const_array[5] __attribute__((section(".myData"))) = {0x11,0x22,0x33,0x44};

here section .myData is in Flash and  is defined in ld file.

see attached for sample code and video.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励