Deepak
Deepak

Reputation: 1

Interrupt(EXTI) not getting triggered on STM32MP157A when GPIO pins on other ports are enabled

I am using a custom hardware based on STM32MP157AAAx. I have configured PA12 pin as an input interrupt pin, configured to trigger for falling edge. Whenever the pin level becomes low, the interrupt should be triggered. Additionally, I am using the pins PD12, PE12, PG12, etc as normal GPIO in/out pins, that are exported using GPIO APIs. Both the interrupt and the GPIO pins serve important functions in the application. However, whenever these GPIO pins are enabled in the application, the aforementioned interrupt does not get triggered. Conversely, when these pins are disabled (not using GPIO export ), the interrupt gets triggered. Can someone help me identify the issue?

Upvotes: 0

Views: 221

Answers (1)

Msk
Msk

Reputation: 11

STM32 can only manage 1 interrupt per number (example : GPI0A 12, or GPIOB 12 or GPIOC 12, ...) are you sure you've configured PD12, PE12, PG12 as GPIO_MODE_INPUT or GPIO_MODE_OUTPUT_PP/GPIO_MODE_OUTPUT_OD mode ?

GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);

VS

GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
HAL_NVIC_SetPriority(EXTI4_IRQn, 5, 5);
HAL_NVIC_EnableIRQ(EXTI4_IRQn);

If you want, you can also check the SYSCFG_EXTICR4 register in debug mode to see which one is configure as interrupt.

Upvotes: 0

Related Questions