S32K148 Can not wakeup to RUN mode from VLPS mode config in MCAL EB tresos and davinci software

cancel
Showing results for 
Search instead for 
Did you mean: 

S32K148 Can not wakeup to RUN mode from VLPS mode config in MCAL EB tresos and davinci software

1,243 Views
ananan
Contributor III

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 VLPSananan_1-1637725260830.png

Now I don't know how to wake up MCU. I hope experienced experts can help me!

0 Kudos
36 Replies

848 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @ananan ,

 

Could you please check if Icu pin was triggered externally after Sleep, then is the ICU interrupt handler  called. 

 

Best regards,

Hung

0 Kudos

844 Views
ananan
Contributor III

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

0 Kudos

800 Views
hungnguyenphi
NXP Employee
NXP Employee

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

0 Kudos

796 Views
ananan
Contributor III

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?

ananan_0-1638156298300.png

ananan_1-1638156323965.png

 

 

0 Kudos

792 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @ananan ,

 

hungnguyenphi_1-1638156841813.png

Could you please run to the WFI then check the basepri(above picture) value

 

 

Best regards,

Hung

0 Kudos

784 Views
ananan
Contributor III

all the pins are configed  to the input mode.

0 Kudos

785 Views
ananan
Contributor III

ananan_0-1638162581695.png

 

0 Kudos

788 Views
ananan
Contributor III

ananan_0-1638162125281.png

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?

ananan_1-1638162449066.png

ananan_2-1638162463639.png

 

 

 

0 Kudos

777 Views
hungnguyenphi
NXP Employee
NXP Employee

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

0 Kudos

774 Views
ananan
Contributor III

But the problem of wakeup is still unresolved

0 Kudos

772 Views
hungnguyenphi
NXP Employee
NXP Employee

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

0 Kudos

744 Views
ananan
Contributor III

ananan_0-1638233408110.pngananan_1-1638233457976.png

The program cannot enter Icu_Ipw_SetSleepMode, which means Icu cannot enter sleep mode. What is the cause of this

0 Kudos

730 Views
hungnguyenphi
NXP Employee
NXP Employee

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.

0 Kudos

726 Views
ananan
Contributor III

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.

 

0 Kudos

706 Views
hungnguyenphi
NXP Employee
NXP Employee

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

hungnguyenphi_0-1638253210199.png

 

Best regards,

Hung

0 Kudos

703 Views
ananan
Contributor III

The program executes to the breakpoint shown below

ananan_3-1638253911703.png

 

 

- The pin which you are using for wake up.

ask:PTB17

- Value of  PORT_PCR(of the wakeup pin) register.

ask:

ananan_0-1638253602984.png

- Value of NVICISER0, NVICISER1, NVICISER2, NVICISER3

ask:

ananan_1-1638253698932.png

- Push the wakeup pin in the VLPS mode and check the value of NVICISPR0, NVICISPR1, NVICISPR2, NVICISPR3

ask;

ananan_2-1638253838930.png

 

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

0 Kudos

696 Views
hungnguyenphi
NXP Employee
NXP Employee

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

0 Kudos

692 Views
ananan
Contributor III

ananan_0-1638257009711.png

ananan_1-1638257067134.png

 

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

0 Kudos

675 Views
hungnguyenphi
NXP Employee
NXP Employee

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

0 Kudos

671 Views
ananan
Contributor III

yes,

ananan_0-1638258498005.png

 if this what can I do?

0 Kudos