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:TDA4VM-SK:加载 DSP 固件后出现内核错误

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1581827/tda4vm-tda4vm-sk-kernel-panic-after-dsp-firmware-loaded

器件型号: TDA4VM

内核:Linux 版本 6.12.17-ti-00781-g95010a7c186b (oe-user@oe-host)(aarch64-poky-linux-gcc (GCC) 13.3.0、gnu

加载 freertos_test_task_switch_c66xdsp_1_release.xe66 并从/lib/firmware 链接到该文件之后

固件是在 pdk_jacinto_08_04_00_21 中构建的脚本。  

freertos_test_ut_c66xdsp_1_release.zip

内核崩溃、但 DSP 能够运行固件。

[    1.465241] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 14
[    1.472452] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64, Policers 8  
[    1.479820] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a010a, freq:50000
[    1.490402] am65-cpts 310d0000.cpts: CPTS ver 0x4e8a010a, freq:200000000, ad0
[    1.499104] omap-mailbox 31f80000.mailbox: omap mailbox rev 0x66fc7100       
[    1.505961] omap-mailbox 31f81000.mailbox: omap mailbox rev 0x66fc7100       
[    1.512888] omap-mailbox 31f82000.mailbox: omap mailbox rev 0x66fc7100       
[    1.519740] omap-mailbox 31f83000.mailbox: omap mailbox rev 0x66fc7100       
[    1.526561] omap-mailbox 31f84000.mailbox: omap mailbox rev 0x66fc7100       
[    1.533611] k3-dsp-rproc 4d80800000.dsp: assigned reserved memory node c66-d0
[    1.542558] k3-dsp-rproc 4d80800000.dsp: configured DSP for IPC-only mode    
[    1.549449] remoteproc remoteproc0: 4d80800000.dsp is available              
[    1.555385] remoteproc remoteproc0: attaching to 4d80800000.dsp              
[    1.561303] Unable to handle kernel paging request at virtual address ffff80d
[    1.569203] Mem abort info:                                                  
[    1.571987]   ESR = 0x0000000096000005                                       
[    1.575726]   EC = 0x25: DABT (current EL), IL = 32 bits                     
[    1.581025]   SET = 0, FnV = 0                                               
[    1.584070]   EA = 0, S1PTW = 0                                              
[    1.587202]   FSC = 0x05: level 1 translation fault                          
[    1.592068] Data abort info:                                                 
[    1.594939]   ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000                   
[    1.600412]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0                        
[    1.605449]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0                     
[    1.610748] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000083158000     
[    1.617433] [ffff80004e91619d] pgd=0000000000000000, p4d=10000000835fb003, p0
[    1.626119] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP          
[    1.632368] Modules linked in:                                               
[    1.635411] CPU: 0 UID: 0 PID: 39 Comm: kworker/u8:2 Not tainted 6.12.17-ti-1
[    1.644350] Hardware name: Texas Instruments J721E SK (DT)                   
[    1.649817] Workqueue: events_unbound deferred_probe_work_func               
[    1.655645] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)  
[    1.662587] pc : rproc_handle_resources.constprop.0+0x64/0x18c               
[    1.668409] lr : rproc_boot+0x37c/0x57c                                      
[    1.672231] sp : ffff800081d2ba10                                            
[    1.675532] x29: ffff800081d2ba10 x28: 0000000000000000 x27: 0000000000000000
[    1.682652] x26: 0000000000000000 x25: ffff0008011a51c0 x24: ffff80004e91619d
[    1.689771] x23: 0000000000000000 x22: ffff00080219e838 x21: ffff800081531f90
[    1.696889] x20: 0000000000000000 x19: ffff00080219e800 x18: 0000000000000006
[    1.704007] x17: 642d363663206564 x16: 6f6e2079726f6d65 x15: fb945feea70f5f97
[    1.711127] x14: 12b559cf933d062c x13: fb945feea70f5f97 x12: 12b559cf933d062c
[    1.718246] x11: 5c5c75c9e0a28957 x10: 3dfbe55c02c16a2f x9 : fc37bfad7fb57673
[    1.725364] x8 : 9d886772579c39de x7 : 715d50510adbf9c7 x6 : bf57f41015e9f8ef
[    1.732482] x5 : ffff00080223a800 x4 : ffff800086000000 x3 : 00000000376e9f5f
[    1.739601] x2 : 00000000c891619d x1 : ffff80004e9161a1 x0 : ffff800086000000
[    1.746721] Call trace:                                                      
[    1.749155]  rproc_handle_resources.constprop.0+0x64/0x18c                   
[    1.754626]  rproc_boot+0x37c/0x57c                                          
[    1.758101]  rproc_add+0x184/0x190                                           
[    1.761490]  devm_rproc_add+0x24/0x88                                        
[    1.765138]  k3_dsp_rproc_probe+0x33c/0x4c4                                  
[    1.769308]  platform_probe+0x68/0xc4                                        
[    1.772960]  really_probe+0xbc/0x29c                                         
[    1.776524]  __driver_probe_device+0x78/0x12c                                
[    1.780867]  driver_probe_device+0xd8/0x15c                                  
[    1.785036]  __device_attach_driver+0xb8/0x134                               
[    1.789467]  bus_for_each_drv+0x88/0xe8                                      
[    1.793289]  __device_attach+0xa0/0x190                                      
[    1.797113]  device_initial_probe+0x14/0x20                                  
[    1.801282]  bus_probe_device+0xac/0xb0                                      
[    1.805105]  deferred_probe_work_func+0x88/0xc0                              
[    1.809622]  process_one_work+0x148/0x28c                                    
[    1.813621]  worker_thread+0x2d0/0x3d8                                       
[    1.817358]  kthread+0x110/0x114                                             
[    1.820575]  ret_from_fork+0x10/0x20                                         
[    1.824140] Code: 6b020063 8b22c098 91001301 540007c4 (b862c880)             
[    1.830215] ---[ end trace 0000000000000000 ]---                             
                                                                                
