This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6548: mksdboot.sh issue

Part Number: AM6548


I tried with 2 8G, 1 32G card, got error as below, how to avoid it?

tony@tony-OptiPlex-990:~/ti-processor-sdk-linux-am65xx-evm-07_01_00_17/bin$ sudo fdisk -l

[sudo] password for tony:
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0006bd9f

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 3890493439 3890491392 1.8T 83 Linux
/dev/sda2 3890495486 3907028991 16533506 7.9G 5 Extended
/dev/sda5 3890495488 3907028991 16533504 7.9G 82 Linux swap / Solaris

Partition 2 does not start on physical sector boundary.


Disk /dev/sdb: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0007e75f

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 145407 143360 70M c W95 FAT32 (LBA)
/dev/sdb2 145408 15491071 15345664 7.3G 83 Linux

tony@tony-OptiPlex-990:~/ti-processor-sdk-linux-am65xx-evm-07_01_00_17/bin$ sudo ./mksdboot.sh --device /dev/sdb --sdk /home/tony/ti-processor-sdk-linux-am65xx-evm-07_01_00_17/
-- Main device is: /dev/sda1
************************************************************
* THIS WILL DELETE ALL THE DATA ON /dev/sdb *
* *
* 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.... *
************************************************************

unmounting device '/dev/sdb'
unmounting device '/dev/sdb1'
unmounting device '/dev/sdb2'
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.264717 s, 4.0 MB/s

Welcome to fdisk (util-linux 2.27.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 0x09352097.

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-15523839, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-15523839, default 15523839):
Created a new partition 1 of type 'Linux' and of size 62 MiB.

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 (129024-15523839, default 129024): Last sector, +sectors or +size{K,M,G,T,P} (129024-15523839, default 15523839):
Created a new partition 2 of type 'Linux' and of size 7.3 GiB.

Command (m for help): Partition number (1,2, default 2): Partition type (type L to list all types):
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.
Calling ioctl() to re-read partition table.
Syncing disks.

unmounting device '/dev/sdb'
unmounting device '/dev/sdb1'
unmounting device '/dev/sdb2'
Formatting /dev/sdb ...
mkfs.fat 3.0.28 (2015-05-16)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 1924352 4k blocks and 481440 inodes
Filesystem UUID: a1848459-1e66-4e7b-bea0-2dafa69f877d
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

