unifreq/openwrt_packit

How to flash the new u-boot version to a microsd card?

mixmid opened this issue · 1 comments

ophub@ has pointed me here. Sorry if so. It's originally from this link

I have compiled files of new u-boot for the device as Amlogic s905x3 (make x96max-plus_defconfig) and
from
https://github.com/unifreq/amlogic-boot-fip
https://github.com/unifreq/u-boot

-rw-r--r-- 1 1000 1000 1588080 Aug 21 16:31 u-boot.bin
-rw-r--r-- 1 1000 1000 1588592 Aug 21 16:31 u-boot.bin.sd.bin
-rw-r--r-- 1 1000 1000   65536 Aug 21 16:31 u-boot.bin.usb.bl2
-rw-r--r-- 1 1000 1000 1522544 Aug 21 16:31 u-boot.bin.usb.tpl

and cannot flash u-boot.bin.sd.bin to the microsd card. Tried so

    $ DEV=/dev/your_sd_device
    $ dd if=u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
    $ dd if=u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444

Still the same old version of u-boot. I certainly do something wrong. Where does the bootloader sit actually?

Аnswer to myself. The file u-boot.bin compiled from u-boot sources is needed. Simply replace this file to /boot/u-boot.ext and you will have your freshly built version of u-boot. Now that you can also see to the first bytes of the signature of this file to be sure this file is exactly what you need.

bash-5.1$ hexdump -n 100 u-boot.bin 
0000000 000a 1400 201f d503 0000 0100 0000 0000
0000010 04f0 000c 0000 0000 04f0 000c 0000 0000
0000020 bf98 000c 0000 0000 003d 1400 fea0 1000
0000030 4241 d538 303f f100 00a0 5400 203f f100
0000040 0120 5400 103f f100 01a0 5400 c000 d51e
0000050 1100 d53e 0c00 b240 1100 d51e 115f d51e