<!--
************************************** WARNING **********************…****************
The ciarcom bot parses this header automatically. Any deviation from the
template may cause the bot to automatically correct this header or may result in a
warning message, requesting updates.
Please ensure all sections of the template below are filled in and no changes
are made to the template format. Only bugs should be raised here as issues.
Questions or enhancements should instead be raised on our forums:
https://forums.mbed.com/ .
*************************************************************************************
-->
### Description of defect
<!--
Add detailed description of what you are reporting.
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html
-->
When using 3 or more `InterruptIn` objects, one callback is never called - which one? that depends on the init order.
When using 2 objects everything is fine. I use this for detecting multiple button presses, please see the example below
```cpp
// callback on PB_2 never called
InterruptIn button[3] = {
{PB_2, PullUp},
{PC_5, PullUp},
{PD_2, PullUp},
};
// callback on PB_2 never called
InterruptIn button[3] = {
{PC_5, PullUp},
{PB_2, PullUp},
{PD_2, PullUp},
};
// callback on PB_2 never called
InterruptIn button[3] = {
{PB_2, PullUp},
{PD_2, PullUp},
{PC_5, PullUp},
};
// callback on PD_2 never called
InterruptIn button[3] = {
{PC_5, PullUp},
{PD_2, PullUp},
{PB_2, PullUp},
};
// callback on PD_2 never called
InterruptIn button[3] = {
{PD_2, PullUp},
{PB_2, PullUp},
{PC_5, PullUp},
};
// callback on PD_2 never called
InterruptIn button[3] = {
{PD_2, PullUp},
{PC_5, PullUp},
{PB_2, PullUp},
};
```
#### Target(s) affected by this defect ?
STM32G474
#### Toolchain(s) (name and version) displaying this defect ?
GCC-ARM
#### What version of Mbed-os are you using (tag or sha) ?
<!--
For a released version please provide the release tag (this can be found as per the instructions below)
mbed-os version can be found in /platform/mbed_version.h. The tag can be reconstructed as follows:
mbed-os-MBED_MAJOR_VERSION.MBED_MINOR_VERSION.MBED_PATCH_VERSION
Master branch is indicated by 'mbed-os-99.99.99
For an issue found on Master please provide the sha being used.
-->
aeaac0e70c76fbc5b753ee8c836e369edf1a7fb4
#### What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
mbed-cli
#### How is this defect reproduced ?
Fo simplicity I used a `printf` in ISR which will give following error: `Error Message: Error - writing to a file in an ISR or critical section`. This way you can easilly see that the callback was called.
<!--
For connectivity issues it is recommended to enable mbed trace and attach the traces
generated by the logger to the issue.
-->
`mbed_app.json`
```json
{
"target_overrides": {
"*": {
"mbed-trace.enable": true,
"platform.error-all-threads-info": true,
"platform.error-filename-capture-enabled": true,
"platform.fatal-error-auto-reboot-enabled": true,
"platform.stdio-convert-newlines": true,
"platform.stdio-baud-rate": 115200,
"platform.callback-nontrivial": true,
"drivers.uart-serial-rxbuf-size": 2048,
"drivers.uart-serial-txbuf-size": 256,
"target.printf_lib": "std"
},
"NUCLEO_G474RE": {
"target.stdio_uart_tx": "PB_3",
"target.stdio_uart_rx": "PB_4",
"target.clock_source": "USE_PLL_HSE_XTAL"
}
}
}
```
```cpp
#include "mbed.h"
InterruptIn button[3] = {
{PC_5, PullUp},
{PB_2, PullUp},
{PD_2, PullUp},
};
void test() {
printf("test\n");
}
int main() {
printf("start\n");
for (int i = 0; i < 3; i++) {
button[i].fall(test);
}
while (1) {
ThisThread::sleep_for(1s);
}
return 0;
}
```