Embedded module TQMa57xx - YOCTO Linux BSP documentation

Deployment Yocto

  1. All binaries are intended for the usage on a STKa57xx
  2. The symlinks point to the files of the last build

Target Machine: tqma57xx-mba57xx

System Images

Boot Device Symlink File
SD Card/eMMC tq-image-generic-tqma57xx-mba57xx.wic tq-image-generic-tqma57xx-mba57xx-<build_timestamp>.rootfs.wic

Bootloader Binaries

Boot Device Symlink File
SD/eMMC u-boot-tqma57xx-mba57xx.img u-boot-sd-2019.04-r0.img

Linux Kernel Image

Symlink File
zImage zImage–5.4.43-r0-tqma57xx-mba57xx-<build_timestamp>.bin

Devicetree Blobs

Symlink Description
am571x-mba57xx.dtb Default
am571x-mba57xx-tianma-tm070jvhg33.dtb device tree with activated LVDS channel and TM070JVHG33 display timing
am571x-mba57xx-edt-etm0700g0edh6.dtb device tree with activated parallel display channel and etm0700g0edh6 display timing
am571x-mba57xx-cdtech-dc44.dtb custom Devicetree

Rootfs images

Symlink File
tq-image-generic-tqma57xx-mba57xx.tar.xz tq-image-generic-tqma57xx-mba57xx-<build_timestamp>.rootfs.tar.xz

SD / eMMC image

Sector 1) Size 2) Contents Linux (SD-Card) Linux (eMMC) Mountpoint
0x000000 … 0x000000 0x0001 sector / 512 B MBR / Partition Table unpartitioned area n/a
0x000001 … 0x000001 0x0001 sectors / 512 B none
0x000002 … 0x000800 0x07FE sectors / 1023 kiB bootstream (U-Boot)
0x000801 … 0x001000 0x0800 sectors / 1 MiB U-Boot environment
0x001001 … 0x002000 0x1000 sectors / 2 MiB resvd
0x002001 … 0x012000 0x10000 sectors / 32 MiB firmware (Kernel, devicetrees) mmcblk1p1 mmcblk0p1 /boot
0x012001 … actual size depends on contents of RootFS RootFS mmcblk1p2 mmcblk0p2 /

The Image can be simply written to the SD Card by using the dd shell command in Linux:

$ cd <path to your image>
$ sudo dd if=tq-image-generic-tqma57xx-mba57xx-<build Timestamp>.rootfs.wic of=/dev/sdc bs=1M conv=fsync #Assuming the SD card is assigned to /dev/sdc

To identify the SD card in Linux the shell command dmesg can be used:

  1. Open a new terminal
  2. Execute the following command without plugged SD Card
     $ dmesg | tail -n 15
  3. Insert SD Card and wait a few seconds
  4. Run the command from step two again
$ dmesg | tail -n 15 
 #plug in SD Card into the reader
$ dmesg | tail -n 15 




A good approach to update the firmare components U-Boot,Linux kernel and devicetree in a running system it to load them from a tftp server.
This process requires a running TFTP server, please see the following page how to setup TFTP Server. After setting up the TFTP server, the binaries to be updated must be copied into the TFTP directory.

1. Setup the Starterkit to boot from eMMC or SD
2. Connect the kit to the network with TFTP server supplying the binaries via ethernet on connector ETH0 (X28)
3. Power up the system and interrupt the boot process in U-Boot

Hit any key to stop autoboot:  0
=>

3. Setup the ethernet interface:

Set network settings manually

Set network settings using DHCP


4. Set U-Boot variable mmcdev according to the drive you want to write to.

=> setenv mmcdev <device_number>

Device assignment:
mmcdev 0 = SD Card
mmcdev 1 = eMMC

5. Set the file name of the binary to update in U-Boot :

  • For U-Boot update: ⇒ setenv uboot <filename>
    e.g. u-boot-sd-2019.04-r0.img
  • For devicetree update: ⇒ setenv fdt_file <filename>
    e.g. am572x-mba57xx–5.4.43-r0-tqma57xx-mba57xx-20210330110901.dtb
  • For Linux kernel update: ⇒ setenv image <filename>
    e.g. zImage–5.4.43-r0-tqma57xx-mba57xx-20210330110901.bin

6. Perform Update by running the update command:

  • U-Boot update:
    => run update_uboot


  • Device Tree update:
    => run update_fdt


  • Kernel update:
    => run update_kernel


The variables can be saved with the command saveenv to keep the values permanently.

  • Write Image to SD card (use dd command under Linux or Win32diskImager under Windows)
  • Set Starterkit to boot from SD, please see DIP Switch Settings
  • Interrupt the boot process to get to the U-Boot prompt
  • Use the following commands to copy the SD card to eMMMC
The following commands are based on the default eMMC/SD image partitioning.

1. Run the following commands in the Uboot shell to create update script:

 
setenv root_loop 'setenv start 12001 && setenv r1 $rootblks16 && while itest $r1 -gt 0; do if itest $r1 -gt 0x100000; then setenv count 0x100000; else setenv count $r1; fi && mmc dev 0 && mmc read $loadaddr $start $count && mmc dev 1 && mmc write $loadaddr $start $count && setexpr start $start + $count && setexpr r1 $r1 - $count; done; setenv r1; setenv start; setenv count'
 
setenv  install_firmware 'echo MBR... && mmc dev 0 && mmc read $loadaddr 0 1 && mmc dev 1 && mmc write $loadaddr 0 1 && echo U-Boot... && mmc dev 0 && mmc read $loadaddr 2 7FE && mmc dev 1 && mmc write $loadaddr 2 7FE && echo U-Boot environment... && mmc dev 0 && mmc read $loadaddr 801 800 && mmc dev 1 &&mmc write $loadaddr 801 800 && echo reserved... && mmc dev 0 && mmc read $loadaddr 1001 1000 && mmc dev 1 &&mmc write $loadaddr 1001 1000 && echo Firmware Partition... && mmc dev 0 && mmc read $loadaddr 2001 10000 && mmc dev 1 && mmc write $loadaddr 2001 10000 && echo Root FS... && run root_loop'
  • create the environment variable rootblks16 and set the value accordingly to the size of the RootFS in this case 307MB.

To calculate the value of rootblks16 devide the size of the image in byte by 512 and convert the result into a hex value.

307 * 1024 * 1024 = 321912832
321912832 / 512 = 628736
628736 = 99800HEX

setenv rootblks16 0x99800


2. Save environment U-boot environment (optional):

=> saveenv


3. run the following command to start the update procedure:

=> run install_firmware

Prerequisites

To boot the TQMa57xx from network you need a working bootloader in eMMC/SD-card or SPI-NOR (placement option on TQMa57xx ) which is able to get the kernel image over tftp and to provide the kernel with commandline settings for NFS. The dtb-file and kernel image have to be provided via tftp and the rootfs via nfs.

Configuration of U-Boot Environment

The bootloader environment needs to be modified to work with your tftp-server and your nfs-server.

1. Prepare network interface:

Set network settings manually

Set network settings using DHCP

2. set the Uboot variables for TFTP and NFS:

  • setenv rootpath <rootpath> (NFS directory has to set in /etc/exports on the Computer that runs the NFS server first)
  • setenv fdt_file <fdt_file> (name of devicetree file to be downloaded from the tftp server)
  • setenv image <image> (name of the Linux kernel image to be downloaded from the tftp server)

3. Run the uboot script to boot from nfs:

uboot command to start netboot
=> run netboot

1) , 2)
sector size = 512 B

  • Last modified: 2023/03/23 16:01