RT1051 external flash programming production line

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

RT1051 external flash programming production line

1,553 Views
marcos_chiele
Contributor I

Hello all.

I have developed a product with a iMX RT1051 microcontroller.

The product is working well, we are testing some samples on the field, it's pretty good!

Now we are starting a large scale production and I have an issue to programming the external flash memory.

I am trying to do it using NXM MCU Boot Utility.

So, I am following the steps below:

- Connect a new PCB in a PC by USB port (OK)

- Configure the Boot device configuration to QSPI memory (OK)

- Burn the BT_FUSE_SEL from 0 to 1 (ok)

- Load the .axf image (ok)

When I try to program the .axf image (than I load on Image Generation Sequence), an error appears:

"Failed to flash bootable image into external memory, Please reset bord and try again"

However, if I program the the example flexspi nor polling transfer on MCUExpress (SWD), all the steps above work, and it's possible to program the image.

I would like to program the product using only the MCU Boot Utility, MCUExpress is not good for production line.

How can I do it?

 


Thanks in advance.

Labels (1)
0 Kudos
6 Replies

1,543 Views
Masmiseim
Senior Contributor I

Hello Marcos,

I had a similar issue than you.
NXP MCU Boot util is only a graphical user interface for blhost. You see the commands in the terminal window which is opened together with the GUI.
The GUI seems not to be very stable and for production it is still to complicated. So, I executed all commands I liked to do in the GUI and saved the resulting blhost commands from the terminal window in a batch file. I improved it a bit by hand to pass the file to write as a parameter and have now a single click solution.

This is working for me:
call :setsize %1
echo The File has a aize of %size% bytes


blhost -t 50000 -u 0x1FC9,0x013D -j -- get-property 1 0
blhost -t 50000 -u 0x1FC9,0x013D -j -- get-property 17 0
blhost -t 5242000 -u 0x1FC9,0x013D -j -- load-image .\targets\MIMXRT1176\ivt_flashloader.bin
blhost -t 50000 -u 0x15A2,0x0073 -j -- get-property 1 0
blhost -t 50000 -u 0x15A2,0x0073 -j -- efuse-read-once 22
blhost -t 5242000 -u 0x15A2,0x0073 -j -- read-memory 1074675776 4 .\vectors\readReg.dat 0
blhost -t 5242000 -u 0x15A2,0x0073 -j -- fill-memory 538976256 4 3482320897 word
blhost -t 50000 -u 0x15A2,0x0073 -j -- configure-memory 9 538976256
blhost -t 5242000 -u 0x15A2,0x0073 -j -- fill-memory 538976256 4 3229626375 word
blhost -t 5242000 -u 0x15A2,0x0073 -j -- fill-memory 538976260 4 0 word
blhost -t 50000 -u 0x15A2,0x0073 -j -- configure-memory 9 538976256
blhost -t 5242000 -u 0x15A2,0x0073 -j -- read-memory 805307392 1024 .\vectors\flexspiNorCfg.dat 9
blhost -t 2048000 -u 0x15A2,0x0073 -j -- flash-erase-region 805306368 %size% 9
blhost -t 5242000 -u 0x15A2,0x0073 -j -- write-memory 805307392 %1


:setsize
set size=%~z1
goto :eof

Hope this helps

Best regards

 

1,466 Views
marcos_chiele
Contributor I

Hello man.

Now it's working fine, I had to define XIP_BOOT_HEADER_ENABLE 0.

Now I will try to do a "one click" solution as you had suggested me.

Could you share your .bat file for reference?

 

Thanks in advance.

0 Kudos

1,519 Views
marcos_chiele
Contributor I

Hello Masmisein, thanks so much for the answer.

 

I tryed to follow the "manual" steps that you sent me. Unfortunately, it's not working yet.

Here you can see the error:

Executing: C:\Users\mchiele\Desktop\NXP-MCUBootUtility-master\tools\blhost2_3\win\blhost -t 2048000 -u 0x15A2,0x0073 -j -- flash-erase-region 1610612736 136084 9
toolStatus: 0
commandOutput: {
   "command" : "flash-erase-region",
   "response" : [],
   "status" : {
      "description" : "20106 (0x4E8A) kStatus_FlexSPINOR_CommandFailure",
      "value" : 20106
   }
}

 

I dont know what is happening.

It only Works after I execute the Flash SPI example in MCUExpress...

0 Kudos

1,442 Views
Masmiseim
Senior Contributor I

Hello marcos_chiele,

my example was for the iMXRT1170 with Adesto Octo-Flash. If you use a different controller with a different flash your script will look slightly different.

 

You have to create your own script for your board. This is quite simple; just do all the steps you like to do in the NXP MCU Boot utility. You see the commands which are executed in the terminal windows which starts together with the program. Copy all the commands to your batch file and remove the replies (just the blhost commands should remain).

 

I extended the script to pass the bin file as an argument. The size is also calculated in the script. You can find my whole script in my last post.

 

Best Regards

0 Kudos

1,545 Views
mjbcswitzerland
Specialist V

Hi

Try not programming the BT_FUSE_SEL option to see whether it then works.

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or product development requirements

 

1,518 Views
marcos_chiele
Contributor I

Hi.

 

I tryed to program the microcontroller without set the fuse, but it's not working yet.

0 Kudos