RT1050: How to boot from SD Card

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

RT1050: How to boot from SD Card

Jump to solution
15,508 Views
haryanl
Contributor IV

Hi

I'm trying to boot from the SD card on the board RT1050

According to the Application Note AN12107 tutorial, use the IAR toolchain to generate the flash file. Then  using MFG tool to program an image to SD Card and Boot from the SD Card.

But I'm not using IAR right now,

so, how can i program an image to SD Card without using IAR. Example by MCUXpresso

Best Regards,

Haryanl

Labels (2)
Tags (2)
0 Kudos
1 Solution
15,277 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl ,

  Thanks a lot for your patient. Already finished the testing on my side.

  Good news to you, I totally make it works on my side.

  I attach my project, the generated .s file, maybe your generated code has issues.

  Please follow me to test it again:

1. Download the MCUBootUtility tool, this tool is more good to use, i use this download the code to the SD card.

https://github.com/JayHeng/NXP-MCUBootUtility/releases/tag/v3.3.1

2. Use my attached evkbimxrt1050_ew_gui_graphics_accelerator.s19 file, I generated the code which is located in the SDRAM. Find it in the attached file:

evkbimxrt1050_ew_gui_graphics_accelerator\Debug

3. Use the MCUbootutility tool to download the code

 SW7:1-ON 2-OFF 3-OFF 4-ON. usb cable connect to J28 and J9.

kerryzhou_1-1628663909353.png

dcd.bin path is:

NXP-MCUBootUtility-3.3.1\src\targets\MIMXRT1052\evkbmimxrt1050_xip_boot_header_dcd.bin

kerryzhou_2-1628663917582.png

Then connect  to ROM, 

kerryzhou_3-1628663998721.png

APP file just select my attached .s19 file, click step 3 all-in-one-Action button download the code and wait the download finished.

Then exit the MCUbootutility tool: reset device.

Now, SW7:1-ON 2-OFF 3-ON 4-OFF. press reset button on the board or repower on the board, you will find your LCD is working.

My video is in the attached 1.zip, this is the picture:

kerryzhou_4-1628664834170.jpeg

 

Wish it helps you!

Best Regards,

Kerry

 

 

View solution in original post

0 Kudos
29 Replies
14,332 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl 

  Seems the evkbimxrt1050_ew_gui_bezier_clock project is not the SDK project, do you create it by yourself?

  I checked the SDK2.10.0, no this project.

kerryzhou_0-1628495314196.png

So, I run your code directly, debug it at first, just run it on my MIMXRT1050-EVKB board, when I run it, it can go to the main, but, when do full run, it enter the hardfault:

kerryzhou_1-1628495825078.png

So, seems your original project has issues if download to the SDRAM directly.

That's why you copy it from SDCard to the SDRAM and run it, it has issues.

You also can debug it at first.

Best Regards,

kerry

 

 

0 Kudos
14,317 Views
haryanl
Contributor IV

Hi Kerry

sorry for my late reply

I used SDK_2.9.1_EVKB-IMXRT1050, so there's a project "ew_gui_bezier_clock" in it

 

haryanl_0-1628593837686.png

 

I just downloaded SDK_2.10.0, and tried with project "ew_gui_graphics_accelerator", With QSPI boot, works fine.
But when I tried to try to boot from SD, got the same error.

haryanl_1-1628593837688.png

 

Here are the steps I did:

  1. In Tool Settings > MCU Linker > Managed Linker Script -> check Link application to RAM. 
  2. Project > Properties - C/C++ Build > Settings > Tool Settings > MCU C Compiler > Preprocessor -> add defined symbol SKIP_SYSCLK_INIT=1. 
  3. disable the XIP header XIP_BOOT_HEADER_ENABLE=0
    haryanl_2-1628593837694.png

     

  4. In Project > Properties > C/C++ Build > MCU settings, modify BOARD_SDRAM to start at 0x80002000 with size 0x1dfe000. Move BOARD_SDRAM to first position to make it default 
    haryanl_3-1628593837695.png

     

  5. Build the image 
    make the file "evkbimxrt1050_ew_gui_smart_thermostat.axf"
  6. Use the MCUxpresso Secure Provisioning
        6.1. Set EVK in serial Download mode (SW7 0010)
        6.2. Build image
    haryanl_4-1628593837708.png

     

    6.3. Write Image

