Bootloader to flash the external QSPI flash

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

Bootloader to flash the external QSPI flash

Jump to solution
5,672 Views
EmbeddedTech
Contributor III

Hi,  

We are using a custom board with iMXRT1062 and would like to add bootloader for flashing the external QSPI flash. I saw the app note AN12604SW for adding secondary bootloader to the application. It has an example for iMXRT1050. Is there an example available for iMXRT1060 or what changes should I make in the 1050 code in order to test in my board.

Thanks.

0 Kudos
Reply
1 Solution
5,295 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

  Already finished the iar app version, you can try it on your side.

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1060-OTA-bootloader-ISP-and-swap-rollback-usag...

 the code iar app.zip :

https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imxrt%40tkb/148/4/iar%20app.zip

When I download the evkmixrt1060_iled_blinky_ota_0x60040000_iar.bin, it also works on my side.

You can try it on your side.

 detail steps is in the above doc linker, comment.

 

If you still have question about it, please kindly let me know.

If your question is solved, please help to mark the correct answer, just to close this case, thanks.

Any new issues, welcome to create the new case.

Best Regards,

Kerry

If your

 

View solution in original post

0 Kudos
Reply
24 Replies
794 Views
mayur1in
Contributor I

Hi @kerryzhou,

I went through one of forum post of yours where you helped the user with second bootloader on IAR compiler.

Can you please help me with Keil MDK IDE changes?

We're using MIMXRT1062XVN5B and external flash W25Q128JV. So I need to implement the bootloader which will run from external flash.

We have already implemented the Application code which is running from external flash.

It would be great help if you can just give me some pointers from where to start the bootloader on Keil MDK.

We're using customized board.

0 Kudos
Reply
5,177 Views
mjbcswitzerland
Specialist V

Hi

See also this for an off-the-shelf boot loader for the MIMXRT106x with many features and security options:
https://www.utasker.com/iMX/RT1060.html
https://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf
https://www.utasker.com/docs/iMX/Loader.pdf

It also includes an IAR project - see guide: https://www.utasker.com/docs/iMX/IAR.pdf

Used reliably in many industrial i.MX RT 10xx products since 2019, documented and supported.

Video guides: https://www.youtube.com/watch?v=GXztWg9m6_8&list=PLWKlVb_MqDQEOCnsNOJO8gd3jDCwiyKKe

Regards

Mark (uTasker project lead since 2004)

For our discounted i.MX and Kinetis stock availability see https://www.utasker.com/Shop/semi.html




5,422 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

  RT1060 have a lot of bootloader.

1.your mentioned:AN12604SW 

\Bootloader\AN12604SW\sw12604\rt1060_rom_api

 2. SDK demo:

\SDK_2_14_0_EVK-MIMXRT1060\boards\evkmimxrt1060\ota_examples

3. SBL&SFW

https://www.nxp.com/docs/en/application-note/AN13460.pdf

1). SBL Repository https://github.com/NXPmicro/sbl
2) SFW Repository https://github.com/NXPmicro/sfw
3). MCU-OTA SBL and SFW User Guide (document MCUOTASBLSFWUG)

 

Wish it helps you!

If you still have question about it, please kindly let me know.

Best Regards,

Kerry

 

0 Kudos
Reply
5,400 Views
EmbeddedTech
Contributor III

Hi @kerryzhou ,

Thank you for your quick response.

I was looking into the article for secondary bootloader in the below link,

RT1060 OTA bootloader ISP and swap rollback usage - NXP Community

If my understanding is correct, I can use the ota_bootloader_dcd_uart as Secondary bootloader in my product directly and flash using debugger. Then modify my application code as per the instructions in the iled_blinky and can use the blhost tool to program the flash. Is that correct?

If so, is the same example project available with the IAR toolchain or is there any application note to convert the MCUXpresso project to IAR?

Thanks for your help.

 

0 Kudos
Reply
5,389 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

  Yes, I write that document!

  But the new SDK version already doesn't use that demo, if you want to use it, you may need to download SDK_2_10_0_EVK-MIMXRT1060:

https://mcuxpresso.nxp.com/en/builder?hw=EVK-MIMXRT1060&rel=494

Yes, your understand is correct, you can try the above SDK, and my shared demo.

It should also have IAR version, you can check it, just do the related modification like my document.

 

Wish it helps you!

If you still have question about it, please kindly let me know.

Best Regards,

Kerry

0 Kudos
Reply
5,376 Views
EmbeddedTech
Contributor III

Hi @kerryzhou,

For changes related to,

APP memory start address modify from 0x60000000 to 0x60040000, which is the ota_bootloader defined address。

and

In the evkmimxrt1060_iled_blinky_debug.ld, add boot_hdr, length is 0X400.

which file should I change in the IAR toolchain?

Thanks for your help.

 

0 Kudos
Reply
5,370 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

   In IAR, it is the icf file.

kerryzhou_0-1708507075368.png

 

Wish it helps you!

Best Regards,

Kerry

 

 

0 Kudos
Reply
5,368 Views
EmbeddedTech
Contributor III

Hi @kerryzhou,

 

Is the below modifications correct?

define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x00000400 : 0;
define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000003FF : 0;

define symbol m_interrupts_start = 0x60042000;
define symbol m_interrupts_end = 0x600423FF;

define symbol m_text_start = 0x60042400;
define symbol m_text_end = 0x607FFFFF;

define symbol m_interrupts_ram_start = 0x20000000;
define symbol m_interrupts_ram_end = 0x20000000 + __ram_vector_table_offset__;

define symbol m_data_start = m_interrupts_ram_start + __ram_vector_table_size__;
define symbol m_data_end = 0x2001FFFF;

define symbol m_data2_start = 0x20200000;
define symbol m_data2_end = 0x202BFFFF;

define symbol m_qacode_start = 0x00000000;
define symbol m_qacode_end = 0x0001FFFF;

define exported symbol m_boot_hdr_conf_start = 0x60000000;
define symbol m_boot_hdr_ivt_start = 0x60001000;
define symbol m_boot_hdr_boot_data_start = 0x60001020;
define symbol m_boot_hdr_dcd_data_start = 0x60001030;

/* Sizes */
if (isdefinedsymbol(__stack_size__)) {
define symbol __size_cstack__ = __stack_size__;
} else {
define symbol __size_cstack__ = 0x0400;
}

if (isdefinedsymbol(__heap_size__)) {
define symbol __size_heap__ = __heap_size__;
} else {
define symbol __size_heap__ = 0x0400;
}

 

Thanks.

0 Kudos
Reply
5,356 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

  In the APP, you can don't add the XIP FCB+IVT+DCD, I mean this area:

define exported symbol m_boot_hdr_conf_start = 0x60000000;
define symbol m_boot_hdr_ivt_start = 0x60001000;
define symbol m_boot_hdr_boot_data_start = 0x60001020;
define symbol m_boot_hdr_dcd_data_start = 0x60001030;

  You can check your project, you can set:

XIP_BOOT_HEADER_ENABLE=0

XIP_BOOT_HEADER_DCD_ENABLE=0.

Then your FCB and the DCD will not be added.

After you configure it, you also can genreate the srec file, and check the image situation, make sure your code is from 0x60040000.

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
Reply
5,199 Views
EmbeddedTech
Contributor III

Hi @kerryzhou ,

 

Please find attached the .dat file which is read back after programming in flash using blhost.

First, I programmed the sbl (EVK-MIMXRT1060-ota_bootloader) using the programmer.

Then I used the blhost to flash the external memory. After programming I power cycle the board but cannot see the led flashing. I tried connecting the debugger, but the control is somewhere in 0x6000 6150 etc. which is the SBL flash area.

What is the cause for this behavior.

Thanks.

 

0 Kudos
Reply
5,166 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

   You mentioned the SBL (EVK-MIMXRT1060-ota_bootloader) , but your attached app is the RT1064, so what's the RT chip you are using now? Why you are using the RT1064 in the hello_world?

kerryzhou_0-1709001704221.png

   If you are using the IAR, in fact, I totally recommend you use the sbl, that will be more useful to you:

  You can refer to this post:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1170-SBL-ISP-download-SDRAM-APP/ta-p/1767982

  BTW, in your current situation, what's the blhost commander you are using, where you write your app?

