EXTI GPIO: cannot assign callback to same pin number on different ports (GD32F130) #105
Labels
Component: GPIO/Interrupts
Regarding the GPIO or interrupts component
needs testing
Additional testing required
It looks as if the gpio_interrupt_enable() function overwrites pre-existing values when called with the same pins on different ports (e.g. PA15, PB15, PC15). gpio_exti_infor[EXTI_NUMS] can only hold an interrupt and callback to a pin number, not the port/pin combination
If you use the program below
The only callback is to function doC(). PA15 and PB15 don't seem to even generate an interrupt (EXTI4_15_IRQHandler() in gpio_interrupt.c). I'm not even sure if this is a GD32 architecture limitation or a limitation in the GD32 Arduino core. The Gigadevice SPL seems to have a call void syscfg_exti_line_config(uint8_t exti_port, uint8_t exti_pin) to configure port and pin. and the EXTISS3 register can contain PA15, PB15 and PC15 (but possibly one at a time, not sure)
Is it possible to attach separate interrupts to identical pin numbers on different ports, or is it a hard GD32 limitation?
Assuming it's a limitation of the GD32F130, should the Arduino core flag the issue somehow to help the user avoid mistakes?
For what is worth, I'm using a Bluepill board with the STM32 replaced by a GD32F130C8, and everything seems to work well (I had to lift pins 35 and 36, connected to VSS and VDD on the STM32, but PF6 and PF7 on the GD32... should probably also disconnect pins 5 and 6 to free up PF0 and PF1 from the 8MHz oscillator, but I simply avoid using PF0 and PF1 for now)
The text was updated successfully, but these errors were encountered: