How to configure a given mailbox for multiple CAN message IDs on a TI C2000 device?

18 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 Mar 2021
The C28x eCAN Transmit and Receive blocks contain an init callback function in the block properties as shown below:  
The init callback function in the C28x eCAN transmit and receive block performs the validation of the mailbox to check if only one CAN message identifier is configured for each mailbox. If more than one CAN message identifier is configured for the same mailbox then the validation fails and it will return an error that the respective CAN mailbox is already used.  
If you want to configure the same mailbox for multiple CAN message identifiers, the init callback function to perform the validation needs to be cleared by performing the below steps:  
1. Select the C28x eCAN transmit/receive block for which the validation needs to be disabled.  
2. Run the below command from the MATLAB command window:  
set_param(gcb, 'InitFcn', '');
3. This will clear the init call back function of the respective C28x eCAN transmit/receive block as shown below:  
4. Add System Initialize block to the model and add the below custom code to configure the mailbox 0 to enable the Acceptance Mask bit to allow multiple CAN message IDs in the same mailbox:  
5. Similarly, any mailbox can be configured to enable the Acceptance Mask bit to allow multiple CAN message IDs in the same mailbox.  
  2 Comments
Sandra Dilge Cruz
Sandra Dilge Cruz on 2 Jun 2022
Moreover, I don't know if I need a System Initialize block for every mailbox I configure and whether it changes depending on if it is for a Transmit o Receive block.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!