cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476RG EXT IRQ not working....

SWenn.1
Senior III

Hi all...

I am using a nucleo board and CubeMX ....I have an external interrupt which I can see on the logic analyzer. However when setting a breakpoint in code it never goes there??

I am set for rising edge

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
	if (GPIO_Pin == SPI_IRQ_Pin)
		ISR.SPI_WakeUp = T;
}

1 ACCEPTED SOLUTION

Accepted Solutions
SWenn.1
Senior III

Thanks all....

I found the issue as TDK pointed out....on back of nucleo looks like there is no solder jumper for these pins

View solution in original post

7 REPLIES 7
TDK
Guru

What pin? Probably isn't connected to the header by default.

If you feel a post has answered your question, please click "Accept as Solution".
SWenn.1
Senior III

i've tried two PA2 and PB5....on CN10...both are pinned out....neither works....the signal strobing it is a 3V 12ms pulse

KnarfB
Principal III

and the EXTI interrupt is enabled in MX_GPIO_Init? Can you show the code, please.

Or, better, read out and check/post content of relevant GPIO and EXTI registers.

JW

SWenn.1
Senior III

Here is the code for B5 as switch and C1 as LED....I tried A2 also but to no avail....I tried PA0 (which is on CN7, others are on CN10) and it works???

Very strange

static void MX_GPIO_Init(void)
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
 
  /* GPIO Ports Clock Enable */
  __HAL_RCC_GPIOC_CLK_ENABLE();
  __HAL_RCC_GPIOA_CLK_ENABLE();
  __HAL_RCC_GPIOB_CLK_ENABLE();
 
  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, GPIO_PIN_RESET);
 
  /*Configure GPIO pin : PC1 */
  GPIO_InitStruct.Pin = GPIO_PIN_1;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
 
  /*Configure GPIO pin : PB5 */
  GPIO_InitStruct.Pin = GPIO_PIN_5;
  GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
 
  /* EXTI interrupt init*/
  HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
 
}
 
/* USER CODE BEGIN 4 */
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
	HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_1);
}

SWenn.1
Senior III

Thanks all....

I found the issue as TDK pointed out....on back of nucleo looks like there is no solder jumper for these pins

TDK
Guru

Which means they're likely used by something else on the board.

The User Manual will tell you what that is, and the schematic.

If you feel a post has answered your question, please click "Accept as Solution".