Tip / ログイン to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Translation_Bot
Community Manager
Community Manager
Community Manager

0xaf40 2208查看手册,写的是HF_PROCONRAM,配置为1的话,冷启动后不初始化RAM,配置为0的话,冷启动后初始化RAM

我们在使用过程中产生了一个不太理解的问题:

配置为1的时候,OS上电后,初始化访问到如下位置会crash(0xaf40 2818 是配置HSM是否初始化的地址)

(*((volatile uint32 *)(0xaf40 2818)))
 
配置为0的时候,初始化正常,可以帮忙解释下原因吗?

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/td-p/673661

0 件の賞賛
1 解決策
Translation_Bot
Community Manager
Community Manager
Community Manager

こんにちは@ytx

我按照你的步骤,并没有复现你的问题,代码如下,还是能打印出结果的。

2024-01-11_14h29_07.png

void core0_main(void)
{
    IfxCpu_enableInterrupts();
    
    /* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
     * Enable the watchdogs and service them periodically if it is required
     */
    IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
    IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
    
    /* Wait for CPU sync event */
    IfxCpu_emitEvent(&g_cpuSyncEvent);
    IfxCpu_waitEvent(&g_cpuSyncEvent, 1);
    
    /* Initialize the Shell Interface and the UART communication */
    initShellInterface();

    Ifx_Console_print("\n Hello World %d\r\n",(int)100);
    Ifx_Console_print("\n PROCONHSMCFG is %x\r\n",(*((volatile uint32 *)(0xaf402818))));
    while(1)
    {
        //runShellInterface(); /* Run the application shell */
    }
}

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/m-p/674737

元の投稿で解決策を見る

0 件の賞賛
7 返答(返信)
Translation_Bot
Community Manager
Community Manager
Community Manager

こんにちは@ytx

HF_PROCONRAM的配置不止0或1, 它包含32 bits,所以我想知道具体的配置是如何,其次(*((volatile uint32 *)(0xaf40 2818)))是读操作吗?最后,你说的Crash是指进入Trap吗?

Jeremy_Z_0-1704870205649.png

ブラジル、

ジェレミー

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/m-p/673748

0 件の賞賛
Translation_Bot
Community Manager
Community Manager
Community Manager

ytx_0-1704870656492.jpeg

配置的值如上时会异常;(*((volatile uint32 *)(0xaf40 2818)))是读操作

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/m-p/673780

0 件の賞賛
Translation_Bot
Community Manager
Community Manager
Community Manager

こんにちは@ytx

你能展示一下,你修改AF402208的步骤,我这边看看能否复现问题。

ブラジル、

ジェレミー

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/m-p/673908

0 件の賞賛
Translation_Bot
Community Manager
Community Manager
Community Manager

1.bmp

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/m-p/673929

0 件の賞賛
Translation_Bot
Community Manager
Community Manager
Community Manager

1. 使用memtool 4.9烧录hex

2. 板子拔开电源,然后插上电源,系统初始化的时候执行如下代码访问0xaf402818地址
# define MEM(address) (*((volatile uint32 *)(address)))
#define DMU_SP_PROCONHSMCFG             0xaf402818
uint32 hsmConfigValue = MEM(DMU_SP_PROCONHSMCFG);
 
我是在这个时候系统就进入异常了

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/m-p/673927

0 件の賞賛
Translation_Bot
Community Manager
Community Manager
Community Manager

1. 烧录图中的hex文件

2. 然后系统断电后重新上电,启动过程中读取0xaf402818地址,读取这一步系统crash了

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/m-p/674499

0 件の賞賛
Translation_Bot
Community Manager
Community Manager
Community Manager

こんにちは@ytx

我按照你的步骤,并没有复现你的问题,代码如下,还是能打印出结果的。

2024-01-11_14h29_07.png

void core0_main(void)
{
    IfxCpu_enableInterrupts();
    
    /* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
     * Enable the watchdogs and service them periodically if it is required
     */
    IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
    IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
    
    /* Wait for CPU sync event */
    IfxCpu_emitEvent(&g_cpuSyncEvent);
    IfxCpu_waitEvent(&g_cpuSyncEvent, 1);
    
    /* Initialize the Shell Interface and the UART communication */
    initShellInterface();

    Ifx_Console_print("\n Hello World %d\r\n",(int)100);
    Ifx_Console_print("\n PROCONHSMCFG is %x\r\n",(*((volatile uint32 *)(0xaf402818))));
    while(1)
    {
        //runShellInterface(); /* Run the application shell */
    }
}

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/%E5%85%B3%E4%BA%8ETC389%E8%8A%AF%E7%89%870xaf40-2208%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BD%9C%E7%94%A8/m-p/674737

0 件の賞賛