TC33X : Mapping DCache to RAM creates Store Bus Error

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

cross mob
Ma_sk
Level 1
Level 1
First question asked Welcome!

Hello experts,

I try to map data cache into RAM area using TC33X by following (simplified) sequence:

CPU_DCON0 = 2
MTU_CLC = 0
MTU_MEMMAP |= 1

This works fine after SW flashing and debugger stays connected. Without debugger the SW hangs and even with debugger after first reset the SW gets class 4 SBE after MTU_MEMMAP write access.
Any idea what may be wrong here ?

Thanks in advance for any hints.

0 Likes
1 Solution
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

 

Hi @Ma_sk , As mentioned in the description of bit MEMxMAP in the usermanual: "Caches are considered security-sensitive memories and an automatic auto-initialization (or partial erase) of the associated memory x is triggered on every attempt to toggle the MEMxMAP bit. Only after this initialization has completed will the value read back from this register bit show the updated value."

 

Hence you should wait till the value is reflected in the register and then only proceed further, I tried the following code and it is working for me  you can try the same at your end:

 

    IfxScuWdt_clearCpuEndinit(IfxScuWdt_getCpuWatchdogPassword());
    __mtcr(CPU_DCON0,0x2);
    IfxScuWdt_setCpuEndinit(IfxScuWdt_getCpuWatchdogPassword());

    IfxMtu_enableModule();
    IfxScuWdt_clearSafetyEndinit(IfxScuWdt_getSafetyWatchdogPassword());
    MTU_MEMMAP.B.CPU0_DCMAP = 1;
    while(MTU_MEMMAP.B.CPU0_DCMAP != 1);    //make sure that 1 is reflected here
    IfxScuWdt_setSafetyEndinit(IfxScuWdt_getSafetyWatchdogPassword());

 

View solution in original post

0 Likes
1 Reply
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

 

Hi @Ma_sk , As mentioned in the description of bit MEMxMAP in the usermanual: "Caches are considered security-sensitive memories and an automatic auto-initialization (or partial erase) of the associated memory x is triggered on every attempt to toggle the MEMxMAP bit. Only after this initialization has completed will the value read back from this register bit show the updated value."

 

Hence you should wait till the value is reflected in the register and then only proceed further, I tried the following code and it is working for me  you can try the same at your end:

 

    IfxScuWdt_clearCpuEndinit(IfxScuWdt_getCpuWatchdogPassword());
    __mtcr(CPU_DCON0,0x2);
    IfxScuWdt_setCpuEndinit(IfxScuWdt_getCpuWatchdogPassword());

    IfxMtu_enableModule();
    IfxScuWdt_clearSafetyEndinit(IfxScuWdt_getSafetyWatchdogPassword());
    MTU_MEMMAP.B.CPU0_DCMAP = 1;
    while(MTU_MEMMAP.B.CPU0_DCMAP != 1);    //make sure that 1 is reflected here
    IfxScuWdt_setSafetyEndinit(IfxScuWdt_getSafetyWatchdogPassword());

 

0 Likes