CANIf Module2: Understanding CAN Communication, Hardware Objects and Mailboxes

In the intricate landscape of Controller Area Network (CAN) communication, two key concepts play a pivotal role: CAN Hardware Objects and Mailboxes. These logical entities within a CAN controller orchestrate the flow of messages, ensuring seamless communication among different nodes. Let’s delve into the world of CAN communication and demystify these essential components.

Understanding CAN Hardware Objects:

What Are CAN Hardware Objects?

CAN Hardware Objects can be likened to the orchestrators within a CAN controller. They represent logical configurations that define how the controller interacts with the CAN network. Each object is like a specialized task force, equipped with specific instructions on how to handle messages.

How CAN Hardware Objects Work:

  1. Message Buffers:
    • Imagine a message buffer within a CAN Hardware Object as a storage unit for message data. It’s where the actual information to be transmitted or received is stored.
    • Example: If a car wants to broadcast its speed over the CAN network, the message buffer would hold the speed value (e.g., 60 km/h).
  2. Filters:
    • Filters within a CAN Hardware Object act like gatekeepers. They determine which messages are allowed to pass based on certain criteria, such as message ID.
    • Example: A filter could be configured to only accept messages with a specific ID, ensuring that only relevant information reaches the intended recipient.
  3. Task Assignment:
    • Each CAN Hardware Object is assigned a specific task, whether it’s transmitting a particular message, filtering incoming messages, or performing other communication-related functions.
    • Example: One CAN Hardware Object might be tasked with sending engine-related data, while another handles safety-related information.

Understanding Mailboxes:

What Are Mailboxes?

Mailboxes serve as the messengers between the higher-level software components (like the application layer) and the low-level CAN controller. They provide a user-friendly interface, shielding software from the nitty-gritty details of hardware intricacies.

How Mailboxes Work:

  1. Logical Containers:
    • Envision a mailbox as a designated container within the CAN controller. It holds the message data, identifier, and control information in a neatly organized manner.
    • Example: When the application layer wants to send a message, it places the message data and details into a mailbox, and the CAN controller takes care of the rest.
  2. Software Interaction:
    • Mailboxes act as bridges, allowing higher-level software components to send and receive messages without delving into the complexities of the CAN controller’s hardware.
    • Example: The application layer can request the transmission of a message by interacting with a designated mailbox, leaving the CAN controller to handle the low-level details.

Differences between CAN Hardware Objects and Mailboxes:

While both concepts deal with the management of messages within a CAN controller, the primary difference lies in their abstraction level and functionality:

  • Abstraction Level:
    • CAN Hardware Objects are closely associated with low-level hardware configurations.
    • Mailboxes provide a higher-level interface for software components.
  • Configuration vs. Interface:
    • CAN Hardware Objects involve configuring how the CAN controller handles messages.
    • Mailboxes provide a convenient interface for software components to engage with the configured CAN Hardware Objects.
  • Software Interaction:
    • CAN Hardware Objects are primarily managed at the hardware level.
    • Mailboxes act as a means for higher-level software components to send and receive messages without dealing directly with hardware intricacies.

Mapping CAN Hardware Objects to Mailboxes and Configuration Steps:

Mapping these entities involves configuring the CAN controller to handle specific messages or tasks using both CAN Hardware Objects and Mailboxes. Let’s walk through the steps:

1. Understand System Requirements:

  • Define communication requirements, including message types, IDs, and transmission/reception tasks.

2. Identify Hardware Objects:

  • Determine the number and types of CAN Hardware Objects needed based on system requirements.

3. Allocate Mailboxes:

  • Create a mailbox for each identified CAN Hardware Object, allocating memory space and defining a logical container for message data.

4. Configure Message Buffers:

  • Assign specific message buffers within the CAN controller’s memory to the mailboxes, corresponding to each CAN Hardware Object.

5. Set Filter Criteria:

  • Configure filter settings for each mailbox to determine which messages it should handle, based on criteria like message ID.

6. Assign Tasks to Mailboxes:

  • Determine the tasks assigned to each mailbox, whether it’s for transmitting specific messages, receiving messages of a certain type, or other communication tasks.

7. Define Transmission Parameters:

  • Set parameters for message transmission, including details like message ID, data length, and transmission mode.

8. Verify Compatibility with AUTOSAR:

  • Ensure that the configured CAN Hardware Objects and mailboxes are compatible with the AUTOSAR communication stack, following standardized interfaces.

9. Documentation:

  • Document the mapping details, including which CAN Hardware Objects are associated with each mailbox, their configurations, and assigned tasks.

10. Verify and Test:

  • Perform thorough testing to ensure that the mapping and configuration meet system requirements. Check for proper message transmission, reception, and handling by the CAN controller.

In conclusion, CAN Hardware Objects and Mailboxes are the unsung heroes of CAN communication, working harmoniously to ensure reliable and efficient data exchange. Understanding their roles, differences, and how to map them is a crucial step towards mastering the intricacies of CAN networks. As the heartbeat of modern automotive and industrial communication, CAN continues to evolve, and a solid grasp of these fundamental concepts is the key to navigating the ever-expanding realm of CAN communication.


Discover more from

Subscribe to get the latest posts sent to your email.

1 thought on “CANIf Module2: Understanding CAN Communication, Hardware Objects and Mailboxes”

  1. Pingback: CANIf Module 1: Introduction to CANIf in AUTOSAR - Embiauto

Comments are closed.

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading