2021-09-08 02:47 PM
Hello,
I have a question regarding the external interrupt on a GPIO input pint which is triggered each falling edge (EXTI)
According to the CubeMX autogenerated code, it looks straight forward. I am using a discovery board with pin PE3 which is configured as a simple input with interrupt capability (each falling edge). I took a jumper for the 3,3V power supply in order to simulate edges on the input pin by placing and removing it. I don't see any activities on the EXT3 line interrupt handler.
Do I miss here something or do I use an old version of CubeMX? I read some issues regarding the LL_Init with the EXTI.
I was quite careful to enable all checksbocks in the NVIC/GPIO on the CubeMX. But it doesn't seem to work. Even when I play a with the pulldown configuration. No effect at all.
GPIO_InitTypeDef GPIO_InitStruct = {0};
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOE_CLK_ENABLE();
/*Configure GPIO pin : PE3 */
GPIO_InitStruct.Pin = GPIO_PIN_3;
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
/* EXTI3_IRQn interrupt configuration */
HAL_NVIC_SetPriority(EXTI3_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
I also tried different pins which are available on the header but it doens't work on any pin.
Are the examples not completed?
I see further functions for the EXTI interface but for some reason it is not used inside the autogenerated code:
HAL_EXTI_Dx_EventInputConfig(EXTI_LINEx , EXTI_MODE_IT, ENABLE);
HAL_EXTI_EdgeConfig(EXTI_LINEx, EXTI_RISING_EDGE);
What do I need to do?
2021-09-08 07:57 PM
> Are the examples not completed?
Which examples? You've created (or generated) a new project.
Example projects are in the Cube library directory; you can import them using CubeIDE.
Note that STM32H745 is dual core. Which core do you want to handle this interrupt?
2021-09-08 10:27 PM
Hello Pavel,
i tried it on both cores but always assuming that the initaliaztion and its usage is performed by only one core. Either on the CM7 or the CM4 is not running
I created a new project based on CubeMx. There re also several tutorials for different families which use the EXTI and the approach seems to be quite similar apart from the fact that we have here a dual core.
I also compared the autogenerated code with the examples which are in the repo. But I don't see different changes. Only HAL_EXTI_Dx_EventInputConfig(EXTI_LINEx , EXTI_MODE_IT, ENABLE) to inform the second core. But I want to use the EXTI only for one core.
Is it because of old version of CubeMX code generation?
2021-09-08 11:05 PM
Hi,
The problem is maybe your hardware. Try putting pull-up or pull-down resistor. Maybe your pin is floating.
Best Regards.
2021-09-09 03:25 AM
Hello,
thanks for your feedback. Are you refering to an external pulldown resistor which is attached to the corresponding input pin or do you mean to enable the internal pulldown mode of the input pin. I already tried the last approach. Unfortunately I was not successful.
2021-09-09 03:36 AM
I am referring to the first option. Make sure you have a proper external pull-up or pull-down circutry. I used to have problems related to external pulldowns when it comes to EXTI line interrupts. Have a nice day.
Best regards.