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.

[参考译文] TDA4VL-Q1:TDA4VL-Q1:[SA5][SCICLENT SCISERVER M4 ] Sciclient_pmSetModuleClkFreq ()函数问题

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1301783/tda4vl-q1-tda4vl-q1-sa5-sciclent-sciserver-m4-sciclient_pmsetmoduleclkfreq-function-issue

器件型号:TDA4VL-Q1

您好、TI 专家!

我们的团队发现了一个由 Sciclient_pmSetModuleClkFreq () API 引起的紧急问题,我们在 autosar mcuR5代码中添加了引导序列,就像 demo mcusw_demos/boot_app_mcu_rtos/boot.c 一样。

在我们的自动加载程序项目中,我们把启动任务放在最低优先级,有一些任务,如 CAN、看门狗任务,还有一些重要的任务是较高的优先级。

我们发现,如果我们不打开独木舟,让 CAN 消息运行 ,启动代码运行错误,日志打印显示的 puloading 已满,但在功能之前  Sciclient_pmSetModuleClkFreq、

日志显示加载仅为18%左右(线程 id 0是空闲任务,id 8是引导顺序,can 任务 id 1 )

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Cert @ 0xb8000004 ...BYD_R5F_P1_R100 Date Dec 11 2023 Time 09:45:28 live_count 5
##cpuload## thread id 00, loading 00%
##cpuload## thread id 01, loading 02%
##cpuload## thread id 02, loading 01%
##cpuload## thread id 03, loading 00%
##cpuload## thread id 04, loading 00%
##cpuload## thread id 05, loading 00%
##cpuload## thread id 06, loading 08%
##cpuload## thread id 07, loading 00%
##cpuload## thread id 08, loading 83%
##cpuload## thread id 09, loading 01%
##cpuload## thread id 10, loading 00%
##cpuload## thread id 11, loading 00%
##cpuload## thread id 12, loading 00%
##cpuload## thread id 13, loading 00%
##cpuload## thread id 14, loading 00%
##cpuload## thread id 15, loading 00%
##cpuload## thread id 16, loading 01%
##cpuload## thread id 17, loading 00%
##cpuload## thread id 18, loading 00%
##cpuload## thread id 19, loading 00%
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

为了调试这个问题、我们添加了一些测试代码来测量 MCUR5的 CPU 速度、方法是将代码  

Fullscreen
1
2
3
4
5
Rte_DisableOSInterrupts();
timer1= Mcu_GetTimeElapsed();
timer2 = Mcu_GetTimeElapsed();
Rte_EnableOSInterrupts();
Log_Printf(LOG_MODULE_INFO, " 1 %08x\r\n",timer2-timer1);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

发现在 Sciclient_pmSetModuleClkFreq ()之前测试打印 00000002,在  Sciclient_pmSetModuleClkFreq  ()之后打印00000012,看起来 MCU R5 CPU 频率低到1/10导致我们的其他任务运行错误 CPU 加载已满,无法返回到引导任务,Sciclient_ModuleClkFreq () 在发送 sci 服务器消息后无法返回、这会导致我们的 MCU R5低频率。

如果我们添加该虚幻保护代码以防止其他任务中断该序列、则不会发生此问题、但这需要很长时间才能导致我们的其他任务出现运行错误、

Rte_Disable Interrupts ();
Sciclient_pmSetModuleClkFreq (sblSlaveCoreInfoPtr->tici_dev_id
                     sblSlaveCoreInfoPtr->tici_clk_id
                     sblSlaveCoreInfoPtr->slave_clk_freq_Hz
                     TISCI_MSG_FLAG_AOP
                     SCICLIENT_SERVICE_WAIT_FOREVER)
 Rte_Enable Interrupts ();
顺便说一下、仅当我们正在引导 C7X 时、该 Sciclient_pmSetModuleClkFreq 才会导致问题。
x 出现错误。请重试或与管理员联系。