2019-11-28 02:29 AM
I want to wake my STM32 mcu from stop2 mode using an external interrupt from sx1262 radio.
I configured the gpio pin like this:
/*Configure GPIO pin : RADIO_DIO1_Pin */
GPIO_InitStruct.Pin = RADIO_DIO1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; //orig rising
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(RADIO_DIO1_GPIO_Port, &GPIO_InitStruct);
and the wakeup function is,
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
//#if DESIGN_PROJECT_STAGE1
if (GPIO_Pin == GPIO_PIN_13) {
DEBUG_PRINT("RADIO_DIO1 interrupt triggered (PC13)");
op_mode = op_mode_sm[op_mode][OP_MODE_EVT_WAKEUP];
resume_from_lpm(); // get FreeRTOS running again
}
The goal is that the MCU should receive a signal, do some processing, transmit it and then go to sleep till it receives the next signal. Currently, as soon as MCU goes to sleep right after transmission, it gets woken up by a tx done interrupt. I want only a rx done interrupt from radio to wake my mcu. Can someone help me as to how I should do it? I tried masking interrupts, but din't help.
Thanks