Description
Description
- Type: Bug
- Priority: Major
Bug
Target
NUCLEO_F446RE
Toolchain:
GCC_ARM
Toolchain version:
arm-none-eabi-gcc (Arch Repository) 7.1.0
mbed-cli version:
1.2.0
mbed-os sha:
cc7556a (HEAD, tag: mbed_lib_rev152, tag: mbed-os-5.6.1, tag: latest, origin/mbed-os-5.6)
Something is wrong with the CAN RX interrupt handling.
I am simply attaching my interrupt handler using attach
method in instance of CAN
class.
First - it is not possible to call read()
on the can object in the interrupt routine as there is a mutex lock and this will fail in the interrupt context. On the other end if you do not read from the can interface. The interrupt routine is called again and again in infinite loop so it is not possible to pass the actual read to for example EventQueue as the interrupt handler will be called again and again and the program never leaves the interrupt context.
If i comment out the locking in CAN.cpp
and execute read()
in the interrupt handler, all is OK and the interrupt handler is called only when there is some messages left in the mailbox.