Application image running on SDRAM in iMXRT1160_evk

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

Application image running on SDRAM in iMXRT1160_evk

1,688 Views
sathishkumar-rk
Contributor II

Hi Team,

I want to use ram loading feature in iMXRT1160. But, while creating application to run in SDRAM it getting crashed. Looks like the linker setting is not configured to run from SDRAM location.

Please find the some more details regarding issue in below github community forum.

RAM loading on SDRAM · Discussion #48242 · zephyrproject-rtos/zephyr (github.com)

The expectation is bootloader (MCUBoot) will copy the application image from flash memory to SDRAM location then execute the application from SDRAM location.

Is this possible on iMXRT1160_evk board?

Thanks,

Sathishkumar K

0 Kudos
5 Replies

1,599 Views
dereksnell
NXP Employee
NXP Employee

Hi @sathishkumar-rk and @Omar_Anguiano ,

Sorry for the confusion here.  This topic is specific to Zephyr OS.  And as stated on our Zephyr NXP Support Page, we feel it is best to support Zephyr-related topics in Zephyr's GitHub Community.

@sathishkumar-rk , in your GitHub discussion on this topic, when I said "You can create an issue to report this, and it will be assigned to NXP."  I meant create an Issue in the GitHub Zephyr Community.  That would track this issue with the Zephyr repo.  The issue will be assigned to NXP, and the NXP Zephyr software team can address it.  Please use this link to create a GitHub Issue as a bug report, and report the issue there when selecting CONFIG_CODE_SEMC=y.

We will continuing using GItHub to conclude this Zephyr-related issue.  And Omar can close this ticket here.  

Best regards

0 Kudos

1,675 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
I hope you are well.

You can use this post as a reference: https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1050-Booting-from-serial-NOR-flash-to-SDRAM/ta...

If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 Kudos

1,667 Views
sathishkumar-rk
Contributor II

Hi @Omar_Anguiano ,

The given steps is to run application on SDRAM, if I'm using standalone application what i meant as standalone application is BOOT_ROM will do boot application from SDRAM.

But really what i want is BOOT_ROM will run MCUBOOT in flash (NOR flash) & MCUBoot will have to move the application image to SDRAM location at run time ( the ram loading feature) and run it from there.

BOOT_ROM --> MCUBoot --> Application Image (on SDRAM)

I did build the code to run on SDRAM location, but it try to run from SDRAM location it get crashes, as far as my understanding the linker setting for RT1160 is not supported for run using SEMC (SDRAM) location.

Added the snapshot of conversion thread which is carried on github discussion regards this issue for your reference & linked github link below to go through the entire conversation.

sathishkumarrk_0-1663247798768.png

let me know further information required regarding this issue.

Thanks,

Sathishkumar K

0 Kudos

1,631 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

The previously attached link contains instructions on how to program a boot image to serial NOR flash that will be copied to the SDRAM at boot time and executed from there.

An image can be located in an SD card or external flash (FlexSPI NOR or SEMC NAND) and during boot will be copied into SDRAM and executed from there.

  1. Select Project > Properties - C/C++ Build > Settings > Tool Settings > MCU Linker > Managed Linker Script and check Link application to RAM.
  2. Select Project > Properties - C/C++ Build > Settings > Tool Settings > MCU C Compiler > Preprocessor and add defined symbol SKIP_SYSCLK_INIT=1.
  3. In Project > Properties > C/C++ Build > MCU settings, delete Flash, and modify BOARD_SDRAM to start at 0x80002000 with size 0x1dfe000. Move BOARD_SDRAM to first position to make it default.
  4. Build the image.
  5. Load the image with Secure Provisioning Tool

 

These instructions are for MCUXpresso.
If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 Kudos

1,611 Views
sathishkumar-rk
Contributor II

Hi @Omar_Anguiano ,

I can able to run the  MCUXpresso SDK sample code from RAM.

What I'm trying is run the zephyr application from SDRAM location. The process will be like this MCUBoot will copy the zephyr application from flash to SDRAM and run it from SDRAM.

Had discussion in MCUBoot GitHub community @dereksnell is suggested to post the issue in NXP community.

Comment from dereksneel is "You can build the code for SDRAM using CONFIG_CODE_SEMC=y. However, when I test with this, I see when z_bss_zero() is called in the startup code, it trashes the code memory in SDRAM. So it seems the linker settings for this RT1160 are not configured for CONFIG_CODE_SEMC=y, and allow the BSS section to overlap code in SDRAM."

So, if code is built to run from SDRAM and when try to run application it's getting crash.

Thanks,

Sathishkumar K

0 Kudos