Partitioning and formatting completed!
Copying filesystem on /dev/sdb1, /dev/sdb2
./mksdboot.sh: 224: [: 2: unexpected operator

 

regarding the on line user guide of below, where to execute the env command? on target board Linux? since target can't run, how to run it?

Note

If you are having trouble booting with the SD card, you may need to run the following commands to clear the default environment. You will then need to reboot the board for the commands to take effect.

env default –a –f
saveenv

 

  • I use the mksdboot.sh of previous version PSDK7.0, --sdk path to the latest installed 7.01, it can make boot card successfully.

    But the card can't boot with PG2 board also.

  • Hi Tony,

    PG 2.0 support got added in 7.1.

    Usage: mksdboot.sh <options> [ files for install partition ]

    Mandatory options:
      --device              SD block device node (e.g /dev/sdd)

    Optional options:
      --sdk                 Path to SDK directory
      --pg                  Valid values for PG is 1 or 2; defaults to 1
      --version             Print version.
      --help                Print this help message.

    Use --pg option and set it to 2.

    Hope you can resolve this issue.

    Best Regards,
    Keerthy

  • Keerthy,,

    Same result, Log as below, My Ubantu is 16.04.7. LTS


    tony@tony-OptiPlex-990:~/ti-processor-sdk-linux-am65xx-evm-07_01_00_17/bin$ sudo ./mksdboot.sh --device /dev/sdb --sdk /home/tony/ti-processor-sdk-linux-am65xx-evm-07_01_00_17/ --pg 2
    [sudo] password for tony:
    -- Main device is: /dev/sda1
    ************************************************************
    * THIS WILL DELETE ALL THE DATA ON /dev/sdb *
    * *
    * 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.... *
    ************************************************************

    unmounting device '/dev/sdb'
    unmounting device '/dev/sdb1'
    unmounting device '/dev/sdb2'
    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.229211 s, 4.6 MB/s

    Welcome to fdisk (util-linux 2.27.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 0x45f996e0.

    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-15523839, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-15523839, default 15523839):
    Created a new partition 1 of type 'Linux' and of size 62 MiB.

    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 (129024-15523839, default 129024): Last sector, +sectors or +size{K,M,G,T,P} (129024-15523839, default 15523839):
    Created a new partition 2 of type 'Linux' and of size 7.3 GiB.

    Command (m for help): Partition number (1,2, default 2): Partition type (type L to list all types):
    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.
    Calling ioctl() to re-read partition table.
    Syncing disks.

    unmounting device '/dev/sdb'
    unmounting device '/dev/sdb1'
    unmounting device '/dev/sdb2'
    Formatting /dev/sdb ...
    mkfs.fat 3.0.28 (2015-05-16)
    mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
    mke2fs 1.42.13 (17-May-2015)
    /dev/sdb2 contains a ext4 file system labelled 'rootfs'
    last mounted on /tmp/sdk/2522/rootfs on Wed Jan 27 09:39:23 2021
    Proceed anyway? (y,n) y
    Creating filesystem with 1924352 4k blocks and 481440 inodes
    Filesystem UUID: b4590e4f-1e51-476b-bdcb-4a121675ec9c
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

    Allocating group tables: done
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done

    Partitioning and formatting completed!
    Copying filesystem on /dev/sdb1, /dev/sdb2
    ./mksdboot.sh: 224: [: 2: unexpected operator

  • Tony,

    That is something which i observe as well but the card gets created inspite of that and i could boot on PG2.0.
    Please wait for the card create script to run to completion.

    This is the output from my pg2.0 board:

    U-Boot SPL 2020.01-g3c9ebdb87d (Nov 25 2020 - 16:03:21 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0014 '20.8.5--v2020.08b (Terrific Lla')
    Trying to boot from MMC2
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.3():07.01.00.004-1-g52c334fc3-dirty
    NOTICE: BL31: Built : 15:36:28, Nov 25 2020

    U-Boot SPL 2020.01-g3c9ebdb87d (Nov 25 2020 - 16:00:38 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0014 '20.8.5--v2020.08b (Terrific Lla')
    Detected: AM6-IDKAPPEVM rev A
    Detected: SER-PCIE2LEVM rev A
    Trying to boot from MMC2


    U-Boot 2020.01-g3c9ebdb87d (Nov 25 2020 - 16:00:38 +0000)

    SoC: AM65X SR2.0
    Model: Texas Instruments AM654 Base Board
    Board: AM6-COMPROCEVM rev A
    DRAM: 4 GiB
    MMC: sdhci@4f80000: 0, sdhci@4fa0000: 1
    Loading Environment from MMC... OK
    In: serial
    Out: serial
    Err: serial
    Detected: AM6-IDKAPPEVM rev A
    Detected: SER-PCIE2LEVM rev A
    Net:
    Warning: ethernet@46000000 using MAC address from ROM
    eth0: ethernet@46000000
    Hit any key to stop autoboot: 0
    =>
    =>
    =>

    Please resolve this if you are unblocked.

    Best Regards,
    Keerthy

  • Keerthy,

    Thanks, I made the PSDK7.01 card now. but still can't boot on the new "PG2.0" board, nothing on console. Do you know is there marking on the PCBA to recognize whether it is PG2.0 device board?

    I boot the "PG2.0" board with PSDK 6.03, Uboot log as below, it outputs PG 1.0, I am not sure it is the old SDK has the only one PG, or it is really PG 1.0. Now the two board behaviors are same.


    U-Boot 2019.01-g333c3e72d3 (Apr 19 2020 - 03:27:58 +0000)

    SoC: AM654 PG 1.0
    Model: Texas Instruments AM654 Base Board
    Board: AM6-COMPROCEVM rev E3
    DRAM: 4 GiB
    MMC: sdhci@4f80000: 0, sdhci@04FA0000: 1
    Loading Environment from MMC... OK
    In: serial
    Out: serial
    Err: serial
    Detected: SER-PCIEUSBEVM rev E3
    Net:
    Warning: cpsw_nuss@046000000 using MAC address from ROM
    eth0: cpsw_nuss@046000000, eth1: pruss2_eth
    Hit any key to stop autoboot: 0

  • Tony,

    Yes 6.x releases did not support PG 2.0.

    Now on 7.1 SDK can you please try to copy the below images to boot partition of your SD Card:

    tiboot3.bin
    tispl.bin
    u-boot.img

    sysfw-am65x_sr2-evm.itb copied as sysfw.itb

    If that is not booting then i suspect your board version.

    Best Regards,
    Keerthy

  • snapshot of the boot partition:

  • Tony,

    I hope you have copied the sysfw-am65x_sr2-evm.itb as sysfw.itb?

    Are you sure that the evm at hand is indeed PG2.0?

    In case if you have PG1.0 then you will need an additional fix on SDK 7.1 to boot it:

    Best Regards,
    Keerthy

  • Keerthy J said:
    Are you sure that the evm at hand is indeed PG2.0?

    That is I am doubting, do you know which register tells the device revision? I can boot the board with PSDK6.3 to read register.

    Keerthy J said:
    I hope you have copied the sysfw-am65x_sr2-evm.itb as sysfw.itb?

    Do you mean I need to cp  sysfw-am65x_sr2-evm.itb sysfw.itb

  • Tony,

    Tony Tang said:

    That is I am doubting, do you know which register tells the device revision? I can boot the board with PSDK6.3 to read register.

    In u-boot that is being detected by fdt check. Please find the boot images that boot for me on PG2.0.

    boot-images.tar


    Tony: "Do you mean I need to cp  sysfw-am65x_sr2-evm.itb sysfw.itb"

    Yes. The expected name is sysfw.itb.

    Best Regards,
    Keerthy

  • Keerthy,

    I deleted the files in boot partition, and copied your attached files into SD card as below, still can not boot.

  • Tony,

    Those were the exact binaries from 7.1 SDK that work on my PG2.0 board.
    Could you please try the 7.1 SDK PG1.0 images:

    7.1-pg1.10.tar

    Best Regards,
    Keerthy

  • Keerthy,

    These files can boot on both old and new board. so the new board actually is PG1.0?

  • Tony,

    Wow! Yes looks like that! Paste the logs & resolve this issue.

    Best Regards,
    Keerthy

  • U-Boot SPL 2020.01-dirty (Jan 28 2021 - 09:41:25 +0530)
    SYSFW ABI: 3.1 (firmware rev 0x0014 '20.8.5--v2020.08b (Terrific Lla')
    Trying to boot from MMC2
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.3():07.01.00.004-1-g52c334fc3-dirty
    NOTICE: BL31: Built : 15:36:28, Nov 25 2020

    U-Boot SPL 2020.01-dirty (Jan 28 2021 - 09:41:20 +0530)
    SYSFW ABI: 3.1 (firmware rev 0x0014 '20.8.5--v2020.08b (Terrific Lla')
    Detected: SER-PCIEUSBEVM rev E3
    Trying to boot from MMC2


    U-Boot 2020.01-dirty (Jan 28 2021 - 09:41:20 +0530)

    SoC: AM65X SR1.0
    Model: Texas Instruments AM654 Base Board
    Board: AM6-COMPROCEVM rev E3
    DRAM: 4 GiB
    MMC: sdhci@4f80000: 0, sdhci@4fa0000: 1
    Loading Environment from MMC... OK
    In: serial
    Out: serial
    Err: serial
    Detected: SER-PCIEUSBEVM rev E3
    Net:
    Warning: ethernet@46000000 using MAC address from ROM
    eth0: ethernet@46000000, eth1: pruss2_eth
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc1 is current device
    SD/MMC found on device 1
    1011 bytes read in 5 ms (197.3 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    Running uenvcmd ...
    16666632 bytes read in 712 ms (22.3 MiB/s)
    64400 bytes read in 8 ms (7.7 MiB/s)
    ## Flattened Device Tree blob at 82000000
    Booting using the fdt blob at 0x82000000
    Loading Device Tree to 00000000fddb2000, end 00000000fdec4fff ... OK

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [ 0.000000] Linux version 5.4.74-g9574bba32a (oe-user@oe-host) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 SMP PREEMPT Wed Nov 25 15:56:45 UTC 2020