Embedded SBC MBa6ULxL - PTXdist Linux BSP documentation



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.

  • Prepare the install medium using tools like W32DiskImager or DD for image file
  • Set Starterkit to boot from SD, please see DIP Switch Settings
  • Interrupt the boot process to get to the U-Boot prompt
  • The U-Boot environment has to be expanded to copy the content from the installation medium to the eMMC therefore create the following u-boot env variables has to be created.

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:

  • The size for 512Mb is (512*1024*1024 = 536.870.912)
  • This must then be divided by 512 (the blocksize) and then converted to hexadecimal (536.870.912 / 512 = 0x100000)



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


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
  • Last modified: 2022/08/04 15:02