Table of Contents

Embedded SBC MBa6ULxL - PTXdist Linux BSP documentation



Copy Firmware to eMMC

If eMMc/SD image size exceeds the RAM size it is not possible to copy the image into the RAM.
Nevertheless copying is possible by splitting Rootfs into several parts during the process.

Prerequistises

General update process

Calculation of RootFS block count

The value of “rootblks16” sets the amount of blocks to write depending on the size of the root filesystem.
Therefore, a calculation will be necessary, so here is an example on how to calculate it for a 512Mb sized RootFS:



Using SD Card

Create U-boot env variable install_firmware

setenv  install_firmware 'echo MBR... && mmc dev 1 && mmc read $loadaddr 0 1 && mmc dev 0 && mmc write $loadaddr 0 1 && echo U-Boot... && mmc dev 1 && mmc read $loadaddr 2 7fe && mmc dev 0 && mmc write $loadaddr 2 7fe && echo U-Boot environment... && mmc dev 1 && mmc read $loadaddr 800 800 && mmc dev 0 && mmc write $loadaddr 800 800 &&  echo Firmware Partition... && mmc dev 1 && mmc read $loadaddr 2000 A000 && mmc dev 0 && mmc write $loadaddr 2000 A000 && echo Root FS... && run root_loop'

Create U-boot env variable root_loop

setenv root_loop 'setenv start 0xC000 && setenv r1 $rootblks16 && while itest $r1 -gt 0; do if itest $r1 -gt 0x2D000; then setenv count 2D000; else setenv count $r1; fi && mmc dev 1 && mmc read $loadaddr $start $count && mmc dev 0 && mmc write $loadaddr $start $count && setexpr start $start + $count && setexpr r1 $r1 - $count; done; setenv r1; setenv start; setenv count'

Create rootblks16 and calculate the value as described above (Example value for 512Mb RootFS)

setenv rootblks16 0x100000

Save changes

saveenv

Use the new commands to copy the SD-Card image to eMMC

run install_firmware


Using USB Mass Storage device

Create U-boot env variable install_firmware

setenv  install_firmware 'echo MBR... && usb start && usb read $loadaddr 0 1 && mmc dev 0 && mmc write $loadaddr 0 1 && echo U-Boot... && usb read $loadaddr 2 7fe && mmc dev 0 && mmc write $loadaddr 2 7fe && echo U-Boot environment... && usb read $loadaddr 800 800 && mmc dev 0 && mmc write $loadaddr 800 800 && echo Firmware Partition... && usb read $loadaddr 2000 A000 && mmc dev 0 && mmc write $loadaddr 2000 A000 && echo Root FS... && run root_loop'

Create U-boot env variable root_loop

setenv root_loop 'setenv start 0xC000 && setenv r1 $rootblks16 && while itest $r1 -gt 0; do if itest $r1 -gt 0x2D000; then setenv count 2D000; else setenv count $r1; fi && usb read $loadaddr $start $count && mmc dev 0 && mmc write $loadaddr $start $count && setexpr start $start + $count && setexpr r1 $r1 - $count; done; setenv r1; setenv start; setenv count'

Create rootblks16 and calculate the value as described above (Example value for 512Mb RootFS)

setenv rootblks16 0x100000

Save changes

saveenv

Use the new commands to copy the USB medium image to eMMC

run install_firmware