PeakSat / OBC-EQM-Software

MIT License
1 stars 0 forks source link

CAN Bus Handling of Incoming Messages #7

Open Sourland opened 1 month ago

Sourland commented 1 month ago

Current Implementation

The current implementation of the CAN Bus is very problematic. The task is responsible for handling both incoming and outgoing messages. While the outgoing messages are sent correctly, the following problem problems arrise:

The task awaits for the incoming queue to fill and then it transmits the pending messages. In FreeRTOS, when a queue is empty the tasks suspends itself until it gets an element. This causes a deadlock since both applications incoming queues are waiting for elements but neither of those can send them.

We can bypass this by having 2 separate tasks handling messages: one for outgoing one for incoming messages.

Image