RT1170 Wakeup problem

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

RT1170 Wakeup problem

598 Views
dskim2
Contributor IV

Hi

I'm using RT1170 to do a sleep/wake up test, but after repeating the test about 100 times, there are cases where the wake up doesn't work.

I used gpio 13 pin 0 as the wake up pin.

I applied it as in the source below.

 

1. define

#define IO_WKAEUP_PIN 0U //INPUT_PIN[WAKEUP_GPIO]

#define IO_WKAEUP_GPIO_PORT GPIO13 //INPUT_PORT[WAKEUP_GPIO]

#define BOARD_USER_BUTTON_IRQ GPIO13_Combined_0_31_IRQn

2. sleep

void APP_SetWakeupPinConfig(void)

{

GPIO_ClearPinsInterruptFlags(INPUT_PORT[WAKEUP_GPIO], 1U << INPUT_PIN[WAKEUP_GPIO]);

/* Enable GPIO pin interrupt */

GPIO_EnableInterrupts(INPUT_PORT[WAKEUP_GPIO], 1U << INPUT_PIN[WAKEUP_GPIO]);

NVIC_ClearPendingIRQ(BOARD_USER_BUTTON_IRQ);

/* Enable the Interrupt */

EnableIRQ(BOARD_USER_BUTTON_IRQ);

/* Mask all interrupt first */

GPC_DisableAllWakeupSource(GPC_CPU_MODE_CTRL);

/* Enable GPC interrupt */

GPC_EnableWakeupSource(BOARD_USER_BUTTON_IRQ);

}

void PowerStopMode()

{

APP_SetWakeupPinConfig();

// SNVS->LPCR |= SNVS_LPCR_TOP_MASK; // sleep mode sw7 버튼 클릭시 Wake Up 됨.

GPC_STBY_CTRL->STBY_MISC |= GPC_STBY_CTRL_STBY_MISC_FORCE_CPU1_STBY_MASK;

ChipInitConfig();

 

GPC_DisableAllWakeupSource(GPC_CPU_MODE_CTRL);

GPC_EnableWakeupSource(GPIO13_Combined_0_31_IRQn); //wakeup pin

 

//PowerModeTransition(3, 10, 10, 1, 1);

CpuModeTransition(2, 1);

}

 

3. intterupt

void BOARD_USER_BUTTON_IRQ_HANDLER(void)

{

/* clear the interrupt status */

uint32_t Interrupt_Flags = GPIO_PortGetInterruptFlags(INPUT_PORT[BUTTON_BOOT]) & INPUT_PORT[BUTTON_BOOT]->IMR;

if(Interrupt_Flags & (1U << INPUT_PIN[BUTTON_BOOT]))

{

GPIO_PortClearInterruptFlags(INPUT_PORT[BUTTON_BOOT], 1U << INPUT_PIN[BUTTON_BOOT]);

 

if(!InputPortGetState(BUTTON_BOOT)) printf("\r\n BOOT down" );

else printf("\r\n BOOT Up" );

}

Interrupt_Flags = GPIO_PortGetInterruptFlags(INPUT_PORT[WAKEUP_GPIO]) & INPUT_PORT[WAKEUP_GPIO]->IMR;

if(Interrupt_Flags & (1U << INPUT_PIN[WAKEUP_GPIO]))

{

GPIO_PortClearInterruptFlags(INPUT_PORT[WAKEUP_GPIO], 1U << INPUT_PIN[WAKEUP_GPIO]);

// GPC_DisableWakeupSource(BOARD_USER_BUTTON_IRQ);

gSetWakeUp = 1;

}

SDK_ISR_EXIT_BARRIER;

}

 

Best Regards

0 Kudos
Reply
11 Replies

377 Views
dskim2
Contributor IV

When booting, I call the BOARD_BootClockRun function in the attached clock_config.c file, and before Sleep, I call the ChipinitConfig function in the lpm.c file.

Could this be the problem? If so, how should I fix it?

0 Kudos
Reply

549 Views
dskim2
Contributor IV

The phenomenon occurs randomly within 100 times.

The analysis results show that an interrupt occurs when waking up, but the main loop does not run.

0 Kudos
Reply

538 Views
dskim2
Contributor IV

Another symptom is that serial communication with UART6 and UART10 is not working after waking up. Could this be the cause?

0 Kudos
Reply

491 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @dskim2 ,

Thanks for your patience!

I invited an internal expert to look at the code snippets you provided and there is nothing wrong with them. The issue about the UART failing after wakeup is also strange, it shouldn't be related to low power consumption.