execution time for task switches = 4880 ms                                      
number of task switches = 2000000                                               
time per task switch (semaphore give/take) = 2440 ns                            
                                                                                
execution time for task switches = 3363 ms                                      
number of task switches = 2000000                                               
time per task switch (direct-to-task notification give/take) = 1681 ns          
                                                                                
execution time for task yields = 1031 ms                                        
number of task yields = 1000000                                                 
time per task yield = 1031 ns                                                   
                                                                                
execution time for task - ISR - task switches = 669 ms                          
number of task switches = 1000000, num ISRs = 1000000                           
time per task - ISR - task switch (semaphore give/take) = 669 ns                
                                                                                
execution time for task - ISR - task switches = 743 ms                          
number of task switches = 1000000 , num ISR = 1000000                           
time per task - ISR - task switch (direct-to-task notification give/take) = 743s
                                                                                
execution time for task - ISR - task - task switches = 4878 ms                  
number of ISRs = 2000000.Ping ISR Count:1000000, Pong ISR Count:1000000         
time per task - ISR - task switch (semaphore give/take) = 2439 ns               
                                                                                
execution time for task - ISR - task switches = 3789 ms                         
number of task switches = 2000000                                               
number of isrs = 1000000,1000000                                                
time per task - ISR - task switch (direct-to-task notification give/take) = 189s
                                                                                
execution time for task switches = 4667 ms                                      
number of task switches = 2000000                                               
time per task switch (semaphore give/take) = 2333 ns                            
                                                                                
value after pow() computed b/w task switch = 1.8597                             
expected value = 1.8597                                                         
                                                                                
test_taskToIsrWithFloatOperations PASSED                                        
                                                                                
