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.

5 REPLIES 5
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: please disregard this reply. I figured out how to properly format the ISR code in the first reply.

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.

Hi @STTwo-32,

When I said "I figured out how to fix the code in the initial reply.", I meant it as "I figured out how to format the code properly in the initial reply". When I initially pasted my code, it formatted incorrectly and I could not figure out how to edit the post and fix it. Therefore, I responded a second time with the properly formatted code.

Then, I figured out how to edit the first reply and properly format the code, so I did that, but I cannot delete posts. So I edited the second reply to indicate I correctly formatted the initial reply. I see now how that could be confusing. I will update the second reply to clarify my meaning.

Apologies for the confusion, but I don't have a resolution and am still waiting for help on this issue. Do you have any ideas why the value of "itsource" is always zero? Or why breaking in the ISR and then continuing causes the program to get trapped in the ISR?

Could you please share a reduced project to be able to reproduce the issue. With a good description to the behavior.

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.