Ouch. I had some similar problems moving to the new bxcan Rust crate. If you wait for the return for the transmit, it works fine. With a single ID, 8 bytes, 500k, I was able to pump out 4000 messages/sec with an 8MHz clock. That seems close to the theoretical limit. A simple FIFO works well too, but what I tried last night(FIFO + Interrupt driven TX) worked very poorly to say the least, so I abandoned that.johu wrote: ↑Mon Jan 11, 2021 7:12 pmBasically the STM32 has a 3 message CAN send FIFO. So if your code is like
can_send();
can_send();
can_send();
can_send();
Then the last message will be dropped. To get around this you have to implement a software FIFO that stores the excess messages until the hardware FIFO is free again and then sends them out. That's exactly what the CAN module in libopeninv does and that is why building your software on top of stm32-template is super king
-Matt