I am working with ATSAME54P20A on SAME54 Xplained board using Atmel Start with atmel studio 7.
I would like to share my findings on the CAN bus driver which is included with Atmel start #define DRIVER_VERSION 0x00000001u.
1. The driver doesn't acknowledge the fifo read in can_async_read() function. If I am right RXF0A_F0AI needs to be incremented every time after message has been red. So what actually happens every call to can_async_read() gets the first element of the fifo and doesn't clear them causing the fifo to overflow eventually.
2. The driver allocates a random ram address for the FIFO. However only 16bit address can be passed to to the register (Bits 15:0 – F0SA[15:0] Rx FIFO 0 Start Address) so if any address above 0x0000FFFF will be allocated for the uint8_t can1_rx_fifo[CONF_CAN1_F0DS * CONF_CAN1_RXF0C_F0S]; this will cause a severe memory leak.
I am shocked to find such basic issues with this library. I couldn't find any similiar posts on this forum, does it mean noone has encountered these problems before?