-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description of defect
When signalling from CAN using RX ISR, we are seeing the ISG Queue overflowing.
This looks to be related to ARM-software/CMSIS_5#283.
- Type: Bug
- Priority: Major
Expected behavior
The program keeps running.
Actual behavior
The program crashes with the message CMSIS-RTOS error: ISR Queue overflow (status: 0x2, task ID: 0x0, object ID: 0x20001014)
Target(s) affected by this defect ?
NUCLEO_F767ZI
Toolchain(s) (name and version) displaying this defect ?
arm-none-eabi-g++ (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 6.3.1 20170620 (release) [ARM/embedded-6-branch revision 249437]
What version of Mbed-os are you using (tag or sha) ?
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
mbed-cli version:
mbed --version
1.2.2
How is this defect reproduced ?
I've connected a Peak PCAN USB through a TJA1051T/3 with proper termination on both ends. I'm periodically sending dummy messages using the PCAN. I've tried frequencies as low as 10hz.
I've looked at the trace and the error happens inside the isrRtxThreadFlagsSet
function.
I've sporadically run into this or a very similar issue (the ISR queue overflow) in the past when signaling/releasing a semaphore/inserting into a queue, but was never able to consistently reproduce it before.
#include "mbed.h"
static const uint32_t READ_IRQ = 1 << 0;
CAN bus(PB_5, PB_6, 500000);
rtos::Thread thread;
void read_isr() {
thread.signal_set(READ_IRQ);
}
void can_main() {
CANMessage canmsg;
while(true) {
osEvent evt = rtos::Thread::signal_wait(READ_IRQ);
while (bus.read(canmsg)) {
}
break;
thread.signal_clr(READ_IRQ);
}
}
// main() runs in its own thread in the OS
int main() {
printf("Starting\r\n\n");
thread.start(can_main);
wait_ms(10);
bus.attach(read_isr, CAN::RxIrq);
while (true) {
wait(100);
}
}