2018-12-12 06:25 PM
Hi,
I am working on STM32F042.
I have setup the BxCAN peripheral into loop-back silent mode, and it works fine. I can transfer and receive every single frame I am transmitting and no error conditions are detected.
However, I have noticed that when I want to transmit a frame, there is a delay of about 37 ms (!) between setting the TXRQ (request to transmit) bit and the call to the CAN interrupt handler once the flag RQCP (transmission completed) is set.
Has anyone experienced similar delays? Is this happening only in loopback mode?
Thank you,
Marco
Solved! Go to Solution.
2018-12-14 01:38 AM
Found the bug: the prescaler variable was assigned an erroneously calculated value: zero. The library function CAN_Init() was then decremeting it (0x3FF) and setting it in one of the CAN peripheral registers. This was causing the time quantum to be the longest possible, thus causing the 37ms delay.
2018-12-14 01:38 AM
Found the bug: the prescaler variable was assigned an erroneously calculated value: zero. The library function CAN_Init() was then decremeting it (0x3FF) and setting it in one of the CAN peripheral registers. This was causing the time quantum to be the longest possible, thus causing the 37ms delay.