Hello, I am facing an issue with Portenta H7 which I cannot seem to solve. Basically I found some combinations of pins that I cannot use whithin the attachInterrupt() method simultaneously. Take this as an example (pins are defined using their port names and an underscore):
If I push this code to my Portenta H7 and power it, then it immediately goes into an error blinking the red led (4x long and 4x short). Does anyone know why this is happening and what I can do to solve it?
Hi @matteolavitnicora. I found some useful information on the subject from one of the developers of the "Arduino Mbed OS Portenta Boards" platform here:
the Giga allows a maximum of 16 interrupts at the same time, and the coexistence is based on STM32 peculiar way of handling them (like, PA_0 will share the interrupt with PB_0 , PC_0 and so on). If you instantiate 2 interrupts on the same line the board will "crash" (report it as invaliud).
To associate pin name and pin number you can use this table ArduinoCore-mbed/variants/GIGA/variant.cpp at main · arduino/ArduinoCore-mbed · GitHub
That is about the GIGA, but should be relevant to the Portenta H7 as well. The Portenta H7 equivalent to the link in that comment is here: