CAN ISR - MemoryError due to can.recv(0)
Posted: Fri Jul 21, 2017 2:57 pm
1) What I want to do
I am currently working on an OpenMV Cam M7 and trying to implement CAN communication with another STM32 card that transmits a lot of messages (some every 10ms). As the microcontroller can only store 3 messages in its FIFO and as the CAN bus 2 (the only one available on the OpenMV Cam) only has 2 FIFO (that I can specify through the Filters), I want to implement a software FIFO.
2) The problem
The problem is that the function to extract a message from the FIFO (CAN.recv(fifo)) cannot be used in an ISR because it allocates some memory and that allocating memory cannot be done in an ISR. Has anyone managed to solve this problem ?
3) Places where this question was already answered
I found some people that already had this problem but it wasn't resolved or can't / don't know how to do it on the OpenMV Cam
viewtopic.php?f=14&t=2099&p=11871&hilit ... ecv#p11871
viewtopic.php?t=1967
I am currently working on an OpenMV Cam M7 and trying to implement CAN communication with another STM32 card that transmits a lot of messages (some every 10ms). As the microcontroller can only store 3 messages in its FIFO and as the CAN bus 2 (the only one available on the OpenMV Cam) only has 2 FIFO (that I can specify through the Filters), I want to implement a software FIFO.
2) The problem
The problem is that the function to extract a message from the FIFO (CAN.recv(fifo)) cannot be used in an ISR because it allocates some memory and that allocating memory cannot be done in an ISR. Has anyone managed to solve this problem ?
3) Places where this question was already answered
I found some people that already had this problem but it wasn't resolved or can't / don't know how to do it on the OpenMV Cam
viewtopic.php?f=14&t=2099&p=11871&hilit ... ecv#p11871
viewtopic.php?t=1967