Debian Edit Modify Build and Flash U-Boot

From Variscite Wiki
Revision as of 03:46, 15 July 2020 by Harshesh (talk | contribs) (Created page with "<!-- Set release according to "release" parameter in URL and use MORTY_V1.0_DART-6UL as default --> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- --> {{#lst:Debian_Pla...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
DART-MX8M-MINI - Debian U-Boot Customization


Making Changes to U-Boot

$ cd ~/var_mx8mm_dart_debian_buster/src/uboot-imx
$ gedit board/variscite/mx8mm_var_dart/mx8mm_var_dart.c
$ gedit include/configs/mx8mm_var_dart.h
$ cd ~/var_mx8mm_dart_debian_buster/src/uboot-imx
$ gedit board/variscite/mx8mm_var_dart/mx8mm_var_dart.c
$ gedit include/configs/mx8mm_var_dart.h

For example, we want to change the default environment variable, "netargs=setenv bootargs ${jh_clk} console=${console} " \ "root=/dev/nfs ${cma_size} " \ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \

To "netargs=setenv bootargs ${jh_clk} console=${console} " \ "root=/dev/nfs ${cma_size} " \ "ip=dhcp serverip=192.168.0.34 nfsroot=${serverip}:${nfsroot},v3,tcp\0" \

Here above example sets the serverip to 192.168.0.34,

Building Bootloader

To build a bootloader run below commands on host machine.

$ cd ~/var_mx8mm_dart_debian_buster
$ sudo MACHINE=imx8mm-var-dart ./var_make_debian.sh -c bootloader


Flashing Bootloader to target

Transfer the newly created bootloader file ~/var_mx8mm_dart_debian_buster/output/ from

~/var_mx8mm_dart_debian_buster/output/ to running target to flash it on the eMMC. 

For example scp ~/var_mx8mm_dart_debian_buster/output/ root@192.168.0.34:/tmp/

== Flahsing New bootlaoder to SD card. To flash the newly created bootloader on the SD Card

$ sudo dd if=imx-boot-sd.bin of=/dev/sdX bs=1K seek=33 conv=fsync

If you want to use our recovery SD card to flash the built U-Boot to NAND flash/eMMC, then copy it to the appropriate location in the SD card:

$ sudo cp SPL /media/rootfs/opt/images/... 
$ sudo cp u-boot.img /media/rootfs/opt/images/...

And eject the SD card gracefully from host machine.


Note: If you manually upgrade an existing U-Boot, and you have an old environment saved, it is a good idea to reset your environment to the new default (see Environment handling commands)