At present, s32K148 enters VLPS mode from RUN mode, and the test circuit board current changes from 120mA to 9mA. It feels that the circuit board has entered VLPS mode, and the WFI command is executed. During the simulation, the following WFI command is not executed.
Then, I configured the Icu module and added the wake source and Sleep mode of Icu and EcuM in davinci Config software. The INTERRUPTION of THE Icu was working, but the Icu pin was triggered externally after Sleep, but the test current did not respond
The following figure shows the register values when entering VLPS
Now I don't know how to wake up MCU. I hope experienced experts can help me!
Hello @ananan ,
Could you please check if Icu pin was triggered externally after Sleep, then is the ICU interrupt handler called.
Best regards,
Hung
In VLPS mode, THE Icu interrupt cannot be triggered because I called serial port print in the Icu callback function, but in RUN mode, the Icu interrupt is working and when the Icu interrupt is triggered, the callback function can be called
Hello @ananan ,
As I understand, the Icu interrupt handler cannot be called if your application is in VLPS mode. Could you please confirm. Could you please also share if you are using OS in your application. If yes, could you please share the Priority of the Icu interrupt handler and also share the value of BASEPRI in in VLPS mode
Best regards,
Hung
I used freertos system, icu priority is 2, freertos boundary function priority is 7, as shown in the picture below, is you said "the value of BASEPRI in VLPS mode" is the freertos boundary function priority?
Hello @ananan ,
Could you please run to the WFI then check the basepri(above picture) value
Best regards,
Hung
all the pins are configed to the input mode.
the basepri value is above picture.
I tested the current of MCU is 8.3mA, and the supply voltage of MCU is 3.3V. I felt that MCU did not enter VLPS mode, but the MCU entered sleep mode according to the value of the register. How to explain this phenomenon?
Hello @ananan ,
Does you mean that the current is so high. If yes, we can reduce the current by disable all unused peripherals.
Best regards,
Hung
But the problem of wakeup is still unresolved
Hello @ananan ,
We can have a call to check it together. Could you please share your email and also suggest the time.
Best regards,
Hung
The program cannot enter Icu_Ipw_SetSleepMode, which means Icu cannot enter sleep mode. What is the cause of this
Hello @ananan ,
The Icu_SetMode just set all channel which does not use for wakeup to sleep mode. So with the channel which use for wakeup, the Icu_SetMode will not set it, this is normal behavior.
Could you please check if:
- When the MCU is in run mode, can your application can run to the ICU interrupt handler.
- When the MCU is in VLPS, can your application can run to the ICU interrupt handler.
Best regards,
Hung.
When the MCU is in run mode, can your application can run to the ICU interrupt handler.
yes, mcu can run to the ICU interrupt handler.
- When the MCU is in VLPS, can your application can run to the ICU interrupt handler.
No. mcu can not run to the ICU interrupt handler.
Hello @ananan ,
Thank you for your information. Could you please share these below information(when the MCU is in VLPS mode):
- The pin which you are using for wake up.
- Value of PORT_PCR(of the wakeup pin) register.
- Value of NVICISER0, NVICISER1, NVICISER2, NVICISER3
- Push the wakeup pin in the VLPS mode and check the value of NVICISPR0, NVICISPR1, NVICISPR2, NVICISPR3
Best regards,
Hung
The program executes to the breakpoint shown below
- The pin which you are using for wake up.
ask:PTB17
- Value of PORT_PCR(of the wakeup pin) register.
ask:
- Value of NVICISER0, NVICISER1, NVICISER2, NVICISER3
ask:
- Push the wakeup pin in the VLPS mode and check the value of NVICISPR0, NVICISPR1, NVICISPR2, NVICISPR3
ask;
After WFI execution, S32DS simulation program cannot be used, so when wakeup pin is triggered, the value of NVICISPR0, NVICISPR1, NVICISPR2, NVICISPR3 cannot be checked. The value in the figure above is the value at the breakpoint in Figure 1
Hello @ananan ,
Thank you for your information, these information seem doesn't make sense to me because it look like the interrupt handler has been serviced. Because if the Wakeup pin has been pushed, the flag ISF of PCR17 should be set(It just be cleared by ICU_PORT_CI_B_EXT_IRQ_ISR interrupt handler but you said that the ICU_PORT_CI_B_EXT_IRQ_ISR was not called).
Could you please go into VLPS mode then push a break point in the ICU_PORT_CI_B_EXT_IRQ_ISR and check if the ICU_PORT_CI_B_EXT_IRQ_ISR is called after the wakeup pin(PTB17 is pushed and released). If not, at least we can see the flag ISF of PORTB_PCR17 is set and also the pending interrupt of the PORTB in the NVICISPR1.
Best regards,
Hung
I have just found a new phenomenon, when my program is executed to the position above, when I step over debugging, the program can still execute the code down, indicating that THE MCU still does not sleep, whether the reason why it cannot wake up is because there is no sleep. But the register configuration at this breakpoint is all right. Why is that
Hello @ananan
Could you please just set a breakpoint right behind the EXECUTE_WAIT() and then run(click to play button) and check if the program can hit this breakpoint.
- If yes, the program cannot go into VLPS mode.
- If not, the program is already in the VLPS mode. After that if you hit the pause button, it will be count as a wakeup signal in VLPS mode and the MCU will wakeup. Then you will be able to step over debugging.
Best regards,
Hung
yes,
if this what can I do?