This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hello,
I have been consulting with the Technical Reference Manual concerning reconfiguration of message objects after initialization. Sections 12.7.6 and 12.7.7 specify the MsgVal bit must be reset before changing the configuration of certain values in the message.
I have been using the below code generated by HALCoGen to update the ID of a message object configured for reception. Based on the manual, the ID bits cannot be changed of a reception object without the MsgVal bit being reset to not valid, but, based on my understanding of this function, the function does not appear reset the MsgVal bit before changing the ID, yet the function is still correctly updating the ID.
I am looking to update some of the other values that are listed in the manual as requiring a MsgVal reset, but the canUpdateID function has me confused as to when a MsgVal reset is required and what a reset would look like.
void canUpdateID(canBASE_t *node, uint32 messageBox, uint32 msgBoxArbitVal) { /** - Wait until IF2 is ready for use */ while ((node->IF2STAT & 0x80U) ==0x80U) { } /* Wait */ /** - Configure IF2 for * - Message direction - Read * - Data Read * - Clears NewDat bit in the message object. */ node->IF2CMD = 0xA0U; /* Copy passed value into the arbitration register. */ node->IF2ARB &= 0x80000000U; node->IF2ARB |= (msgBoxArbitVal & 0x7FFFFFFFU); /** - Update message box number. */ /*SAFETYMCUSW 93 S MR: 6.1,6.2,10.1,10.2,10.3,10.4 <APPROVED> "LDRA Tool issue" */ node->IF2NO = (uint8) messageBox; /** - Wait until data are copied into IF2 */ while ((node->IF2STAT & 0x80U) ==0x80U) { } /* Wait */ }
Any clarification on this matter would be appreciated.
Regards,
Garrett
Hello,
Our expert for this topic is current out of office and will reply early next week when they are back. Sorry for the delay in response.
Best Regards,
Ralph Jacobi
Hi Garrett,
I found one bug in the "canUpdateID" function in one of my recent threads:
Please refer below comment in above thread:
--
Thanks & regards,
Jagadish.
That is correct. There is that bug in the function. That bug does not have any apparent effects with my configuration, so it doesn't really answer my question. Maybe I can clarify what I am trying to do.
Upon startup, I am initializing multiple message boxes in TX and RX configurations. I want to change some of these these message boxes to their counterpart and adjust the interrupt configurations. I am seeking clarification as to when the MsgVal bit needs to be reset as described in the documentation I previously referenced. The canUpdateID function does not appear to explicitly reset MsgVal to not valid before changing the ID of an RX message box as described in the documentation, thus giving rise to my confusion. Is the documentation incorrect in describing a MsgVal reset, or is something else happening in hardware that is not visible in software?