2024-04-20 01:55 PM - last edited on 2024-04-21 12:51 AM by STOne-32
Hi All
I'm new to STM32 and I'm exploring it a little bit. I think I've found an issue in the HAL
in configuration Line is referred to the external interrupt line to be connected.
it is configured in the BSP with (void)HAL_EXTI_GetHandle(&hpb_exti[Button], BUTTON_EXTI_LINE[Button]);
where static const uint32_t BUTTON_EXTI_LINE[BUTTONn] = {BUTTON_USER_EXTI_LINE}; and BUTTON_USER_EXTI_LINE is 0x2000;
the problem is in the usage of Line (in all the stm32c0xx_hal_exti.c file!)
linepos is almost always 0 since EXTI_PIN_MASK is 1 and this is wrong. Removing the & all seems to work properly.
Since it one of the first test that I'm doing with the ST IDE and HAL might be I'm doing something wrong :D
2024-04-22 08:13 AM
Hello @STDoom ,
First of all, welcome in the ST community.
Is it possible to send you code ? Because I tried to have an EXTI interrupt with the BUTTON_USER and I'm facing no issue and it is working fine.
Best regards,
Simon
2024-04-22 08:31 AM
Hi
I've just created the example for the demoboard NUCLEO- STM32C0.
If it might help later I'll copy here the project but I think was this one (https://wiki.st.com/stm32mcu/wiki/Getting_started_with_EXTI)
2024-04-22 10:07 AM
2024-04-23 07:46 AM
Hello @STDoom ,
I confirmed your issue and I have submitted an internal ticket addressing your request to the dev team.
Internal ticket number: 179773 (This is an internal tracking number and is not accessible or usable by customers).
Your workaround is working. Thanks for your contribution.
Best regards,
Simon
2024-05-27 02:43 AM
Hello @STDoom ,
To fix the issue in the bsp header file "stm32c0xx_nucleo.h" line 191 you need to replace this code:
#define BUTTON_USER_EXTI_LINE GPIO_PIN_13
by this code:
#define BUTTON_USER_EXTI_LINE EXTI_LINE_13
This will be implemented for the Cube FW revision.
Best regards,
Simon
2024-10-30 10:34 AM
In this same example, now when code is generated for Nucleo board C031C06, STM32CubeIDE generates this code in the file stm32c0xx_it.c:
HAL_EXTI_IRQHandler(&H_EXTI_13);
but when try to compile, it says:
../Core/Src/stm32c0xx_it.c:151:24: error: 'H_EXTI_13' undeclared (first use in this function) 151 | HAL_EXTI_IRQHandler(&H_EXTI_13);
Making it unusable. Is there a way to solve it?