haryanl_5-1628593837711.png

 

  1. change the boot mode to internal boot (SW7 1010) and reset

But the app does not seem to run, the screen does not respond, when viewing the log, it is stuck at "Initialize Graphics Engine"

haryanl_6-1628593837760.png

 

haryanl_7-1628593837761.png

 

 please correct my mistake

Can you check from the beginning, my goal is to know how to boot from SD card

Thanks & Best Regards,

Haryanl

 

 

0 Kudos
15,278 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl ,

  Thanks a lot for your patient. Already finished the testing on my side.

  Good news to you, I totally make it works on my side.

  I attach my project, the generated .s file, maybe your generated code has issues.

  Please follow me to test it again:

1. Download the MCUBootUtility tool, this tool is more good to use, i use this download the code to the SD card.

https://github.com/JayHeng/NXP-MCUBootUtility/releases/tag/v3.3.1

2. Use my attached evkbimxrt1050_ew_gui_graphics_accelerator.s19 file, I generated the code which is located in the SDRAM. Find it in the attached file:

evkbimxrt1050_ew_gui_graphics_accelerator\Debug

3. Use the MCUbootutility tool to download the code

 SW7:1-ON 2-OFF 3-OFF 4-ON. usb cable connect to J28 and J9.

kerryzhou_1-1628663909353.png

dcd.bin path is:

NXP-MCUBootUtility-3.3.1\src\targets\MIMXRT1052\evkbmimxrt1050_xip_boot_header_dcd.bin

kerryzhou_2-1628663917582.png

Then connect  to ROM, 

kerryzhou_3-1628663998721.png

APP file just select my attached .s19 file, click step 3 all-in-one-Action button download the code and wait the download finished.

Then exit the MCUbootutility tool: reset device.

Now, SW7:1-ON 2-OFF 3-ON 4-OFF. press reset button on the board or repower on the board, you will find your LCD is working.

My video is in the attached 1.zip, this is the picture:

kerryzhou_4-1628664834170.jpeg

 

Wish it helps you!

Best Regards,

Kerry

 

 

0 Kudos
14,273 Views
haryanl
Contributor IV

Hi Kerry

Thank you very much for your support
I used your project and tested OK.
I tried editing from the original project in the SDK, but it doesn't work like your project
Refer to your project, I modified from the original project as follows:
1. Link application to RAM

haryanl_0-1628674712599.png

 


2. in MCU setting
move SDRAM to 2nd position, edit location 0x80000000 to 0x80002000,
and Size from 0x1e00000 to 0x1dfe000
-> Can you explain to me why change to 0x1dfe000?

haryanl_1-1628674824429.png

 


3. in C/C++ Build/Setting/ MCU C Compiler/Preprocessor
change XIP_EXTERNAL_FLASH=1 ->0
XIP_BOOT_HEADER_ENABLE=1->0
XIP_BOOT_HEADER_DCD_ENABLE=1->0

haryanl_2-1628674871896.png

 


4. Build project, create .S19 file
5. Use MCUbootutility tool to download the code according to your instructions. 
reset board. But It's not work 

Did I miss something?, please help me

My project is in the attached

Best Regards,

Haryanl

0 Kudos
14,267 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl ,

  In fact, my project also share with you, you can check that project, I also modify the stack start address, just in the link to RAM page.

  You can compare your modification with my project.

 

Best Regards,

KERRY

 

0 Kudos
14,245 Views
haryanl
Contributor IV

Hi Kerry

sorry for my trouble
I have compared 2 projects very carefully, I have set project properties as your project. Looks like you didn't modify the source code either.
But my project is still not running.
I really don't know what else to do.
please can you check the missing in my project?

Best regards,

Haryanl

0 Kudos
14,229 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl 

  Which IDE version you are using?

  Do you try to close the project, delete the whole workspace, and create a new one, then import your own project, whether that works OK or not?

BTW, you need to drag the newest SDK to your IDE.

Best Regards,

kerry

0 Kudos
14,225 Views
haryanl
Contributor IV

Hi @kerryzhou 

Do you try to close the project, delete the whole workspace, and create a new one, then import your own project, whether that works OK or not?
BTW, you need to drag the newest SDK to your IDE

-> I just tried it, but the result is still the same
I am using IDE version 11.3.1, But I think, it's not related to IDE, because when I build your project, it runs normally.

With the project that I have set, can you run it?

sorry for the trouble

Best Regardss,

Haryanl

0 Kudos
14,163 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl 

You didn't modify the stack start location, which I have told you in the previous reply with description:

kerryzhou_0-1629081896442.png

After this modification, your project also works on my side.

Please check it again on your side.

Best Regards,

Kerry

 

14,160 Views
haryanl
Contributor IV

Hi @kerryzhou 

I fixed it and my project is running
I was thinking to fix the memory stack
Finally, I really appreciate your enthusiasm

Allow me to close this topic

Thank & Best Regards,

Haryanl

0 Kudos
14,158 Views
kerryzhou
NXP TechSupport
NXP TechSupport

You are welcome!

 Any new questions in the future, welcome to create a new case.

 

Best Regards,

Kerry

0 Kudos
14,266 Views
haryanl
Contributor IV
 
0 Kudos
14,304 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl 

  I will test your mentioned ew_gui_graphics_accelerator project, do you want to use the LCD and ew gui when you boot from SD card? Do you try the simple project, eg, helloworld, or led_blinky project whether that works OK or not?

   After my testing, I will let you know about ew_gui_graphics_accelerator testing result.

Best Regads,

Kerry

0 Kudos
14,502 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl 

   As the IDE need to have the program files, and now, we just have the external flash method, as you know, the SDcard code can't support debug directly. so normally, we will generate the app, then use these tools to download the code to the external sdcard: MCUBootUtility, MFGtool, MCUXpresso Secure Provisional tool(SPT).

  You can refer to my post:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1050-SDRAM-app-code-boot-from-SDcard-burn-with...

  So, IDE generate the app file, then use the above 3 method to downoad code to the sdcard.

Wish it helps you!

Best Regards,

Kerry

0 Kudos
14,500 Views
haryanl
Contributor IV

Hi kerry

Thank for your reply
Let me try it

I'm wondering if it will work with applications with size >10MB or not!
For example "Crank_storyboard_coffeeapp" Demo app
Is there a limit on the size of the app?

Best Regards,
Haryanl

0 Kudos
14,497 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl 

    I think it is OK, you can try it.

    Just make sure, the used internal memory FlexRAM(ITCM, DTCM, OCRAM) is not exceed the max size.

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos
14,493 Views
haryanl
Contributor IV

Hi Kerry

Following your instructions, I burned the code to the external SD card with MCUXPresso Secure Provisioning.
For iled_blinky app, I tried it successfully.
but when I try with "evkbimxrt1050_ew_gui_bezier_clock" app(app size 3.5MB), the clock doesn't run, Touch doesn't work either.
Is it lack of memory, I don't understand it well. Is there any way to fix this?

Best Regards,

Huy

0 Kudos
14,487 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl 

   Do you use the SDRAM in the evkbimxrt1050_ew_gui_bezier_clock project? If yes, in the SPT tool, you also need to add the SDRAM DCD.bin file, otherwise it will has issues.

  You can give me your SPT tool add app screenshot, I need to check it at first.

 

Best Regards,

Kerry

0 Kudos
14,481 Views
haryanl
Contributor IV

Hi Kerry

Yes, I'm using SDRAM.

According to the SPT User Guide"MCUXSPTUG", I have set up the SDRAM as below

haryanl_0-1627528102474.pngharyanl_1-1627528230518.png

When burning to SD card with SPT, I use the default DCD stored in the path:
C:\nxp\MCUX_Provi_v3\bin\data\targets\MIMXRT1050\evkbmimxrt1050_SDRAM_dcd.bin

Everything I do is like Iled_blinky project
Do I need to edit somewhere else?
I attached my project

Best Regards,

Haryanl 

0 Kudos
14,476 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @haryanl 

 Do you want to copy your whole data to the external SDRAM and run it?

 What's the RT1050 board you are using? MIMXRT1050-EVKB?

Your evkbimxrt1050_ew_gui_bezier_clock is your own project, not the SDK directly project?

Before you download to the SD card, whether it works on the external flash?

Best Regards,

Kerry

0 Kudos