Internal Boot from Flash memory not starting on imxRT1176 custom board

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

Internal Boot from Flash memory not starting on imxRT1176 custom board

Jump to solution
5,007 Views
ofirbo
Contributor II

Hi,

We have a custom PCB with MIMXRT1176DVMAA, External Flash memory MX25UM51245GXDI00 is connected via FLEXSPI.

The memory layout was defined as in EVK:

image.png

We can program and debug the microcontroller using Segger J-Link, however when booting or power cycling the device without debugger the application doesn't start executing.

We checked BMOD with debugger connected and it seems that BOOT_MODE is being latched correctly as 0x02 (Internal Boot).

image.png 

When dump read the flash memory to the PC using J-Flash, it appears that it's empty at address 0x3000000-0x30002000. I guess FCB block is missing and that's the reason application won't start.

Is there any guideline how to make sure FCB is created and programmed by J-Link script automatically? do I need to create some evkmimxrt1170_flexspi_nor_config.c file?

Are there any tutorials or guidelines?

Any suggestions will be much appreciated.

 

Thanks,

Ofir

0 Kudos
Reply
1 Solution
4,878 Views
kerryzhou
NXP TechSupport
NXP TechSupport

HI @ofirbo ,

 If you want to use the SPI method, it is Single I/O. This mode, you need to use this list commander:

kerryzhou_0-1710731644777.png

 

The  Octal flash should just support the Single IO and octal IO OPI method.

Yes, the data swapping is relevant only at OCTA mode.

About the MCUbootutility is set like this blog:

https://www.cnblogs.com/henjay724/p/15880374.html

kerryzhou_1-1710731751319.png

Do you already try it to download the code or not?

Best Regards,

Kerry

 

 

View solution in original post

0 Kudos
Reply
15 Replies
4,990 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ofirbo ,

   Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

  When you download the code and debug the code in the flash, do you also can make the function works?

  In fact, I suggest you to use MX25UM51345GXDI00 instead of MX25UM51245GXDI00 , these two chips have the data swap difference:

kerryzhou_0-1710470245632.png

You can see, the MX25UM51245GXDI00 data is:  D1、D0、D3、D2... sequence, it is not like MX25UM51345GXDI00, that's why you have the boot issues.

If you use MX25UM51345GXDI00 ,you can refer to my post:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1170-Octal-flash-enablement/ta-p/1498369

If must need to use MX25UM51245GXDI00, you need to do the flashloader dataswap, you can refer to this blog:

https://www.cnblogs.com/henjay724/p/15880374.html

As it is the Chinese document, but you can use the translation tool to read it, this is from the nxp internal expert, very useful to you.

Wish it helps you!

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

Best Regards,

Kerry

 

 

0 Kudos
Reply
4,979 Views
ofirbo
Contributor II

Hi @kerryzhou ,

Thanks for the fast answer.

When you download the code and debug the code in the flash, do you also can make the function works?

Yes, functions tested so far work normally (I2C, SPI, etc.) if that's what you meant , it just doesn't boot (All I need to run the code is i.e press connect and disconnect button in J-Flash application). 

We already have a manufactured PCB with MX25UM51245GXDI00 so changing it now is not an option.

If you use MX25UM51345GXDI00 ,you can refer to my post:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1170-Octal-flash-enablement/ta-p/1498369

If must need to use MX25UM51245GXDI00, you need to do the flashloader dataswap, you can refer to this blog:

https://www.cnblogs.com/henjay724/p/15880374.html

As it is the Chinese document, but you can use the translation tool to read it, this is from the nxp internal expert, very useful to you.

Wish it helps you!

Wow, it's look like an amazing job getting it to work, especially with J-Link, but your blog seems to be very thorough, guess I need to dive into it

Thanks!

0 Kudos
Reply
4,972 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ofirbo ,

  My doc is mainly for MX25UM51345.

But, you still can use the blog method, you can try to use the MCUBootutility download with the data order swapped:

kerryzhou_0-1710494401411.png

Whether this can boot OK or not?

You can try it on your side.

https://github.com/JayHeng/NXP-MCUBootUtility/releases/tag/v6.1.0
the related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility

 

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

Best Regards,

Kerry

 

0 Kudos
Reply
4,917 Views
ofirbo
Contributor II

Hi @kerryzhou,

Is it possible to use the MX25UM51245G memory as SPI (QSPI) instead of OSPI? The data swapping seems to be relevant only at OCTA mode.

If so what's the correct configuration for MCUBootutility?

 

Thanks, Ofir

 

 

 

 

 

0 Kudos
Reply
4,879 Views
kerryzhou
NXP TechSupport
NXP TechSupport

HI @ofirbo ,

 If you want to use the SPI method, it is Single I/O. This mode, you need to use this list commander:

kerryzhou_0-1710731644777.png

 

The  Octal flash should just support the Single IO and octal IO OPI method.

Yes, the data swapping is relevant only at OCTA mode.

