Data structure memory allocation

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

Data structure memory allocation

304 次查看
SelfMad_Man
Contributor I

Hello NXP support team,

I’m using a imxrt1050evb (rev.b) and a modified example code of led blinking “evkbimrt1050_iled_blinky” provided by MCUXpresso for this evaluation board.

I've modified example code as regards:

  • Split flash memory in two partitions: Flash (@0x60000000) and Flash2 (@0x62000000);

SelfMad_Man_0-1714744058948.png

  • Added file “test.h” in source folder;

SelfMad_Man_1-1714744058970.png

  • Added file “test.c” in source folder;

SelfMad_Man_2-1714744058989.png

  • Added instructions in “led_blinky.c” in order to compile “data_container” struct:

SelfMad_Man_3-1714744059002.png

SelfMad_Man_4-1714744059014.png

SelfMad_Man_5-1714744059031.png

My purpose is to compile and store all fields of “data_container” in "Flash2" as by the instruction below:

__RODATA(Flash2) const container_t data_container = …

In debug mode I’ve checked the position in memory of “data_container” and its fields:

  • “data_container”             @ 0x62000000 (OK as expected in Flash2 partition)
  • “data_container.length”  @ 0x62000008 (OK as expected in Flash2 partition)
  • “data_container.title”      @ 0x600054d8 (NOT OK it’s inside Flash partition)
  • “data_container.series”  @ 0x600054e4 (NOT OK it’s inside Flash partition)

SelfMad_Man_6-1714744059043.png

Can you provide me instructions (pragma or other) to solve this question? If possible, avoiding struct of predefined fixed length.

Thank you.

标签 (1)
0 项奖励
回复
1 回复

226 次查看
diego_charles
NXP TechSupport
NXP TechSupport

Hi @SelfMad_Man 

I have been cheking on my side, but unfortunately,  I do not know proper way to link your data type in Flash2. If you find, or already find  a way please share it.

Maybe trying Linkerscripts could help. We have an example of how to use it in FlexSPI NOR polling demo on the SDK. Check for more info in the MCUXpresso IDE user guide. 

Let me know if there is something I still could do to help.

Diego

 

 

 

0 项奖励
回复