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.

TDA4VM: Invalid magic number in Single image header

Part Number: TDA4VM

Hi,

Currently I am using SDK7.3.0 to try OSPI Boot mode.

When I use sbl_ospi_img to boot boot_app_mcu_rtos, the following error occurred:

"Invalid magic number in Single image header"

I confirmed through u-boot that the OSPI Flash address 0x10000 content is: 0x5254534D

U-Boot SPL 2020.01-00003-g3c9a65f (Sep 08 2021 - 09:34:21 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
Trying to boot from MMC2
Loading Environment from MMC... *** Warning - No MMC card found, using default environment

Starting ATF on ARM64 core...

NOTICE:  BL31: v2.4(release):07.03.00.005-dirty
NOTICE:  BL31: Built : 00:15:40, Apr 10 2021

U-Boot SPL 2020.01-00003-g3c9a65f (Sep 08 2021 - 09:33:44 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
Detected: J7X-BASE-CPB rev E3
Detected: J7X-VSC8514-ETH rev E2
Trying to boot from MMC2


U-Boot 2020.01-00003-g3c9a65f (Sep 08 2021 - 09:33:44 +0800)

SoC:   J721E SR1.0
Model: Texas Instruments K3 J721E SoC
Board: J721EX-PM2-SOM rev E7
DRAM:  4 GiB
not found for dev hbmc-mux
Flash: 0 Bytes
MMC:   sdhci@4f80000: 0, sdhci@4fb0000: 1
Loading Environment from MMC... OK
In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
Detected: J7X-BASE-CPB rev E3
Detected: J7X-VSC8514-ETH rev E2
Net:   K3 CPSW: nuss_ver: 0x6BA00101 cpsw_ver: 0x6BA80100 ale_ver: 0x00293904 Ports:1 mdio_freq:1000000
eth0: ethernet@46000000
Hit any key to stop autoboot:  0
=>
=>
=>
=> sf probe
Can't get reset: -2
Ring Accelerator probed rings:286, gp-rings[96,20] sci-dev-id:235
dma-ring-reset-quirk: disabled
WARN: PHY calibration failed: -2
SF: Detected mt35xu512aba with page size 256 Bytes, erase size 128 KiB, total 64 MiB
=> echo $loadaddr
0x82000000
=> sf read $loadaddr 0x100000 0x40
device 0 offset 0x100000, size 0x40
SF: 64 bytes @ 0x100000 Read: OK
=> md.l $loadaddr 0x10
82000000: 5254534d 00000001 00000037 00000000    MSTR....7.......
82000010: 00000004 00000020 00000000 444e454d    .... .......MEND
82000020: 43525052 41010000 00000000 0000000f    RPRC...A........
82000030: 00000001 41010000 00000000 00000040    .......A....@...
=>

Why is it actually 0x5254534D, but it is 0x0000005B when read from SBL?

I use u-boot to write the required binary files into OSPI:

sf probe
sf erase 0x0 0x4000000
echo $loadaddr
fatload mmc 1 ${loadaddr} sbl_ospi_img_mcu1_0_release.tiimage
sf write $loadaddr 0x0 0x${filesize}
fatload mmc 1 ${loadaddr} tifs.bin
sf write $loadaddr 0x80000 0x${filesize}
fatload mmc 1 ${loadaddr} can_boot_app_mcu_rtos_mcu1_0_release.appimage
sf write $loadaddr 0x100000 0x${filesize}

This is the log of my operation:

U-Boot SPL 2020.01-00003-g3c9a65f (Sep 08 2021 - 09:34:21 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
Trying to boot from MMC2
Loading Environment from MMC... *** Warning - No MMC card found, using default environment

Starting ATF on ARM64 core...

NOTICE:  BL31: v2.4(release):07.03.00.005-dirty
NOTICE:  BL31: Built : 00:15:40, Apr 10 2021

U-Boot SPL 2020.01-00003-g3c9a65f (Sep 08 2021 - 09:33:44 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
Detected: J7X-BASE-CPB rev E3
Detected: J7X-VSC8514-ETH rev E2
Trying to boot from MMC2


U-Boot 2020.01-00003-g3c9a65f (Sep 08 2021 - 09:33:44 +0800)

SoC:   J721E SR1.0
Model: Texas Instruments K3 J721E SoC
Board: J721EX-PM2-SOM rev E7
DRAM:  4 GiB
not found for dev hbmc-mux
Flash: 0 Bytes
MMC:   sdhci@4f80000: 0, sdhci@4fb0000: 1
Loading Environment from MMC... OK
In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
Detected: J7X-BASE-CPB rev E3
Detected: J7X-VSC8514-ETH rev E2
Net:   K3 CPSW: nuss_ver: 0x6BA00101 cpsw_ver: 0x6BA80100 ale_ver: 0x00293904 Ports:1 mdio_freq:1000000
eth0: ethernet@46000000
Hit any key to stop autoboot:  0
=>
=>
=>
=> sf probe
Can't get reset: -2
Ring Accelerator probed rings:286, gp-rings[96,20] sci-dev-id:235
dma-ring-reset-quirk: disabled
WARN: PHY calibration failed: -2
SF: Detected mt35xu512aba with page size 256 Bytes, erase size 128 KiB, total 64 MiB
=> sf erase 0x0 0x4000000
SF: 67108864 bytes @ 0x0 Erased: OK
=> echo $loadaddr
0x82000000
=> fatload mmc 1 ${loadaddr} sbl_ospi_img_mcu1_0_release.tiimage
327564 bytes read in 17 ms (18.4 MiB/s)
=> sf write $loadaddr 0x0 0x${filesize}
device 0 offset 0x0, size 0x4ff8c
SF: 327564 bytes @ 0x0 Written: OK
=> fatload mmc 1 ${loadaddr} tifs.bin
263072 bytes read in 14 ms (17.9 MiB/s)
=> sf write $loadaddr 0x80000 0x${filesize}
device 0 offset 0x80000, size 0x403a0
SF: 263072 bytes @ 0x80000 Written: OK
=> fatload mmc 1 ${loadaddr} can_boot_app_mcu_rtos_mcu1_0_release.appimage
266316 bytes read in 14 ms (18.1 MiB/s)
=> sf write $loadaddr 0x100000 0x${filesize}
device 0 offset 0x100000, size 0x4104c
SF: 266316 bytes @ 0x100000 Written: OK
=>

This is my binary file:

binary file.rar