I can't get out of VLPS mode. I'm asking for help

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I can't get out of VLPS mode. I'm asking for help

Jump to solution
242 Views
Oido
Contributor I

It is believed to have entered VLPS mode.
The total current flowing into the circuit could be reduced from 6 to 70 mA to the present 11 mA.
Rather than reducing it further, I want to get him out of VLPS mode, but I can't get out of it. I want to connect the switch to PTA0 and make him do WAKE().
I checked the example of S32 and the AN5425 PDF file, but they won't wake up after giving me an interrupt. I'm wasting so much time that I'm asking for help.
Personal PCB and not NXP's practice PCB.

SOSC_init_8 MHz();

SPL_init_160 MHz();

NormalRUNmode_40 MHz();

this function is derived from the NXP example clocks_and_modes.c file, where only the system clock is switched to PLL and is being used at 40 MHz.
SCG->RCCR=SCG_RCCR_SCS(6)

On S32DS, when code is DEBUG and SUSPEND, S32CONSOLE says Interrupt command received.Haltting execution
In the code __asmvolatile ("wfi"); green letters are displayed in this area.

I'm trying so many things but I'm hopeless because it doesn't work.. I'm asking for help..

 

void PORTA_IRQHandler(void) // PORTA 인터럽트
{
if(!(PTA->PDIR & (1<<0)))
{
wake();
}
PORTA->ISFR |= (1<<0);
}
 
void LPIT0_Ch0_IRQHandler(void)
{
if(!((Direction==1 || Direction==2))){ //모터가 동작 중이지 않을 때만
if(!(PTA->PDIR & (1<<13) || PTA->PDIR & (1<<1))){ //스위치에 입력이 없을 경우 변수 증가
Button2++;
if(Button2==15000) //15000기준 15초 지나면 슬립모드 들어가게 하기
{
Button2=0;
sl();
}
}
}
else
{
Button2=0;//스위치 입력을 하게 되면 슬립모드 들어가는 카운터 초기화
}
if(!(PTA->PDIR & (1<<0)))
{
wake();
}
LPIT0->MSR |= LPIT_MSR_TIF0_MASK;
}
 
int main(void)
{
SOSC_init_8MHz();
    SPLL_init_160MHz();
    NormalRUNmode_40MHz();
LPIT_Init(); //저전력 타이머
    BoardInit(); //핀 및 클럭
    NVIC_EnableIRQ(LPIT0_Ch0_IRQn);//저전력 타이머 슬립모드 관련 지어야 할듯 LPIT가 맞나 LPTMR이 맞나..15초 후 슬립모드 가는거면 LPTMR이 나을듯TMR할거면 2.2예제
NVIC_EnableIRQ(FTM1_Ovf_Reload_IRQn); // 오버플로우 인터럽트 활성화
NVIC_EnableIRQ(PORTA_IRQn); //PORTA
NVIC_EnableIRQ(PORTC_IRQn); //PORTC 인터럽트 홀카운트 관련
 
    while(1)
    {
 
}
}

 

I'll only post something related to VLPS. Please read and help. Please

 

 

0 Kudos
1 Solution
229 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Oido,

I have just replied to your other case:

https://community.nxp.com/t5/S32K/How-to-enter-VLPS-SLEEP-mode/m-p/1811621/highlight/false#M31841

 

You really need to do it step by step.

1. Disable all the peripherals that are not used in VLPS.

2. Switch the system clock to SIRC (measure BUS_CLK at CLKOUIT)

3. Disable all the other clock sources

4. Enabled a wakeup interrupt

5. Enter VLPS

 

I would strongly recommended testing the VLPS entry/exit using a new simple project that does not use PLL / Motor control routines / any periperals except a GPIO wakeup interrupt.

I have already linked a few example that provide you with all you need.

 

Once you have such a simple project and still have problems, attach the complete project here so that I can test it.

 

Regards,

Daniel

View solution in original post

0 Kudos
2 Replies
230 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Oido,

I have just replied to your other case:

https://community.nxp.com/t5/S32K/How-to-enter-VLPS-SLEEP-mode/m-p/1811621/highlight/false#M31841

 

You really need to do it step by step.

1. Disable all the peripherals that are not used in VLPS.

2. Switch the system clock to SIRC (measure BUS_CLK at CLKOUIT)

3. Disable all the other clock sources

4. Enabled a wakeup interrupt

5. Enter VLPS

 

I would strongly recommended testing the VLPS entry/exit using a new simple project that does not use PLL / Motor control routines / any periperals except a GPIO wakeup interrupt.

I have already linked a few example that provide you with all you need.

 

Once you have such a simple project and still have problems, attach the complete project here so that I can test it.

 

Regards,

Daniel

0 Kudos
227 Views
Oido
Contributor I

First of all, thank you for your reply. I have tried many times to follow such a procedure, but so far I have failed.

I set SCG->RCCR=SCG_RCCR_SCS(2) to set SIRC
SCG->SPLLCSR=SCG_SPLLCSR_SPLLEN(0);

SCG->FIRCCSR=SCG_FIRCCSR_FIRCEN(0);

SCG->SOSCCSR=SCG_SOSCCSR_SOSCEN(0); and several methods were tried to deactivate the clock, but various errors such as CORE IS RUNNING or STARTUP_S32K1XX were experienced.

Today, as soon as I started on main, I went into vlps mode and connected the switch to PTA0 with the PORTA interrupt to wake him up, but I failed to wake him up again after 15 seconds with lpit.
I could only wake you up asleep at the beginning.
I've experienced that it operates at about 50~60mA in vlps mode when it's a normal mode of 11mA, perhaps because it hasn't disabled all the functions.
But this won't be easy but I think I can solve it later if I disable the devices.
For now, I want to focus on getting into vlps mode and escaping.
However, this is a part that was solved only by SMC, PMC register and PORTA interrupt without touching the part about the clock.

Also this part of the light didn't affect the current in use at all, did I disable this incorrectly??

FTM0->SC &= ~FTM_SC_CLKS_MASK;//FTM끄기
FTM1->SC &= ~FTM_SC_CLKS_MASK;//FTM끄기
CAN0->MCR |= CAN_MCR_MDIS_MASK;//끄기 가능
PCC->PCCn[PCC_FTM0_INDEX] = PCC_PCCn_PCS(0) | PCC_PCCn_CGC(0); 클럭활성화, FTM0 활성화
PCC->PCCn[PCC_FTM1_INDEX] = PCC_PCCn_PCS(0) | PCC_PCCn_CGC(0); 클럭활성화, FTM1 활성화
PCC->PCCn[PCC_ADC0_INDEX] = PCC_PCCn_PCS(0) | PCC_PCCn_CGC(0); ADC0에 출력
ADC0->SC1[0] = ADC_SC1_AIEN(0); ADC OFF 채널4,5 활성화
It refers to FTM, ADC0, etc.
 
I will try harder, but if I fail, I would like to get help by sending you a project file. All I can do for you is thank you so much.
0 Kudos