Issues using SDRAM for global data placement with freeRTOS and lpi2c

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

Issues using SDRAM for global data placement with freeRTOS and lpi2c

Jump to solution
1,224 Views
tbtbtbt
Contributor III

Hello,

I am trying to reconfigure my project to have global data placement in the SDRAM, I am using mx rt 1020 board. I define XIP_BOOT_HEADER_DCD_ENABLE = 1 and SKIP_SYSCLK_INIT and the project compiles just fine and I can see that global variables are placed in the SDRAM. I also configure the MCU settings as in the picture below:

tbtbtbt_0-1645075757172.png

And my configurations for the linker script page:

tbtbtbt_1-1645077809491.png

I am able to begin running the program. The problem is that the program halts when I lpi2c_rtos_init is called within BOARD_InitPeripherals. Specifically, when it tries to generate mutex / allocate memory. The program gets stuck in the xTaskResumeAll function since the function call doesn't match the previous call to vTaskSuspendAll. I am obviously missing something in my configurations, but am having a hard time figuring out exactly what that could be. 

I have tried following other forum posts such as this one 

https://community.nxp.com/t5/MCUXpresso-IDE/SDRAM-configuration-on-MIMXRT1050-EVK-B-using-FreeRTOS/m... 

and this one

https://community.nxp.com/t5/MCUXpresso-IDE/Issue-with-MIMXRT1050-EVK-FreeRTOS-and-SDRAM-for-data-st... 

But neither of these posts have helped solve my specific issue.

I have been able to successfully initialize the lpi2c rtos interface by reconfiguring the heap and stack placement to SRAM_ITC or to SRAM_DTC, however this causes task creation to fail later in the program. I am assuming that the memory configurations for freeRTOS are expecting something different than what I am giving them.

Another thing that I've thought could be the problem is defining SKIP_SYSCLK_INIT, since the peripherals use the system PLL along with semc, but I find this unlikely.  

I was hoping someone could give me some direction on where to begin looking, or what could possibly be causing the issue. I'm very new to this sort of programming and appreciate any help. 

Labels (1)
0 Kudos
1 Solution
1,210 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @tbtbtbt ,

This problem may caused by SDRAM cache feature. You'd better put heap in noncacheable area. You can assign part of SDRAM space to be noncacheable in BOARD_ConfigMPU().

 

Regards,

Jing

View solution in original post

0 Kudos
2 Replies
1,211 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @tbtbtbt ,

This problem may caused by SDRAM cache feature. You'd better put heap in noncacheable area. You can assign part of SDRAM space to be noncacheable in BOARD_ConfigMPU().

 

Regards,

Jing

0 Kudos
1,193 Views
tbtbtbt
Contributor III

@jingpan

I was able to follow your advice and this post to make it work.

Thank you!

0 Kudos