All tests have passed!! 

 我们是否应该了解对链接器文件所做的任何更改? 如果有、请分享该程序吗?

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

    您好、

    SDK 版本似乎不匹配 (PDK 与 Linux)。 这有什么理由吗? 是否可以使用匹配 版本 (08.04) 并检查相同版本。

    此致、
    Sivadeep

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

    是的、它适用于该版本、我可以从哪里获得构建映像所使用的 Yocto 层和配置?

    内核加载固件、DSP  在启动时执行(在驱动程序初始化期间)、如何从用户空间手动启动它 ?

    我能够从 uboot 执行此操作、但不能从内核用户空间执行此操作。

    root@tda4vm-sk:/opt/edge_ai_apps# cat /sys/class/remoteproc/remoteproc0/state 
    attached
    root@tda4vm-sk:/opt/edge_ai_apps# echo start > /sys/class/remoteproc/remoteproc0/state                                                                 
    -sh: echo: write error: Device or resource busy
    echo stop > /sys/class/remoteproc/remoteproc0/state                                                                                                    
    [  161.901907] remoteproc remoteproc0: stop not supported for this rproc, use detach
    -sh: echo: write error: Invalid argument

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

    您好、

    在哪里可以获取映像构建使用的 Yocto 层和配置?

    您是否可以在此处查看:使用 Yocto 构建 SDK/构建 SDK

    如何从用户空间手动启动它 ?

    请检查此处: 从 Linux 控制台/用户空间引导远程 Core

    此致、
    Sivadeep

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

    有关“从 Linux 用户空间引导远程内核“的链接适用于 r5f 内核、而不是 DSP。

    在仅 IPC 模式下、无法从用户空间启动 DSP 内核。

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

    您好、

    负责的工程师目前不在办公室。 请预计响应将延迟一天。

    此致、

    Betsy Varughese.

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

    用于下载 ti-processor-sdk-linux-j7-evm-08_02_00_03 的链接已失效。

    我找到了 08_00_00_08、但没有  08_02_00_03。

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

    您好、

    我找到了 08_00_00_08、但没有找到  08_02_00_03。

    您可以尝试 https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX VDD-J721E/08.02.00.03

    此致、

    Betsy Varughese.

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

    您好、

    在较新的 SDK 版本(≥10.1)中、DSP 和 MCU 等远程内核的启动应由 Linux 处理、而不是由 U-Boot 处理。 如果 Linux 引导这些内核、我们可以停止并重新启动它们。 。 IPC_ECHO_TEST 示例支持此正常关机功能。  在 SDK 8.4 中、不支持远程内核正常关闭和重新启动功能。 要启用此功能、需要升级到 SDK 版本 10.1 或更高版本。

    此外 freertos_test_task_switch_c66xdsp_1_release.xe66 固件是一个独立的测试应用程序。 因此这不起作用。 当出现平稳关断时、有适当的序列来关闭内核、然后再次启动内核、因此可执行文件必须与该功能兼容。  

    此致、
    Sivadeep

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

    同时使用 rootfs 映像和 SDK 10.1:

    root@tda4vm-sk:/opt/edgeai-gst-apps# echo j7-c66_0-fw > /sys/class/remoteproc/remoteproc5/firmware
    [ 150.199094] k3-dsp-rproc 4d80800000.dsp: can't change firmware while running
    -sh: echo: write error: Device or resource busy
    root@tda4vm-sk:/opt/edgeai-gst-apps# echo stop > /sys/class/remoteproc/remoteproc5/state
    -sh: echo: write error: Invalid argument
    root@tda4vm-sk:/opt/edgeai-gst-apps# echo detach > /sys/class/remoteproc/remoteproc5/state
    [ 166.407316] remoteproc remoteproc5: detached remote processor 4d80800000.dsp
    root@tda4vm-sk:/opt/edgeai-gst-apps# echo j7-c66_0-fw > /sys/class/remoteproc/remoteproc5/firmware
    [ 171.255029] k3-dsp-rproc 4d80800000.dsp: can't change firmware while running
    -sh: echo: write error: Device or resource busy

      无法识别回波停止、但 DSP 可以分离、分离固件无法更新后、因为 DSP 已经在运行?

     了解 Remoteproc 驱动程序、更改固件的唯一方法是当状态为离线(回波停止)时

    但回波停止不会将状态切换为脱机并保持连接状态:  

    root@tda4vm-sk:/opt/edgeai-gst-apps# echo stop > /sys/class/remoteproc/remoteproc5/state                                                        
    root@tda4vm-sk:/opt/edgeai-gst-apps# cat /sys/class/remoteproc/remoteproc5/state                                                                
    attached

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

    您好、

    我目前正在内部检查、并将在一天内回复您。

    此致、
    Sivadeep

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

    您好、

    由于您正在使用  edgeAI SDK(该 SDK 具有一个可与 edgeAI 固件配合使用的自定义 DT)。 设备树不能与回显测试固件配合使用。 因此、您 无法 在 U-Boot 中应用 edgeAI dtbo、然后尝试引导+测试 IPC。

    您还可以使用存储库中提供的最新版本。

    此致、

    Sivadeep

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

    谢谢你。

    主要问题是从 Linux 用户空间停止 DSP。 我没有进入固件测试阶段。

    我尝试使用 Linux 映像 11_00_00_08、结果相同。  

    root@tda4vm-sk:/opt/edgeai-gst-apps echo stop >/sys/class/remoteproc/remoteproc9/state
    -sh:echo:写入错误:参数无效

    这是仅 IPC 模式、 v11_00_00 映像中是否提供 Remoteproc?

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

    您好、

    若要从内核用户空间启动或停止 remoteproc、请  通过将“dorprocboot"变量“变量设置为 0 来修改 uEnv.txt 文件。

    要识别与固件关联的 Remoteproc、请使用以下命令:

    • 请输入/sys/class/remoteproc/remoteproc */名称

    如果您想专门测试“ipc echo test“固件、 请 从 uEnv.txt 中删除/注释整个“name_overlays"变量“变量。 无需将其设置为任何 dtbo(默认 DT 配置支持 IPC Echo 测试 FW)。

    请按照以下步骤运行 IPC 回波测试:  

     

    是否可以删除“name_overlays= “line from uEnv.txt and boot?

    如果这不起作用、最好提供完整的引导日志。


    此致、

    Ben Eapen Thomas

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

    您好、

    对于 Edge AI 固件,不"需要更改“name_overlays “。 仅在与构建的固件二进制文件相对应的 Remoteproc 上使用 echo start 和 stop 命令。 如果问题仍然存在、请运行以下命令:

    • dmesg | grep remoteproc

    并共享日志。

    此致、

    Ben Eapen Thomas

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

    您好、

    我们将无法使用回波启动和停止命令运行 freertos_test_task_switch、因为 freertos_test_task_switch 是在单个内核上运行的独立代码(无正常关断功能)。 它不包括任何过程间通信(如 IPC) 。 FREERTOS_TEST_TASK_SWITCH 源代码中不存在 Remoteproc API。 也没有 RPMsg 参与。 它没有 RPMsg 服务、因此我们无法使用开始和停止控制。 无法使用这些回波启动和停止命令 、因为固件不提供 Remoteproc 控制接口。

    此致、
    Ben Eapen Thomas

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

    我已经测试了所有以下编译的固件,但相同–22 EINVAL 错误.

    -rw-r--r-- 1 root root 3363408 Mar  6 04:18 GTC_Timer_TestApp_freertos_c66xdsp_1_release.xe66                                                                        
    -rw-r--r-- 1 root root 3672788 Mar  6 04:15 UART_TestApp_freertos_c66xdsp_1_release.xe66                                                                             
    -rw-r--r-- 1 root root 3385308 Mar  5 21:04 freertos_test_task_switch_c66xdsp_1_release.xe66                                                                         
    -rw-r--r-- 1 root root 3471800 Mar  5 16:59 freertos_test_ut_c66xdsp_1_release.xe66                                                                                  
    -rw-r--r-- 1 root root 3502820 Mar  6 04:19 i2c_eeprom_testApp_freertos_c66xdsp_1_release.xe66                                                                       
    -rw-r--r-- 1 root root 3708364 Mar  6 04:13 ipc_perf_test_freertos_c66xdsp_1_release.xe66                                                                            
    -rw-r--r-- 1 root root 3744860 Mar  5 17:27 ipc_rtos_echo_test_freertos_c66xdsp_1_release.xe66                                                                       
    -rw-r--r-- 1 root root 3369316 Mar  6 04:21 sciclient_rtos_app_freertos_c66xdsp_1_release.xe66 

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

    您好、

    th freertos_test_task_switch_c66xdsp_1_release.xe66 固件是一个独立的测试应用程序。 因此这不起作用。 当出现平稳关断时、有适当的序列来关闭内核、然后再次启动内核、因此可执行文件必须与该功能兼容。  [/报价]

    正如 Sivadeep 所述、 freertos_test_task_switch_c66xdsp_1_release.xe66 固件无法按原样使用、因为该固件设计为独立测试应用程序。 对于涉及正常关闭的情况、有一个定义的序列来正确关闭和重新启动内核。 因此、可执行文件必须与此序列兼容、以确保功能正确。

    此致、

    Betsy Varughese.

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

    正如我所说的,我已经测试了另外 7 个,同样的结果。 我不确定我明白为什么你坚持在  freertos_test_task_switch 中,其他的呢?

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

    您好、
    您能否确认您为固件执行的步骤是否基于 Sivadeep 所述的 IPC、并分享您执行的确切步骤。 我在电路板上测试了 IPC 回波测试、确保工作正常。 我们将使用其余固件重现问题并在一天内回复您。  
    此致、
    Ben Eapen Thomas