Skip to main content
Associate III
March 21, 2024
Question

Weird behavior when breaking in an interrupt

  • March 21, 2024
  • 5 replies
  • 1646 views

Hello,

I have a NUCLEO-WL55JC1 development board that I am trying to have communicate over subGHz RF.

After configuring the RF module, I am trying to read what interrupts are generated based on different stimuli. To accomplish this, I set a breakpoint in the RF IRQ Handler function so I could read the value of the "itsource" variable. However, I'm seeing unexpected behavior when debugging this program. The interrupt initially triggers when I expect it to, and the program breaks in the interrupt, but the "itsource" variable keeps reading 0 (indicating no interrupt source). After this, it seems like my program gets trapped in the ISR and keeps looping over and over.

Can anyone explain either of these behaviors? I will reply with the source code for my interrupt routine.

This topic has been closed for replies.

5 replies

AJ_1Author
Associate III
March 21, 2024

Here is my IRQ Handler

 

void SUBGHZ_Radio_IRQHandler(void)
{
 /* USER CODE BEGIN SUBGHZ_Radio_IRQn 0 */
 volatile uint8_t tmpisr[2] = {0};
 volatile uint16_t itsource;

 /* Retrieve Interrupts from SUBGHZ Irq Register */
 HAL_SUBGHZ_ExecGetCmd(&hsubghz, RADIO_GET_IRQSTATUS, tmpisr, 2);
 itsource = tmpisr[0];
 itsource = (itsource << 8 ) | tmpisr[1];

 //breakpoint is set here
 __NOP();


 /* Clear SUBGHZ Irq Register */
 HAL_SUBGHZ_ExecSetCmd(&hsubghz, RADIO_CLR_IRQSTATUS, tmpisr, 2);


 /* USER CODE END SUBGHZ_Radio_IRQn 0 */
 /* USER CODE BEGIN SUBGHZ_Radio_IRQn 1 */

 /* USER CODE END SUBGHZ_Radio_IRQn 1 */
}

 

 

AJ_1Author
Associate III
March 21, 2024

*edit: please disregard this reply. I figured out how to properly format the ISR code in the first reply.

STTwo-32
ST Technical Moderator
May 22, 2024

Hello @AJ_1 

Could you please add the fix that you have found to this issue so that our community members can use it. 

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.