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.

[参考译文] J784S4XEVM:bootApp OSPI 引导模式无效幻数

Guru**** 2840320 points

Other Parts Discussed in Thread: UNIFLASH

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1633104/j784s4xevm-bootapp-ospi-boot-mode-invalid-magic-number

器件型号: J784S4XEVM
Thread 中讨论的其他器件: UNIFLASH

您好、

我目前正在测试 BootApp OSPI 引导模式 进行操作。

  • SDK 版本 :RTOS SDK v11.01

使用 Uniflash 将自定义映像刷写到 OSPI 后、A “幻数无效“ 启动时出错。

为了排除自定义映像的问题、我还使用 SDK 中提供的示例映像进行了测试、但同样的问题仍然存在。

file Read Time: 85598
Starting Sciserver..... PASSED
MCU R5F App started at 3873 usecs
Loading BootImage
file Read Time: 13149
Invalid magic number in Single image header
Error parsing Main Domain appimage
BootImage completed, status = -1
Failure during image copy and parsing
Loading BootImage
file Read Time: 14531
Invalid magic number in Single image header
Error parsing Main Domain appimage
BootImage completed, status = -1
Failure during image copy and parsing
Loading BootImage
file Read Time: 15763
file Read Time: 16402
file Read Time: 16798
BootImage completed, status = 0
SBL_SlaveCoreBoot completed for Core ID#0, Entry point is 0x70000000
OSPI flash left configured in Legacy SPI mode.

 OSPI NOR device ID: 0x5b1a, manufacturer ID: 0x34
Boot App: Started at 4088 usec
Boot App: Total Num booted cores = 1
Boot App: Booted Core ID #0 at 18154 usecs
MCU Boot Task started at 4088 usecs and finished at 81492 usecs

作为参考、我遵循了 SDK 测试程序。

Booting Linux via OSPI

Generate lateapps by using the following commands

goto <PDK>/packages/ti/boot/sbl/example/boot_app/scripts

Run ./generate_lateapps.sh <board_name>

Multicore images(lateapps) will be generated in <PDK>/packages/ti/boot/sbl/example/boot_app/binary/$BOARD/. Stage1 image corresponds to lateapp1, stage2 image corresponds to lateapp2 and so on.

Build boot_app_ospi by using the following command

make BOARD=<board_name> CORE=mcu1_0 boot_app_mmcsd_linux -sj

Flash images to ospi flash memory at specified address using uniflash tool

sbl_cust_img_mcu1_0_release.tiimage at an offset of 0x0

tifs.bin at an offset of 0x8000

boot_app_ospi_linux_<board_name>_mcu1_0_freertos_TestApp_release.appimage at an offset of 0x100000

stage1 image at an offset of 0x1fc0000

stage2 image at an offset of 0x27c0000

atf_optee.appimage at an offset of 0x1c0000

tidtb_linux.appimage at an offset of 0x7c0000

tikernelimage_linux.appimage at an offset of 0x1ec0000

>>>>>> uniflash tool command
dslite.bat --mode processors -c COM18 -f C:\ti\uniflash_9.4.1\processors\FlashWriter\j784s4_evm\uart_j784s4_evm_flash_programmer_release.tiimage -i 0
dslite.bat --mode processors -c COM18 -f D:\TI\rtos_app\ospi_boot\sbl_cust_img_mcu1_0_release.tiimage -d 3 -o 0 
dslite.bat --mode processors -c COM18 -f D:\TI\rtos_app\ospi_boot\tifs.bin -d 3 -o 80000
dslite.bat --mode processors -c COM18 -f D:\TI\rtos_app\ospi_boot\boot_app_ospi_linux_j784s4_evm_mcu1_0_freertos_TestApp_release.appimage -d 3 -o 100000
dslite.bat --mode processors -c COM18 -f D:\TI\rtos_app\ospi_boot\multicore_MCU2_0_MCU2_1_stage1.appimage -d 3 -o 0x1fc0000
dslite.bat --mode processors -c COM18 -f D:\TI\rtos_app\ospi_boot\multicore_DSPs_MCU3_0_MCU3_1_MCU4_0_MCU4_1_stage2.appimage -d 3 -o 27c0000

