stm32duino/Arduino_Core_STM32

Can't set up interrupts on PA15 and PB15 on STM32G030C8T6, only the later one is ever fired

dvhx opened this issue · 1 comments

dvhx commented

When I attach 2 interrupts on pins PD1 and PA9 it works, both handler1 and handler2 are called correctly:

attachInterrupt(digitalPinToInterrupt(PD1), handler1, FALLING);
attachInterrupt(digitalPinToInterrupt(PA9), handler2, FALLING);

But when I use pins PA15 and PB15 only the second one is ever called. For example if I use this:

attachInterrupt(digitalPinToInterrupt(PA15), handler1, FALLING);
attachInterrupt(digitalPinToInterrupt(PB15), handler2, FALLING);

I only see handler2 called. If I switch order and use this:

attachInterrupt(digitalPinToInterrupt(PB15), handler2, FALLING);
attachInterrupt(digitalPinToInterrupt(PA15), handler1, FALLING);

Only handler1 is called. Complete code is in attachment.

To Reproduce

  • pull down PB15 and PA15, only one handler will be called (whichever was set up last).

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.5 LTS
  • Arduino IDE version: 1.8.19
  • STM32 core version: 2.2.0
  • Upload method: SWD
  • MCU: STM32G030C8T6 in LQFP-48 (custom board)

stm32g_problem_with_PA15_PB15_interrupt.ino.txt

This is normal. EXTI is linked to gpio pin number not gpio port. It is the same for all Px15.