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

cross mob
User18773
Level 1
Level 1
Hi everyone,

I have the sample code MTU_MBIST for MTU module testing, which I download from github/aurix_code_example. However, everytime I run the code, it gets stuck at IfxMtu_clearSram(mbistSel);, and never move to next line/breakpoint.
I looked into the clearSram function and found out, the program really get stuck at line *mtuMemtest |= mask; in IfxMtu_enableMbistShell(mbistSel);
Anybody has the same problem or know why this happens??


Attach the code:

void test_MTU_MBIST(IfxMtu_MbistSel mbistSel)
{
uint16 errAddr = 0, result;

IfxPort_setPinHigh(IFXCFG_PORT_GPIO1.port, IFXCFG_PORT_GPIO1.pinIndex);

/* Enable MTU clock */
IfxMtu_enableModule();


// /* Initialize the selected SRAM */
IfxMtu_clearSram(mbistSel);


IfxPort_setPinHigh(IFXCFG_PORT_GPIO2.port, IFXCFG_PORT_GPIO2.pinIndex);

/* Error injection is selected */
```
}

0 Likes
3 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
What is the value of mbistSel when the problem occurs?

Which AURIX variant are you using (TC27x, TC23x, etc.)?
0 Likes
User18773
Level 1
Level 1
UC_wrangler wrote:
What is the value of mbistSel when the problem occurs?

Which AURIX variant are you using (TC27x, TC23x, etc.)?


my board is TC27x
The mtu code is executed in Cpu0, I've tested it with mbisSel= IfxMtu_MbistSel_dma, IfxMtu_MbistSel_cpu0 and IfxMtu_MbistSel_cpu2. But all has this problem
0 Likes
User18773
Level 1
Level 1
hi,

my problem has been solved by clearing the CpuEndinit before enabling the MTU module and clearing SRAM. However, if the code is running in cpu0, then it couldn't clearSram cpu0sdpr or cpu0pspr. I am not quite sure it ought to be like this, or I made mistakes

/* Enable MTU clock */
uint16 password = IfxScuWdt_getCpuWatchdogPassword();
IfxScuWdt_clearCpuEndinit(password);
IfxMtu_enableModule();
/* Clear Sram*/
IfxScuWdt_setCpuEndinit(password);
password = IfxScuWdt_getSafetyWatchdogPassword();
IfxScuWdt_clearSafetyEndinit(password);
IfxMtu_clearSram(cpu1Dspr);
IfxMtu_clearSram(cpu1Pspr);
IfxScuWdt_setSafetyEndinit(password);
0 Likes