Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN,
I am using TMS570LS1227 and Halcogen generated code to transmit a message over CAN1.
I have a project where I first initialise the CAN module:
canInit();
then update the CAN ID of one of the mailboxes:
canUpdateID(canREG1, canMESSAGE_BOX1, (uint32_t)0x20000000U | (uint32_t)(((uint32_t)0x4C0U) << (uint32_t)18U));
and then I transmit that mailbox every x miliseconds:
canTransmit(canREG1, canMESSAGE_BOX1, data);
I have found out that if I have a single mailbox enabled (just mailbox 1 enabled in Halcogen), then the previous sequence of functions don't work as expected and the message is not transmitted at all. However, if I enable mailbox 2 as well in Halcogen (even if I'm not using it) then it does work as intended and the message is transmitted successfully with the correct CAN ID.
I have also found out that if I modify the canUpdateID function so that it uses IF1 instead of IF2 (exact same function just changing IF2 by IF1) then the previous sequence of functions again work as expected. Am I missing something or is this a bug?