the control is somewhere in 0x6000 6150, it means, it didn't jump to your app succesfully.

  You can try the SBL in the above doc, that support the IAR project, and more easy to use.

 

Best Regards,

Kerry

 

 

0 Kudos
Reply
5,154 Views
EmbeddedTech
Contributor III

Hi @kerryzhou ,

 

I have used the EVK-MIMXRT1060-ota_bootloader only. Please find the attached screenshot.

I have also modified the iled_blinky project of iMXRT1060 only.

Is the SBL which you mentioned in your post available in the sdk?

Thanks.

0 Kudos
Reply
5,138 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

   Please use my attached simple app:

evkmimxrt1060_iled_blinky_ota_0x60040000.bin

  Whether that works OK with the EVK-MIMXRT1060-ota_bootloader?

  As this bin is my previous test image

Isp commander:

 

blhost.exe -t 50000 -u 0x15a2,0x0073 -j -- get-property 1 0

blhost.exe -t 2048000 -u 0x15a2,0x0073 -j -- flash-erase-region 0x60040000 0x6000 9

blhost.exe -t 5242000 -u 0x15a2,0x0073 -j -- write-memory 0x60040000 evkmimxrt1060_iled_blinky_ota_0x60040000.bin

 

You can try it on your side.

If you still have question about it, please kindly let me know.

Best Regards,

Kerry

0 Kudos
Reply
5,131 Views
EmbeddedTech
Contributor III

Hi @kerryzhou,

I cannot find any attachment in your post.

Thanks.

0 Kudos
Reply
5,128 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech 

 Please check the last reply again.

 That .bin is for the :

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1060-OTA-bootloader-ISP-and-swap-rollback-usag...

 chapter 2.2 ISP test related command

 

Best Regards,

Kerry

0 Kudos
Reply
5,123 Views
EmbeddedTech
Contributor III

Hi @kerryzhou,

 

Your iled_blinky .bin file works with the ota_bootloader.

I have also tried the SBL from the link which you have provided below,

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1170-SBL-ISP-download-SDRAM-APP/ta-p/1767982

I have modified as per the instructions and programmed the sbl code using debugger.

Then I modified the emwin_temperature_control App and downloaded using mcuboot utility. I see that the control is in SBL and not transferred to the app. I doubt the modifications which I have done in the .icf file of the app. Can you pls review if my attached modifications are ok? I have set the DCD and HEARDER ENABLE to 0 in app.

Thanks for your help.

0 Kudos
Reply
5,120 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

  SBL is another bootloader, if you use this, you just need to use the SBL, not my side ota_bootloader.

  In fact, totally two-method bootloader.

Which one you want to use now?

If use my old ota_bootloader, I will download the old SDK, and help you use the IAR to modify one project.

If you are using the SBL, RT1170 document is totally enough.

So, please tell me which one you want to use now, thanks.

Best Regards,

Kerry

 

0 Kudos
Reply
5,116 Views
EmbeddedTech
Contributor III

Hi @kerryzhou ,

You can help with the ota_bootloader for flashing an app code which is using SDRAM. If it works, then later I will try the RT1170 example.

Thanks.

0 Kudos
Reply
5,296 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @EmbeddedTech ,

  Already finished the iar app version, you can try it on your side.

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1060-OTA-bootloader-ISP-and-swap-rollback-usag...

 the code iar app.zip :

https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imxrt%40tkb/148/4/iar%20app.zip

When I download the evkmixrt1060_iled_blinky_ota_0x60040000_iar.bin, it also works on my side.

You can try it on your side.

 detail steps is in the above doc linker, comment.

 

If you still have question about it, please kindly let me know.

If your question is solved, please help to mark the correct answer, just to close this case, thanks.

Any new issues, welcome to create the new case.

Best Regards,

Kerry

If your

 

0 Kudos
Reply
801 Views
mayur1in
Contributor I

Hi,

Can you please provide how to follow all this steps with Keil MDK compiler?

I'm also got stuck on this but we're using Keil MDK for development.

Thanks in advance.

 

0 Kudos
Reply