Hi,
I am facing a tough issue, and have been working on it for a week. But issue not solved yet. so come here for some help.
I am using s32k148, and MCAL (S32K14X_MCAL4_3_RTM_HF2_1_0_1). The issue is when i call function Mcu_SetMode() to enter VLPS, system will reset, with the reset reason SACKERR.
I have call Os_DisableInterruptSource()(Autosar interface) to disable all the interrupt source but except the PTE5 interrupt which is connected to Rx pin of CAN0.
Reset is occured after execute EXCUTE_WAIT.
Thank you, Daniel.
Yes, you are great. When I disable the CAN module, no reset happens.
But after that, I have another problem.
MCU can't be waked up by a external interrupt, which is PORTE, pin 5.
Before enter VLPS, I enable the interrupt.
When in debugger mode, I checked the PCR register, as below, the ISF is set.
My question is, why didn't enter the ISR and wake up the MCU?
Thank you in advance.
Have you tested the interrupt in the RUN mode?
Does it work?
Do you use Sleep-Now or Sleep-On-Exit mode?
Because in the Sleep-on-exit mode, the MCU goes back to VLPS immediately once the ISR is complete.
So you might not notice the ISR was executed.
BR, Daniel
Yes, it works in RUN mode.
We don't use the sleep on exit mode. as below:
A strange phenomenon is when in debugger mode, after the external interrupt occurs, MCU didn't enter ISR. But if i pause the debug session , MCU enters the ISR.
Hi,
It looks like an issue of the tool not the MCU.
Please try running the MCU stand-alone without the debugger.
I mean, disconnect the debugger, power cycle the MCU and toggle a GPIO (for example) from the ISR.
Also, you can output BUS_CLK on a CLKOUT pin so that you can see when the MCU is VLPS and when it is running.
BR, Daniel
Hi Daniel,
Maybe I know the reason.
After below modification, all is normal.
Before the code EXECUTE_WAIT, SW call DisableAllInterrupts(). So I think we should use the corresponding call function EnableAllInterrupt(). If so, then we should modify the MCAL code. I don't know whether ok or not?
Hi,
In the newest MCAL4.2 1.0.4 release, the EXECUTE_WAIT macro contains only the WFI instruction.
Both SuspendAllInterrupts() and ResumeAllInterrupts() have been removed and you can removed it as well.
But anyway, the interrupts must not be disabled/masked (PRIMASK) at the time the WFI instruction is executed, you need to enable them.
Regards,
Daniel
Hi Daniel,
I have tried your suggestion.
I disconnect the debugger, power off the board and power on again. when MCU enters to VLPS, trigger an interrupt, but no changes on the GPIO. Besides, the current I measured doesn't change.
I have output the BUS_CLK to the CLKOUT pin. At run mode, the frequency is 2.5MHZ. When enters to VLPS, the CLKOUT is a high level.
So, I think the MCU is not able to be waked up.