i.MX8M Nano Update Bootloader Binary from Kernel using DD Command

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

i.MX8M Nano Update Bootloader Binary from Kernel using DD Command

1,013 Views
Nethaji1510
Contributor II

Hello, 

We were able to flash the uboot binary using the uuu tool for We were the IMX8M Nano board. But we are unable to do it from the kernel using the dd command.

$ dd if=uboot.bin of=/dev/mmcblk2 bs=1k seek=32

$ sync

 

Any corresponding offset or partition in for bootloader flashing? Please share the UUU tool bootloader offset or command for flashing the bootloader. 

Kindly help us.

0 Kudos
Reply
7 Replies

989 Views
Nethaji1510
Contributor II
Hello,
we are able to flash the uboot binary from the kernel using the below dd command,
 
$ echo 0 | tee /sys/block/mmcblk2boot0/force_ro
 
$ dd if=flash.bin of=/dev/mmcblk2boot0 bs=1k seek=0 conv=fsync
 
$ echo 1 | tee /sys/block/mmcblk2boot0/force_ro
 
It is working fine.
 
 
In our board have two boot partition like,
/dev/mmcblk2boot0
/dev/mmcblk2boot1
 
But the UUU tool flashes the bootloader in this /dev/mmcblk2boot0 partition only. Any procedure available for flashing the bootloader in both the /dev/mmcblk2boot0 and /dev/mmcblk2boot1 partitions in the UUU tool?
 
Updating U-Boot with an mmcblk2boot0/mmcblk2boot1 strategy is available?. If available, please share with me the procedure for this.
 
Query: Currently, the bootloader boots from the /dev/mmcblk2boot0 partition. This bootloader may be corrupted; how do I recover the board from the /dev/mmcblk2boot1 partition?
0 Kudos
Reply

951 Views
roke
Contributor III

You can check the following link of i.MX8QXP, which has the same boot as i.MX8MN does.

 

https://community.nxp.com/t5/NXP-Tech-Blog/i-MX8QXP-eMMC-Secondary-Boot/ba-p/1257704#M45

 

0 Kudos
Reply

966 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Glad to hear that you have managed to do so, regarding your other question, it is indeed possible to do so, you may use a custom script for this:
https://github.com/nxp-imx/mfgtools/wiki/Sample-scripts#burn-yocto-image-to-emmc-by-linux-kernel

In the script above you may change the following:

FBK: ucmd mmc=`cat /tmp/mmcdev`; echo 0 > /sys/block/mmcblk${mmc}boot1/force_ro
FBK: ucp  _flash.bin t:/tmp
FBK: ucmd mmc=`cat /tmp/mmcdev`; dd if=/tmp/_flash.bin of=/dev/mmc${mmc}boot1 bs=1K seek=32
FBK: ucmd mmc=`cat /tmp/mmcdev`; echo 1 > /sys/block/mmcblk${mmc}boot1/force_ro

 
As you may have notice is the same procedure you did on the kernel.

Best regards/Saludos,
Aldo.

0 Kudos
Reply

878 Views
Nethaji1510
Contributor II

Thanks @AldoG  for your reply.

The bootloader boots from the /dev/mmcblk2boot0 partition. This bootloader may be corrupted; how do I recover the board from the /dev/mmcblk2boot1 partition?

0 Kudos
Reply

859 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Actually you can refer the community document mentioned above, it is good reference for your use case:

https://community.nxp.com/t5/NXP-Tech-Blog/i-MX8QXP-eMMC-Secondary-Boot/ba-p/1257704#M45

Best regards/Saludos,
Aldo.

0 Kudos
Reply

950 Views
roke
Contributor III

AldoG,

 

Do you know about the i.MX8MN boot offset at emmc boot partition is zero?

 

 

0 Kudos
Reply

858 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Yes, it is 0 if the image is in boot partition and 32K if it is in user
partition

Best regards/Saludos,
Aldo.

0 Kudos
Reply