kentindell / canhack

The Yes We CAN project of Canis Labs
MIT License
344 stars 64 forks source link

Hardware buffer pointer C1TXQUA sometimes goes out of range #7

Closed kentindell closed 3 years ago

kentindell commented 3 years ago

The MCP2517/18FD controller sometimes has the C1TXQUA value exceed the allocated space. This may be a bug in the memory allocation, but either way it seems not possible to use C1TXQUA as an index into the array where the frame control blocks are kept. Instead, allocate slots from a free list and return them when transmitted.

kentindell commented 3 years ago

Corruption due to SPI noise.

https://github.com/kentindell/canhack/commit/56fe2ae909a51186a4fd109f70ebac7bdd10f0af