Skip to main content
SWenn.1
Senior III
March 14, 2022
Solved

STM32L476RG EXT IRQ not working....

  • March 14, 2022
  • 7 replies
  • 1341 views

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;
}

This topic has been closed for replies.
Best answer by SWenn.1

Thanks all....

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

7 replies

TDK
March 14, 2022

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
SWenn.1Author
Senior III
March 14, 2022

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
Super User
March 14, 2022

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

waclawek.jan
Super User
March 14, 2022

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

JW

SWenn.1
SWenn.1Author
Senior III
March 14, 2022

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
SWenn.1AuthorBest answer
Senior III
March 14, 2022

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
March 14, 2022

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""."