Are you able to reproduce this on NXP's EVK? A minimal project that can be reproduced on the EVK should advance the issue addressing.

Best regards,
Gavin

0 Kudos
Reply

565 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @dskim2 ,

Thanks for your interest in NXP MIMXRT series!

I will work with you to resolve this issue. For now I have taken a brief look at your code and do not see a problem. I would like to ask if the unsuccessful wakeup after about 100 times that you mentioned is a always manifestation? Also, have you tested the examples in the SDK?

I will submit it to an internal expert for review. Thanks in advance!

Best regards,
Gavin

0 Kudos
Reply

564 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

PS.

Also, I'm not sure why you are judging two interrupts in the interrupt function, BUTTON_BOOT is what? Suggest you try it: 

 

void BOARD_USER_BUTTON_IRQ_HANDLER(void) {
    if ((1U << IO_WKAEUP_PIN) & GPIO_GetPinsInterruptFlags(IO_WKAEUP_GPIO_PORT)) {
        GPIO_DisableInterrupts(IO_WKAEUP_GPIO_PORT, 1U << IO_WKAEUP_PIN);
        GPIO_ClearPinsInterruptFlags(IO_WKAEUP_GPIO_PORT, 1U << IO_WKAEUP_PIN);
        GPC_DisableWakeupSource(BOARD_USER_BUTTON_IRQ);
        gSetWakeUp = 1;
    }
    SDK_ISR_EXIT_BARRIER;
}

 

The wakeup source and interrupt is then re-enabled in the main function after wakeup.

0 Kudos
Reply

462 Views
dskim2
Contributor IV

Is there any solution for the above issue?
I tested it by modifying it as below, but the problem is still not solved.

I reset it by calling the NVIC_SystemReset function when a wake up interrupt occurs.

In this case, a problem occurred after repeating it about 700 times.

Please refer to the source below.
void BOARD_USER_BUTTON_IRQ_HANDLER(void)
{
uint32_t Interrupt_Flags = GPIO_PortGetInterruptFlags(INPUT_PORT[WAKEUP_GPIO]) & INPUT_PORT[WAKEUP_GPIO]->IMR;
if(Interrupt_Flags & (1U << INPUT_PIN[WAKEUP_GPIO]))
{
GPIO_DisableInterrupts(INPUT_PORT[WAKEUP_GPIO], 1U << INPUT_PIN[WAKEUP_GPIO]); GPIO_PortClearInterruptFlags(INPUT_PORT[WAKEUP_GPIO], 1U << INPUT_PIN[WAKEUP_GPIO]);
GPC_DisableWakeupSource(BOARD_USER_BUTTON_IRQ);
gSetWakeUp = 1;

LED_On(BLUE_LED);
NVIC_SystemReset();
}

SDK_ISR_EXIT_BARRIER;
}

0 Kudos
Reply

437 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @dskim2 ,

Thanks for sharing your progress.

But these code snippets alone don't help us to reproduce and localize this occasional issue. Can you test this on EVK or test with the SDK demo? Or provide us with a testable project. We had an internal expert review the code snippets you provided and these are fine. 

Best regards,
Gavin

0 Kudos
Reply

19 Views
dskim2
Contributor IV

Any review results?

My custom board has a wake up pin voltage level of 3.3v, could this be the issue?

0 Kudos
Reply

343 Views
dskim2
Contributor IV

Custom boards perform many functions, so they boot and enter sleep with the following procedure.

1. At booting,

   Execute BOARD_BootClockRun function ( clock_config.c )

2. At sleeping,

    Execute ChipinitConfig function ( lpm.c )
    Enter Stop mode with CpuModeTransition function 

 

I modified it so that the ChipinitConfig function is not called when entering sleep and tested it.
The result was no problem.

However, in this case, the current consumed during sleep was more than doubled.
How can I keep the current consumption low during sleep and avoid problems?

 

 

0 Kudos
Reply

421 Views
dskim2
Contributor IV

The problem occurred on custom board.

The phenomenon is that after the Wake Up interrupt occurs, the MemManage_Handler interrupt occurs, and then the BusFault_Handler interrupt occurs infinitely.

 

I tested it on an EVK board with the SDK sample code.

When testing with EVK board, the board did not wake up when the Wake Up button was pressed quickly ( about 0.5 sec interval ).

EVK Board : MIMXRT1170-EVKB

I used SINGLE_CORE_M7 macro

 

Please refer to the attached project file used for testing.

0 Kudos
Reply