About the MCUbootutility is set like this blog:

https://www.cnblogs.com/henjay724/p/15880374.html

kerryzhou_1-1710731751319.png

Do you already try it to download the code or not?

Best Regards,

Kerry

 

 

0 Kudos
Reply
4,869 Views
ofirbo
Contributor II

Hi @kerryzhou,

I tried to generate binary image using this settings:

image.png

 

Pressing "Generate Unsigned Bootable Image" generates two binary images, "_unsigned.bin" and "_unsigned_nopadding.bin" (attached them if something useful can be understood from them).

I've tried programming both of them with J-Flash, but none of them make the MCU boot up (I have a blinking RGB led application which works from debugger).

image.png

 

Please advise,

Ofir

0 Kudos
Reply
4,846 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ofirbo ,

  Can you use the USB or the UART to download the code in serial download mode directly? I mean, without the JLINK debugger.

  Your attached image is no FCB, as that method, the Tool will help you download the FCB directly.

  So, your image is lack the FCB now. Or another way, you need to modify your JLINK flashdriver, in the flashdriver, option to enable the swap function, then when you download the code, it will help you do the swap.

 

Best Regards,

kerry

 

0 Kudos
Reply
4,775 Views
ofirbo
Contributor II

Hi @kerryzhou,

In order to use Serial Download do I need to change to BOOT_CFG to 0x01? It involves changing some 0201 resistors on our board and it's a little bit problematic for me (another problem is that only USB2 is exposed to external connector and I'm not sure if Serial Downloader is possible using it).

Isn't the MCUBootutility supposed to generate FCB?

Tomorrow I'll try to modify JLINK flashdriver and will update.

 

 

 

 

 

0 Kudos
Reply
4,743 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ofirbo ,

    Yes, serial download need to change the boot_mode to 01, and use USB1.

    MCUBootutility will generate the FCB and write to the flash directly.

     Yes, try the flashloader to modify the option0, which enable the swap.

Then test it again.

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

Best Regards,

Kerry

0 Kudos
Reply
4,664 Views
ofirbo
Contributor II

Hi @kerryzhou ,

I've implemented your guide: https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1170-Octal-flash-enablement/ta-p/1498369

Recompiled the RT-UFL as your instructions and I can debug it with the new "device MIMXRT1170_UFL_octalFlash".

However the byte swapping issue still exist.

Can you please explain what should be done using MCUXpressoIDE and J-Link?

In the link: https://www.cnblogs.com/henjay724/p/15880374.html

He is referring to \bootloader_examples\flashloader example for byte swapping, but I don't understand how to implement it in my project.

I've attached "evkmimxrt1170_flexspi_nor_config.c", "fsl_flexspi_nor_boot.c" from my project.

In order to write correctly the FDCB? should I swap also the IVT? 

If I don't want to use XIP (Execute in Place) what is the minimal data that should exist in flash and what symbols do I need to define in order to boot from flash?

This is the read-back data after programming the chip via MCUXpresso and J-Link U-FL:

image.png

image.png

image.png

 

And last question - it seems that byte swapping is only relevant in DTR mode, what should I do in order to use normal (without byte swapping) 8READ command etc. so I can test the internal boot functionality.

 

Thanks,

Ofir

0 Kudos
Reply
4,568 Views
ofirbo
Contributor II

Hi @kerryzhou ,

Another thing that I see that that no matter what changes I make to the FDCB in source code with XIP_BOOT_HEADER_ENABLE=1, it's being overwritten in my flash memory to some default FDCB when running the J-Link debugger in mcuxpresso (checked it by reading it back from address 0x30000400)).

Is it being written by J-Link flash loader or by some internal function in the BootROM of the MCU? Why isn't it using the xip boot header specified in code?

Thanks,

Ofir

.

 

 

 

0 Kudos
Reply
4,459 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ofirbo ,

   Try the JLINK commander method, you generate the app with the FCB, then in the JLINK commander:

loadfile xxx.bin address

 After download, then you can use :

mem 0x30000000 end_address

to readout the memory, you can check the FCB again, it should your app image.

Normally, if you debug the code, your downloaded APP should your app FCB, not others.

Your situation seems modified by the JLINK flashloader.

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos
Reply
4,442 Views
ofirbo
Contributor II

Hi @kerryzhou,

 

For the moment I have the board booting up from flash using SPI mode. 

Maybe in the future I'll try to get it running using OPI-DDR.

Thanks for all the help!

4,433 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ofirbo 

Thanks for your information.

If in the future, you still meet the OPI-DDR issue, just create the new question post to talk it.

At that time, I may also find the related chip and test it for you.

Anyway, any question, just create the question post let us know.

Best Regards,

Kerry

0 Kudos
Reply
4,961 Views
ofirbo
Contributor II

Hi @kerryzhou ,

Will test data swapping option and update.

 

Thank you!

 

 

 

0 Kudos
Reply