2022-03-14 01:25 PM
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;
}
Solved! Go to Solution.
2022-03-14 03:59 PM
Thanks all....
I found the issue as TDK pointed out....on back of nucleo looks like there is no solder jumper for these pins
2022-03-14 01:58 PM
What pin? Probably isn't connected to the header by default.
2022-03-14 02:27 PM
i've tried two PA2 and PB5....on CN10...both are pinned out....neither works....the signal strobing it is a 3V 12ms pulse
2022-03-14 02:39 PM
and the EXTI interrupt is enabled in MX_GPIO_Init? Can you show the code, please.
2022-03-14 02:43 PM
Or, better, read out and check/post content of relevant GPIO and EXTI registers.
JW
2022-03-14 03:51 PM
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);
}
2022-03-14 03:59 PM
Thanks all....
I found the issue as TDK pointed out....on back of nucleo looks like there is no solder jumper for these pins
2022-03-14 04:32 PM
Which means they're likely used by something else on the board.
The User Manual will tell you what that is, and the schematic.