Constant Table in FLASH

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Constant Table in FLASH

Jump to solution
528 Views
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

Labels (1)
0 Kudos
1 Solution
425 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
426 Views
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 Kudos