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.

AM625: Default wic image does not boot up

Part Number: AM625


Tool/software:

Hi Support Team,


I am using bsp version 09.01.00.08. I did not change anything about .wks file on yocto part which is:

part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 1024 --fixed-size 128 --use-uuid
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 1024 --use-uuid



When I try to flash this wic into emmc, the device does not boot up but if I create SD card with the same wic image using balenaEtcher, I am able to see u-boot logs at least.


How can I fix it? What could be the reason of this problem?

  • Hi Veysel,

    Please show the exact commands and logs for flashing the wic image to eMMC.

  • Hi Bin,

    I am using the wic image created by yocto build. So, there is no commands that I used. I've already shared the .wks file with you. I ll forward you flashing logs later.

    Actually I want to ask something else. When we flash the image using SD card, we are using these commands:

    echo 0 > /sys/block/mmcblk0boot0/force_ro
    dd if=/run/media/boot-mmcblk1p1/tiboot3.bin of=/dev/mmcblk0boot0 seek=0
    dd if=/run/media/boot-mmcblk1p1/tispl.bin of=/dev/mmcblk0boot0 seek=1024
    dd if=/run/media/boot-mmcblk1p1/u-boot.img of=/dev/mmcblk0boot0 seek=5120

    these are writing bootloader image into exact parts of boot partition and this partition is "/dev/mmcblk0boot0"

    for the wic image, "mmcblk0" partition is reserved for boot partition and we do not give any offsets for bootloader images in the .wks file.

    What is the reason of that? Could it be the reason of that I cant boot?

  • Hi Veysel,

    I am not familiar with yocto or .wks files, but it seems you are trying to use eMMC UDA boot. This boot mode doesn't use the eMMC boot0 partition.

    What is the SYSBOOT pin setting do you use for booting with this eMMC wic image?

  • Hi Bin,

    Yes we are using eMMC UDA boot, that is bootloader images are written via dd command into mmcblk0boot0 partition.

    We changed the sysboot pins to support emmc filesystem mode, and default .wic image booted up. Bootloader partition was mmcblk0p1 in this case

    Is there any way to support .wic image in eMMC raw mode in this case ? Or do we have to use emmc filesystem mode to be able to boot with .wic image ?

  • Hi Veysel,

    I am kind of confused about what you did and what you want to achieve, but here is a summary of eMMC boot methods on AM62x.

    The TRM Table 5-4 shows two MMC related primary boot modes:

    The first one is typically used in SD card boot, but it also supports boot from eMMC UDA. In this case, the eMMC boot0/1 partitions are not used. Rather the eMMC UDA is partitioned into two in the very similar way that how SD card is partitioned in SD card boot mode, And the U-Boot binaries are placed in the first boot partition which is in FAT format.

    In the second MMC boot mode - "eMMC boot", the U-Boot binaries are placed in eMMC boot0 (or boot1) partition which is in raw format. In this case, the eMMC UDA typically is partitioned (but not limited of cause) in one with ext4 format for Linux rootfs.

    So when you want to use a .wic image for eMMC, you won't use the second MMC boot mode, I am aware of any way to create a .wic image for both eMMC boot0 and UDA.

    Please let me know if you have follow-up questions.

  • Hi Bin,

    Thank you for quick response.

    So when you want to use a .wic image for eMMC, you won't use the second MMC boot mode, I am aware of any way to create a .wic image for both eMMC boot0 and UDA.

    This is clear for us now. We have to use MMCSD with filesystem mode to use .wic image.

    Actually, we have a problem with primary and backup boot modes. We need to use boot modes like that:

    Primary Boot Mode: MMCSD BOOT (SD Card Boot)
    Backup Boot Mode: MMCSD Boot (eMMC Boot)

    Here are our all BOOTMODE selection pin configurations:

    Using this pin settings, we have a SD Card created with filesystem mode in boot partition and eMMC is flashed with filesystem mode again. We are able to boot from SD Card as primary boot but, when we detach SD Card, backup emmc boot is not booting (There are no bootloader logs).

    In AM62x Sitara Processors Technical Reference  Manual (Rev. B). Page. 490:

    "When eMMC boot is used as a backup boot option, only User Data Area (UDA) in filesystem mode is supported.
    Raw mode is not supported. Additionally, boot will only occur in 1-bit mode during backup booting."

    So, we expect it to boot with filesystem mode.

    Can we use SD-Card as primary boot with filesystem mode and eMMC as backup with filesystem mode so that, when there is SD-Card inserted into board, images in SD-Card will boot. Otherwise eMMC images will boot in device ?

    Thanks in advance,

     

  • Hi Veysel,

    I barely use any of the backup boot modes, so I cannot immediately tell if there is any issue with eMMC UDA backup boot.

    After you have flashed the eMMC, can you change the bootmode setting to set the primary boot to eMMC UDA to see if it boots from eMMC? This would tell if the eMMC has been flashed correct.

  • Hi Bin,

    Below is the current status, let me summarize

    BOOTMODE PIN selection is below ( as previous one)

    It is expected to boot from SD-Card in filesystem mode (if available) since it is primay. If SD-Card is not available, eMMC in filesystem mode should boot, since it is secondary.

    In this case, when I insert SD Card, device is booted from eMMC

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    SPL initial stack usage: 13384 bytes
    Trying to boot from MMC1
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...

    Even if I remove SD-Card, device is booted from eMMC

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    SPL initial stack usage: 13384 bytes
    Trying to boot from MMC1
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...

    If I discard backup boot mode, via setting B10-B11-B12 as 0, then set primary boot as SD-Card, device boots from SD-Card

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    SPL initial stack usage: 13384 bytes
    Trying to boot from MMC2
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...

    If I discard backup boot mode, via setting B10-B11-B12 as 0, then set primary boot as eMMC, device boot from eMMC.

    So problem looks like, ilf sd-card is primary and inserted, device does not boot from SD-Card and boots from eMMC.

    Do you know such problem or can you please provide us a solution ?

    Thanks in advance,

  • Hi Veysel,

    So problem looks like, ilf sd-card is primary and inserted, device does not boot from SD-Card and boots from eMMC.

    Do you know such problem or can you please provide us a solution ?

    I am unable to explain the behavior.

    Do you see the problem on multiple boards?

    Do you see the same problem on AM62x EVM?

  • Hi Bin,

    We see the exact same behaviour on different boards. Unfortunately we do not have AM62x EVM.

    Is it possible for us to direct boot device as hardcoded in bootloader side ? If it is possible, we would like to boot from SD-Card with filesystem mode if it is inserted. Otherwise boot from eMMC with filesystem mode ?

    Can you please help ?

    Thanks in advance,

  • Hi Veysel,

    The problem is in ROM detecting and loading second bootloader form SD card, the U-Boot binary is not coming into the boot flow yet, so nothing can be hardcoded.

    A quick test (I never did this before, and not sure if it would work), can you please change the BOOT MODE bit13 to 1 so both primary and back modes all boot from the sdcard, to see the board will boot from the sdcard?

  • Hi Bin,

    Really thanks for your quick feedbacks. I tried the test you mentioned, BOOT MODE bit13 to 1 so that both primary and backup modes all boot from the sdcard. In this case device booted up from SD-CARD:

    -Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    SPL initial stack usage: 13384 bytes
    Trying to boot from MMC2
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...

    But did not boot from eMMC if I remove SD-Card.

    Can you please help ?

    Thanks in advance,

  • Hi Veysel,

    But did not boot from eMMC if I remove SD-Card.

    This is expected since both primary and backup are all boot from sdcard.

    Now step back, it seems you use the same U-Boot binary for both sdcard and eMMC boot, so the very first boot message is always the same:

        Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)

    and we cannot be certain if ROM is loading tiboot3.bin from sdcard or eMMC.

    Can you please rebuild the U-Boot, and update the binary tiboot3.bin to the sdcard? Then if ROM boots from the sdcard, the first console message would have the current timestamp, instead of "Dec 06 2023", so that we know where it boots from in each test.

  • Hi Bin,

    We clean build u-boot via bitbake commands as below and then build again:

    MACHINE=am62xx-evm bitbake -c cleansstate u-boot-ti-staging mc:k3r5:u-boot-ti-staging

    And we are able to see that everytime both tiboot3.bin, tispl.bin and u-boot.img is generated newly. I can also verify this via timestamps of the file, Accessed and Modified times are up-to-date whenever I build.

    But timestamp as you indicated is Dec 06 2023 - 15:11:4 and it never changes ? 

    Thanks in advance,

  • Do you mean even if you changed the backup boot mode to 000, and we know eMMC never gets involved, the sdcard boot log still shows "Dec 06 2023"?

    If It might because Yocto hardcoded/fixed the build timestamps, but I am not familiar with Yocto to tell how to change it.

    Can you change the U-Boot version/tag in your Yocto configuration, for example to 9.2.x.x so that the boot log would be different from eMMC boot?

        Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
        SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')

  • Hi Bin,

    Yes, in both SD-Card and eMMC boot seperately, we get the same boot log for each of them.

    As a quick test, I added logs in common/spl.c in boot_from_devices function and then cleaned u-boot and compiled again.

    Then I replaced the tiboot3.bin in SD-Card boot partition, with the newly compiled one.

    If SD-Card is primary and inserted, eMMC is backup, device again booted from eMMC (without newly added logs):

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    SPL initial stack usage: 13384 bytes
    Trying to boot from MMC1

    If I set both primary and backup as SD-Card boot, just to make sure that device can boot from SD-Card, I am able to see my newly added logs:

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    SPL initial stack usage: 13384 bytes
    Boot from SD-Card --> NEWLY ADDED LOG
    Trying to boot from MMC2
    mmc_load_image_raw_sector: mmc block read error
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...

    As you can see, since tiboot3.bin has the changes but timestamp is still the same. I do not know whether this is related with our problem but, as a result we are not able to boot from SD-Card if it is primary.

    Can you please help ?

  • Hi Veysel,

    As a quick test, I added logs in common/spl.c in boot_from_devices function and then cleaned u-boot and compiled again.

    nice trick for the debug!

    When you set sdcard as primary and eMMC as backup, what is the output of the following command in U-Boot prompt?

    => md.l 43000030 1

  • In each test, did you power cycle the board or warm-reset the board?

  • Hi Bin,

    Below is the command output for "md.l 43000030 1" when SD-Card is primary (as filesystem) and eMMC is backup (again as filesystem)

    43000030: 000016c3 ....

    I did tests with the power off-on cycle.

    By the way I observed that, SD-Card is primary and eMMC is backup, and SD-Card is inserted, if I power-up the board, device boots from eMMC.

    Again, if I power-up the board and intercept the u-boot, then trigger a "reset" command in u-boot, I can see that device boots up from SD-Card everytime.

    Can you please help ? 

    Thanks in advance,

  • Hi Bin, 

    Let me correct the command output, sorry for inconvenience

    => md.l 43000030 1
    43000030: 00001643 C...

    Thanks in advance,

  • BOOTMODE PIN selection is below ( as previous one)

    According to this table, the boot mode should be 0x1643, but

    43000030: 000016c3 ....

    it latches as 0x16c3 in the register.

    It seems pin B7 is reversed. Please double check your board.


  • => md.l 43000030 1
    43000030: 00001643 C...

    Okay, now I see you updated the value to 0x1643, which seems to be correct.

    The only thing that I can recommend now is to test with different brand of SD card to see if the issue still happens.

  • Please also check all the sdcard bus signals (data/cmd and clk lines) have the required pull-up/-down resisters.

  • Hi Bin,

    I just tried with a different brand SD-Card but result is the same. I'll check data/cmd & clk lines for sure.

    But do you have any comments for the below behaviour ? SD-Card primary boot is working as expected if I intercept u-boot and enter the reset command:

    By the way I observed that, SD-Card is primary and eMMC is backup, and SD-Card is inserted, if I power-up the board, device boots from eMMC.

    Again, if I power-up the board and intercept the u-boot, then trigger a "reset" command in u-boot, I can see that device boots up from SD-Card


    Can you please help ?

    Thanks in advance,

  • Hi Veysel,

    The BOOTMODE latch in MMR is correct as the primary is sdcard and backup is eMMC. If power on the board it always boots from eMMC, it means ROM failed in detecting/initializing from sdcard.

    Since warmreset can make sdcard boot work, it seems indicating the sdcard is not ready at the point of POR then ROM fails in detecting it. So we now need to focus on checking the hardware, such as sdcard signal design (pullup/pulldown), all the power rails and power up sequencing, etc.

  • Hi Bin, 

    We checked our SD Card bus signals and we noticed that the problem is about power-up sequence of the SD Card. We fixed it and we are able to use primary boot SD Card and backup boot eMMC.

    Thanks for your all help.

  • Glad the issue is resolved. Thanks for the update.