Tool/software: Linux
I have a TDA2PxEVM board and I'm running Processor SDK 3.05 Vision on Ubuntu 18.04LTS (native installation, not a VM).
I built the default examples for the TDA2PxEVM, following the instructions in the Linux user guide, and this appeared to go OK. My problem is that I'm having difficulty generating a working SD card that can be used to boot the system.
I ran the mksdboot.sh script that is supposed to create partitions on the SD card and copy over needed files. It created the partitions, but returned some errors and never copied over the files. (In the following, I replaced my username with <user>.)
➜ build sudo ./hlos/scripts/linux/mksdboot.sh --device /dev/mmcblk0 --appname apps --makeconfig tda2px_evm_linux_all [sudo] password for <user>: -- Main device is: /dev/nvme0n1p6 ************************************************************ * THIS WILL DELETE ALL THE DATA ON /dev/mmcblk0 * * * * WARNING! Make sure your computer does not go * * in to idle mode while this script is * * running. The script will complete, * * but your SD card may be corrupted. * * * * Press <ENTER> to confirm.... * ************************************************************ ls: cannot access '/dev/mmcblk0?': No such file or directory 1024+0 records in 1024+0 records out 1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.176998 s, 5.9 MB/s Welcome to fdisk (util-linux 2.31.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x963163a8. Command (m for help): Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): Partition number (1-4, default 1): First sector (2048-62333951, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-62333951, default 62333951): Created a new partition 1 of type 'Linux' and of size 256 MiB. Partition #1 contains a vfat signature. Command (m for help): Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): Partition number (2-4, default 2): First sector (526336-62333951, default 526336): Last sector, +sectors or +size{K,M,G,T,P} (526336-62333951, default 62333951): Created a new partition 2 of type 'Linux' and of size 29.5 GiB. Partition #2 contains a ext4 signature. Command (m for help): Partition number (1,2, default 2): Hex code (type L to list all codes): Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'. Command (m for help): Partition number (1,2, default 2): The bootable flag on partition 1 is enabled now. Command (m for help): The partition table has been altered. Failed to add partition 1 to system: Device or resource busy Failed to add partition 2 to system: Device or resource busy The kernel still uses the old partitions. The new table will be used at the next reboot. Syncing disks. Press enter to continue. ./hlos/scripts/linux/mksdboot.sh: 156: read: arg count Formating /dev/mmcblk01 ... mkfs.fat 4.1 (2017-01-24) mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows mkfs.vfat: /dev/mmcblk0p1 contains a mounted filesystem. mke2fs 1.44.1 (24-Mar-2018) /dev/mmcblk0p2 contains a ext4 file system labelled 'rootfs' last mounted on /media/<user>/rootfs on Wed Jan 16 21:54:01 2019 Proceed anyway? (y,N) y /dev/mmcblk0p2 is mounted; will not make a filesystem here! Copying filesystem on /dev/mmcblk01,/dev/mmcblk02 mount: /tmp/sdk/14027/boot: special device /dev/mmcblk01 does not exist. ERROR: executing mount /dev/mmcblk01 /tmp/sdk/14027/boot
What is the expected state of the card before running the script? I presume it should initially be formatted as FAT32. When making an RTOS bootable card on Windows, I needed to use diskpart.exe to mark it as Active. Do I need a similar step here?
Since the script appeared to create the partitions but didn't copy over any data, I performed the following commands manually:
cd /home/<user>/ti/PROCESSOR_SDK_VISION_03_05_00_00/vision_sdk/binaries/apps/tda2px_evm_linux_all/hlos/linux/boot cp MLO /media/<user>/boot cp u-boot.img /media/<user>/boot cp uenv.txt /media/<user>/boot sudo tar xf tisdk-rootfs-image-dra7xx-evm.tar.xz -C /media/<user>/rootfs
When I attempted to boot off the SD card, I received the following UART output via Putty:
U-Boot SPL 2016.05-00010-g9551b3d23ef3 (Jan 14 2019 - 10:13:49) DRA762-GP ES1.0 no pinctrl for hs200_1_8v no pinctrl for ddr_1_8v *** Warning - bad CRC, using default environment Trying to boot from MMC1 reading dra7-ipu2-fw.lzop spl_load_file_fat: error reading file dra7-ipu2-fw.lzop, err - -1 spl: error reading image dra7-ipu2-fw.lzop, err - -1 Error loading remotecore IPU2!,Continuing with boot ... reading dra7-dsp1-fw.lzop spl_load_file_fat: error reading file dra7-dsp1-fw.lzop, err - -1 spl: error reading image dra7-dsp1-fw.lzop, err - -1 Error loading remotecore DSP1!,Continuing with boot ... reading dra7-dsp2-fw.lzop spl_load_file_fat: error reading file dra7-dsp2-fw.lzop, err - -1 spl: error reading image dra7-dsp2-fw.lzop, err - -1 Error loading remotecore DSP2!,Continuing with boot ... reading dra7-ipu1-fw.lzop spl_load_file_fat: error reading file dra7-ipu1-fw.lzop, err - -1 spl: error reading image dra7-ipu1-fw.lzop, err - -1 Error loading remotecore IPU1!,Continuing with boot ... *** Warning - bad CRC, using default environment reading u-boot.img reading u-boot.img reading u-boot.img reading u-boot.img U-Boot 2016.05-00010-g9551b3d23ef3 (Jan 14 2019 - 10:13:49 -0800) CPU : DRA762-GP ES1.0 Model: TI DRA762 EVM Board: DRA76x EVM REV A.2 DRAM: 4 GiB MMC: mmc@4809c000: fail to find sdr104 mode FDT_ERR_NOTFOUND no pinctrl for sdr104 mmc@4809c000: fail to find ddr50 mode FDT_ERR_NOTFOUND no pinctrl for ddr50 mmc@4809c000: fail to find sdr50 mode FDT_ERR_NOTFOUND no pinctrl for sdr50 mmc@4809c000: fail to find sdr25 mode FDT_ERR_NOTFOUND no pinctrl for sdr25 mmc@4809c000: fail to find sdr12 mode FDT_ERR_NOTFOUND no pinctrl for sdr12 OMAP SD/MMC: 0, OMAP SD/MMC: 1 *** Warning - bad CRC, using default environment GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645 part_get_info_efi: *** ERROR: Invalid GPT *** GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645 part_get_info_efi: *** ERROR: Invalid Backup GPT *** ERROR: cannot find partition: 'userdata' at arch/arm/cpu/armv7/omap-common/utils.c:199/mmc_get_part_size() Warning: fastboot.userdata_size: unable to calc SCSI: SATA link 0 timeout. AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst scanning bus for devices... Found 0 device(s). Net: Warning: ethernet@48484000 using MAC address from ROM eth0: ethernet@48484000 Hit any key to stop autoboot: 2 1 0 ## Error: "board_findfdt" not defined switch to partitions #0, OK mmc0 is current device SD/MMC found on device 0 reading boot.scr ** Unable to read file boot.scr ** reading uEnv.txt 173 bytes read in 2 ms (84 KiB/s) Loaded env from uEnv.txt Importing environment from mmc0 ... switch to partitions #0, OK mmc0 is current device SD/MMC found on device 0 ** File not found /boot/zImage ** switch to partitions #0, OK mmc1(part 0) is current device mmc - MMC sub system Usage: mmc info - display info of the current MMC device mmc read addr blk# cnt mmc write addr blk# cnt mmc erase blk# cnt mmc rescan mmc part - lists available partition on current mmc device mmc dev [dev] [part] - show or set current mmc device [partition] mmc list - lists available devices mmc hwpartition [args...] - does hardware partitioning arguments (sizes in 512-byte blocks): [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition [check|set|complete] - mode, complete set partitioning completed WARNING: Partitioning is a write-once setting once it is set to complete. Power cycling is required to initialize partitions after set to complete. mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode - Set the BOOT_BUS_WIDTH field of the specified device mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB> - Change sizes of boot and RPMB partitions of specified device mmc partconf dev boot_ack boot_partition partition_access - Change the bits of the PARTITION_CONFIG field of the specified device mmc rst-function dev value - Change the RST_n_FUNCTION field of the specified device WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values. mmc setdsr <value> - set DSR register value mmc - MMC sub system Usage: mmc info - display info of the current MMC device mmc read addr blk# cnt mmc write addr blk# cnt mmc erase blk# cnt mmc rescan mmc part - lists available partition on current mmc device mmc dev [dev] [part] - show or set current mmc device [partition] mmc list - lists available devices mmc hwpartition [args...] - does hardware partitioning arguments (sizes in 512-byte blocks): [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition [check|set|complete] - mode, complete set partitioning completed WARNING: Partitioning is a write-once setting once it is set to complete. Power cycling is required to initialize partitions after set to complete. mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode - Set the BOOT_BUS_WIDTH field of the specified device mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB> - Change sizes of boot and RPMB partitions of specified device mmc partconf dev boot_ack boot_partition partition_access - Change the bits of the PARTITION_CONFIG field of the specified device mmc rst-function dev value - Change the RST_n_FUNCTION field of the specified device WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values. mmc setdsr <value> - set DSR register value Booting from eMMC ... Wrong Image Format for bootm command ERROR: can't get kernel image! =>
Why does the mksdboot.sh script fail, and why does the card fail to boot even when I manually copy over the files? Ubuntu 18.04LTS should be supported, right? I upgraded from 16.04LTS, and don't remember which Ubuntu version I was running when I originally installed the processor SDK - would that matter?
Thanks.