AnsweredAssumed Answered

Configuring SNVS button interrupt at M4

Question asked by Shrinath Wadkar on Feb 19, 2017
Latest reply on Mar 1, 2017 by Carlos_Musich

I am working on custom board with iMX7S. I am trying to configure SNVS button debounce interrupt at M4 to give periodic Interrupt at every 500ms if button is pressed.

 

This is the code snippet:

void PowerButton_Config( uint8_t config_ )
{
       uint32_t temp; //temp. variable to hold read values
       uint32_t newValues; //for applying mask


 newValues = SNVS_LPCR_ON_TIME(PWRBTN_OFF2ON_TIME_500MS ) |     SNVS_LPCR_DEBOUNCE(PWRBTN_DEBOUNCE_TIME_500MS )
| SNVS_LPCR_BTN_PRESS_TIME(PWRBTN_ON2OFF_TIME_DISABLED );

 

temp = SNVS_LPCR_REG( SNVS_BASE_PTR );
temp = temp & 0xFFC0FFFF;
temp = newValues | temp;

SNVS_LPCR_REG (SNVS_BASE_PTR ) = temp;

 

//Button Interrupt Configuration to give interrupt at both edges

SNVS_HPCR_REG( SNVS_BASE_PTR ) &= ~( SNVS_HPCR_BTN_CONFIG_MASK & ( 4 << SNVS_HPCR_BTN_CONFIG_SHIFT ));
SNVS_HPCR_REG( SNVS_BASE_PTR ) |= SNVS_HPCR_BTN_MASK_MASK;
NVIC_SetPriority( BOARD_SNVS_IRQ_NUM, 3 );
NVIC_EnableIRQ( BOARD_SNVS_IRQ_NUM );

}

 

But with this configuration a single interrupt is received but both cores M4 and A7 get hung.

Please help with configuration here.

Outcomes