Dear Sir,
Here is my code to init SWT0 on MPC5748G:
void vfnSwt0InitKey(uint32_t u32TimeoutTicks)
{
if(SWT_0.CR.B.SLK)
{
SWT_0.SR.R = 0xC520;
SWT_0.SR.R = 0xD928;
}
SWT_0.TO.R = u32TimeoutTicks;
SWT_0.CR.R = 0xFF00030B; //Allow all master access, Timeout generate reset, FRZ=1;
SWT_0.CR.B.WEN = 1;
}
The problem is that the SWT0 cannot be enabled by my code.
In the Lauterbach debugger, I can see that the SWT0_CR value is changed by my code. But just the SWT0_CR.WEN bit cannot be set to 1 by my code. I can change this WEN bit by Lauterbach debugger.
And I also tried this on SWT1. My code can config and enable SWT1 correctly.
Do you have any suggestions on this issue?
(I'm using S32DS to create MPC5748G project and compile.)
Regards,
Jason Yang