Skip to content

CAN: Send buffer for STM #350

Open
@BlakeFreer

Description

The STM has three TX mailboxes. This is a very small buffer for outgoing messages. It is very reasonable for a periodic task to send several messages in rapid succession, faster than the CAN bus can process them.

This is not a bus traffic issue. A slow task which sends 4 diagnostic messages every 1000 ms would cause dropped frames simply because the messages are loaded faster than they can be sent.

I see two solutions:

  1. Block the .Send(msg) call until a mailbox is available
  2. If mailboxes are full, load the message into a secondary buffer. Use interrupts to move it into a mailbox when available.

This SO article may be useful https://electronics.stackexchange.com/a/509241/331923

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions