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.

Linux/PROCESSOR-SDK-AM335X: Bootloader not working as built

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AM3358

Tool/software: Linux

I have recently purchased an AM3358 evaluation module, and downloaded and installed the Linux-rt SDK version 5.01.00.11.  Following the instructions on the developer wiki, I have built and installed to an SD card the bootloader, kernel, and filesystem.  Using the binaries I compiled, the processor boots up but the serial console output is gibberish.  I have isolated the problem to the MLO file that is created in my build.  If I replace the generated MLO file I built with the one that comes on the SD card, and leave the other rebuilt files the same, the system boots up and the console works properly.  Why does the pre-built MLO file work but not newer built ones?  The version displayed on the console for the old MLO file is SPL 2016.05-g4db46a6bbd (Mar 29 2017 - 17:44:45).  Did something get broken in the source tree of the latest RT SDK?

  • Hi Jake,

    From what I was able to understand, you have the below steps:

    1. You build your own MLO from PSDK Linux-RT 5.01 u-boot-2018.01 code and this MLO does not work
    2. You replace this MLO with pre-built MLO that is based on u-boot-2016.05 (PSDK Linux-RT 3.x ) and this MLO works fine

    Is that correct? What about pre-built MLO from PSDK Linux-RT 5.01? have you tried with that MLO?

    ti-processor-sdk-linux-rt-am335x-evm-05.01.00.11/board-support/prebuilt-images/MLO-am335x-evm

    If you run the create-sdcard.sh script, it should create you bootable SD card with pr-built images from PSDK 5.01:

    ti-processor-sdk-linux-rt-am335x-evm-05.01.00.11/bin/create-sdcard.sh



    Regards,
    Pavel

  • Yes, what you have outlined in the first two steps is correct.

    I replaced the generated MLO file with board-support/prebuilt-images/MLO-am335x-evm (renaming it to MLO on the SD card), and that file does not work - it is the same unreadable character spray on the console at startup that I get with my generated image.  I also ran the create-sdcard.sh script and used the pre-built images and I get the same behavior.  The system appears to boot, but the serial console does not work.

  • Jake,

    What is your host PC OS? Is it Ubuntu 16.04 LTS 64-bit or other?

    Do you use minicom? There is setup.sh script, which invokes setup-minicom.sh, which configures minicom correctly. Do you use setup.sh script?

    Regards,
    Pavel
  • The host PC is running Ubuntu 16.04 LTS per your recommendation. I have run the setup.sh script, which installed and configured minicom. I don't believe this is a minicom problem, as an older version of the MLO works with my minicom configuration, but the new one doesn't - unless there was a change in the MLO build or source that requires a change to the terminal setup that wasn't done by the setup script.
  • Jake,

    I just check ti-processor-sdk-linux-rt-am335x-evm-05.01.00.11 pre-built MLO on my own AM335x EVM and it works fine. Below is the log:

    pbotev@lin-0306:~$ picocom -b 115200 /dev/ttyUSB0
    picocom v1.7

    port is        : /dev/ttyUSB0
    flowcontrol    : none
    baudrate is    : 115200
    parity is      : none
    databits are   : 8
    escape is      : C-a
    local echo is  : no
    noinit is      : no
    noreset is     : no
    nolock is      : no
    send_cmd is    : sz -vv
    receive_cmd is : rz -vv
    imap is        :
    omap is        :
    emap is        : crcrlf,delbs,

    Terminal ready

    U-Boot SPL 2018.01-gcdb1cc0a9e (Oct 06 2018 - 04:31:16)
    Trying to boot from MMC1
    *** Warning - bad CRC, using default environment



    U-Boot 2018.01-gcdb1cc0a9e (Oct 06 2018 - 04:31:16 +0000)

    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x EVM
    DRAM:  1 GiB
    NAND:  256 MiB
    MMC:   OMAP SD/MMC: 0
    *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  0
    => version
    U-Boot 2018.01-gcdb1cc0a9e (Oct 06 2018 - 04:31:16 +0000)

    arm-linux-gnueabihf-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011
    GNU ld (Linaro_Binutils-2017.11) 2.28.2.20170706

    The pre-built MLO is correct. I would suggest you to make fresh start. Download the SDK bin file and install again. Then make new SD card with the script.

    Make sure also you are aligned with the EVM quick start guide:

    Regards,
    Pavel

     

     

  • This did not work. I downloaded the RT SDK from here (www.ti.com/.../processor-sdk-am335x) on a clean Ubuntu 16.04 LTS system and installed it. I ran the setup.sh script, and then ran the create-sdcard script from the bin directory, using the pre-built binaries in the SDK (I have not tried to do a build). I get the same results on the console - garbage characters. I noticed that you are not using minicom, so I also tried using picocom and I still see garbage characters, so I do not believe this is a minicom problem.

    Are you certain that the version of u-boot that you have built and tried matches the version of u-boot that is in the version 5.01 binary that is on your website?
  • Jake,

    I did not built u-boot, I am using the pre-biult one. And it match the PSDK Linux-RT 5.01 u-boot version:

    ti-processor-sdk-linux-rt-am335x-evm-05.01.00.11/board-support/u-boot-2018.01+gitAUTOINC+cdb1cc0a9e-gcdb1cc0a9e

    ti-processor-sdk-linux-rt-am335x-evm-05.01.00.11/board-support/prebuilt-images/MLO-am335x-evm

    U-Boot SPL 2018.01-gcdb1cc0a9e

    U-Boot 2018.01-gcdb1cc0a9e

     

    What I can suggest you is:

     - use the MD5 Checksums to verify your ti-processor-sdk-linux-rt-am335x-evm-05.01.00.11-Linux-x86-Install.bin file is downloaded correctly

    - check for error/warning messages during bin file installation and during SD card create process

    - try with another SD card

    - try with another serial cable, make sure you connect it to J12 of the EVM

    - verify your sysboot pins are correctly configured for SD card boot

     

    Regards,
    Pavel

  • Pavel,

        I verified the MD5 checksums are correct.  The boot pins on the device are set correctly (otherwise I suspect neither MLO image would work).  I also verified the serial cable is working correctly (otherwise I suspect neither MLO image would work).  I then tried re-creating a boot-able SD card with a new card.  I verified the card was empty and had no partitions defined on it before starting.  I even wiped it with the 'dd if=/dev/null' trick.  When I ran the create-sdcard.sh script, it partitioned the new SD card, but it apparently failed to make filesystems on the new partitions, and when the script was complete there was nothing on the card (because of the mkfs failure).  Is there an existing state the SD card should be in prior to running the create-sdcard.sh script?  Below is the console output I got when I ran the script on the pristine card.


    ################################################################################

    This script will create a bootable SD card from custom or pre-built binaries.

    The script must be run with root permissions and from the bin directory of
    the SDK

    Example:
     $ sudo ./create-sdcard.sh

    Formatting can be skipped if the SD card is already formatted and
    partitioned properly.

    ################################################################################


    Available Drives to write images to:

    #  major   minor    size   name
    1:   8       16    7643136 sdb
     
    Enter Device Number or n to exit: 1
     
    sdb was selected

    /dev/sdb is an sdx device
    SD Card is not correctly partitioned

    ################################################################################

        Select 2 partitions if only need boot and rootfs (most users).
        Select 3 partitions if need SDK & other content on SD card.  This is
            usually used by device manufacturers with access to partition tarballs.

        ****WARNING**** continuing will erase all data on sdb

    ################################################################################

    Number of partitions needed [2/3] : 2

     
    Now partitioning sdb with 2 partitions...
     

    ################################################################################

            Now making 2 partitions

    ################################################################################

    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.255692 s, 4.1 MB/s
    DISK SIZE - 7826571264 bytes

    ################################################################################

            Partitioning Boot

    ################################################################################
    mkfs.fat 3.0.28 (2015-05-16)
    mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
    /dev/sdb1: No such file or directory

    ################################################################################

            Partitioning rootfs

    ################################################################################
    mke2fs 1.42.13 (17-May-2015)
    The file /dev/sdb2 does not exist and no size was specified.


    ################################################################################

       Partitioning is now done
       Continue to install filesystem or select 'n' to safe exit

       **Warning** Continuing will erase files any files in the partitions

    ################################################################################


    Would you like to continue? [y/n] : y

     
    mkdir: cannot create directory '/opt/ti-sdk-rt/bin/tmp': File exists
     
    Mount the partitions
    mkdir: cannot create directory 'boot': File exists
    mkdir: cannot create directory 'rootfs': File exists
    mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
           missing codepage or helper program, or other error

           In some cases useful info is found in syslog - try
           dmesg | tail or so.
    mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
           missing codepage or helper program, or other error

           In some cases useful info is found in syslog - try
           dmesg | tail or so.
     
    Emptying partitions
     

    Syncing....

    ################################################################################

        Choose file path to install from

        1 ) Install pre-built images from SDK
        2 ) Enter in custom boot and rootfs file paths

    ################################################################################

    Choose now [1/2] :

  • Jake Izzo said:
    Is there an existing state the SD card should be in prior to running the create-sdcard.sh script?

    I am not aware of such requirement.

    If you’ve recently purchased a TI EVM or Starterkit, it should have came with a SD card with the SDK on it. The SDK on your SD card is simply a few revisions old and you want the latest.

    You will need a >8GB SD Card and the capability to connect that card to your Linux Host machine (using a USB SD Card reader).

    Do you use the SD card that comes with the EVM box? What is the size? I am working successful with 8GB size card, but you might try with 16GB also. I am using Micro SDHC class 10.

    Regards,
    Pavel

  • I am using 2 different class 10 micro SD cards.  I don't think this switching to a 16GB card explains why an old binary of the MLO file located in the vfat boot/ partition works, but when copied over by another MLO file to the same location, it does not work - especially if when I then revert the MLO file back to the old binary, the SD card resumes working correctly.

    Do you have an MLO file you have built from source that I could try on my hardware?

  • Jake,

    I built one MLO file and try it, works fine on my EVM, below is the log:

    Terminal ready

    U-Boot SPL 2018.01-00444-g021e7016aa-dirty (Nov 06 2018 - 12:09:46)
    Trying to boot from MMC1
    *** Warning - bad CRC, using default environment

    I am attaching MLO file:

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/2084.MLO

    My AM335x EVM is:

    Base Board Rev 1.6A, AM3358BZCZ100

    Daughter Board rev 1.2B

    What is your EVM?

    Regards,
    Pavel

  • My base board and daughter board are the same revisions as yours.

    Thank you for sending me the MLO file to try, but unfortunately it also did not work for me. One thing that I noticed as I was reviewing all the steps taken so far is that the MLO file that was on the SD card that came with the development kit is smaller than the other files I have tried:

    "working" MLO file from SD card - 79220 bytes
    MLO file included in SDK - 110316 bytes
    MLO file built from SDK (make u-boot) - 109868 bytes
    2084.MLO - 109880 bytes

    Is there some sort of size or alignment problem here?
  • Jake Izzo said:
    "working" MLO file from SD card - 79220 bytes
    MLO file included in SDK - 110316 bytes
    MLO file built from SDK (make u-boot) - 109868 bytes
    2084.MLO - 109880 bytes

    Is there some sort of size or alignment problem here?

    No, I do not think so. MLO file size should fit into AM335x internal RAM memory, which is up to 128KB, check memory map in TRM doc. But you can try to reduce the size of your MLO (remove some features) and check if that will give some improvements.

    Another thing you can try is to build your own MLO based on u-boot-2016.05 (PSDK Linux-RT 3.x ) and check if that MLO will work fine. If yes, you can compare these two MLO files source code, check where exactly the boot flow hangs at new MLO and compare with old MLO.

    Below pointers might be in help:

    Regards,
    Pavel

  • Where would one obtain previous versions of the Linux RT SDK to do the comparison? It is not obvious on your website where older versions can be accessed.
  • software-dl.ti.com/.../index_FDS.html

    At the bottom of the page you have "Previous SDK Link", you need to revert back till the version you need.

    Regards,
    Pavel
  • Version 04.00.00.04 of the SDK builds a set of files that boot with a working console, but any later version does not. The differences between that version and the latest are quite extensive - I was hoping that the symptoms I described could at least prompt you to suggest more specific areas to troubleshoot.
  • Jake,

    How do you have the sysboot pins set?

    Given that the same binary works on many other boards but yours (we test it pretty extensively), I'd say we need to consider that there is some kind of hardware inconsistency. I understand that you can find a binary out there that works, but that may just be luck.

    Do you have any other board you can try?
  • The sysboot pins are set to the correct positions, but to your point, that doesn't mean the signals are correct at the processor pins.  I do not have another evaluation module (at $1k a pop we are making-do with one), but I have a starter kit and I verified that the latest version of the MLO and u-boot.img files do boot correctly on that hardware.