关于TC389芯片0xaf40 2208配置的作用

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ytx
Level 2
Level 2
10 sign-ins 5 questions asked 10 replies posted

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

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

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

(*((volatile uint32 *)(0xaf40 2818)))
 
配置为0的时候,初始化正常,可以帮忙解释下原因吗?
0 Likes
1 Solution
Jeremy_Z
Moderator
Moderator
Moderator
1000 replies posted 250 sign-ins 100 likes received

Hi @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 */
    }
}

 

View solution in original post

0 Likes
7 Replies
Jeremy_Z
Moderator
Moderator
Moderator
1000 replies posted 250 sign-ins 100 likes received

Hi @ytx ,

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

Jeremy_Z_0-1704870205649.png

BR,

Jeremy

0 Likes
ytx
Level 2
Level 2
10 sign-ins 5 questions asked 10 replies posted

ytx_0-1704870656492.jpeg

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

0 Likes
Jeremy_Z
Moderator
Moderator
Moderator
1000 replies posted 250 sign-ins 100 likes received

Hi @ytx ,

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

BR,

Jeremy

0 Likes
ytx
Level 2
Level 2
10 sign-ins 5 questions asked 10 replies posted

1. 使用memtool 4.9烧录hex

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

1.bmp

0 Likes
ytx
Level 2
Level 2
10 sign-ins 5 questions asked 10 replies posted

1. 烧录图中的hex文件

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

0 Likes
Jeremy_Z
Moderator
Moderator
Moderator
1000 replies posted 250 sign-ins 100 likes received

Hi @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 */
    }
}

 

0 Likes