cancel
Showing results for 
Search instead for 
Did you mean: 

Weird behavior when breaking in an interrupt

AJ_1
Associate II

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.

2 REPLIES 2
AJ_1
Associate II

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_1
Associate II

*edit: nevermind, I figured out how to fix the code in the initial reply.