dslite.bat --mode processors -c COM18 -f D:\TI\rtos_app\ospi_boot\atf_optee.appimage -d 3 -o 1c0000
dslite.bat --mode processors -c COM18 -f D:\TI\rtos_app\ospi_boot\tidtb_linux.appimage -d 3 -o 7c0000
dslite.bat --mode processors -c COM18 -f D:\TI\rtos_app\ospi_boot\tikernelimage_linux.appimage -d 3 -o 1ec0000

该错误发生在 SBL_MulticoreImageParse函数中。 MMC/SD 和 OSPI 引导模式都会调用此函数。 lateapp1lateapp2这两种情况下都使用了相同的和图像。

  • MMC/SD 引导 :工作正常
    • 幻数 0x5254534d 0x5254534d
      文件读取时间:171091
      幻数 0x5254534d 0x5254534d
      文件读取时间:359769
  • OSPI 引导 :导致出现“无效幻数“错误

下面是lateapp1映像的十六进制转储。

image.png

我检查过论坛中讨论过的类似问题、但找不到明确的解决方案。

如有任何帮助、将不胜感激。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    您是否还在闪存的最后一个扇区刷写了调优数据? 这是调优所必需的。  

    此致、

    Brijesh

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Brijesh、

    感谢您的答复。

    关于您提到的“调优数据“、您是否指的是使用下图?

    dslite.bat --mode processors -c COM18 -f C:\ti\uniflash_9.4.1\processors\FlashWriter\j784s4_evm\nor_spi_patterns.bin -d 3 -o 3FC0000
    C:\ti\uniflash_9.4.1>dslite.bat --mode processors -c COM18 -f C:\ti\uniflash_9.4.1\processors\FlashWriter\j784s4_evm\nor_spi_patterns.bin -d 3 -o 3FC0000
    Executing the following command:
    > C:\ti\uniflash_9.4.1\processors\ProcessorSDKSerialFlash.exe -c COM18 -f C:\ti\uniflash_9.4.1\processors\FlashWriter\j784s4_evm\nor_spi_patterns.bin -d 3 -o 3FC0000
    
    For more details and examples, please refer to the UniFlash Quick Start guide.
    
    
    ----------------------------------------------------------------------------
    ProcessorSDKSerialFlash CLI Tool
    Copyright (C) 2017-2023 Texas Instruments Incorporated - http://www.ti.com/
    Version 1.10.0.0
    ----------------------------------------------------------------------------
    Transferring the Image to Flash Programmer..
    
    Transferring Header Information..
    Header Transfer Complete!
    
    Flashing Image of size 128 bytes
    Flash Programming Success!

    即使在写入图像后、结果也是一样的、我仍然收到一个“无效幻数“错误。

    如果“调优数据“是指需要完成的其他操作、您能否分享任何相关链接或文档?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    否这是正确的数据、必须在闪存的最后一个扇区中刷写。 地址 0x3FC0000 是否正确?  

    此致、

    Brijesh

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我在查看帖子后理解。 我目前正在查看相关的芯片组文档。 如果它在修改扇区偏移后正常工作、我将解决此问题。

    谢谢你

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢 Bae

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢 Brijesh

    我已确认 OSPI 引导功能正常工作。

    但是、该问题与图形大小无关(已验证为 512MB、地址 0x3FC0000 是正确的)、而是与 SDK 指南文档中的错误有关。

    在该指南中、闪存布局描述如下:

    • sbl_cust_img_mcu1_0_release.tiimage、偏移量为 0x0
    • 偏移量为 0x8000 时的 tifs.bin
    • boot_app_ospi_linux_ 偏移量为 0x100000 时的_mcu1_0_freertos_TestApp_release.appimage
    • 偏移为 0x1fc0000 的 stage1 图像
    • 偏移为 0x27c0000 的 stage2 映像
    • 偏移为 0x1c0000 时的 atf_optee.appimage
    • 偏移量为 0x7c0000 时的 tidtb_linux.appimage
    • 偏移为 0x1ec0000 时的 tikernelimage_linux.appimage

    但是、的位置 tidt_linux.appimage tikernelimage_linux.appimage 互换了。

    如果根据指南刷写、内核映像会覆盖 stage1 映像区域。

    通过查看实际的 SBL 源代码、可以清楚地看到:

    • 内核应位于 0x7c0000
    • DTB 应位于 0x1ec0000 处

    请对文件作相应的更新。