The release notes for HALCoGen says it is including support for DCAN FIFO configuration. As I'm using this feature, I upgraded to the new version to check how the DCAN FIFO support looks like.
At first glance, it seems that the only support added is a checkbox in every DCAN mailbox which allows to set/reset the EOB bit. I migrated my project based on HALCoGen 04.05.02 to 04.06.00, and after code generation I found that the code generated for initCan() seemed wrong.
For every CANx mailbox, V 04.05.02 generated the following line of code:
canREG2->IF1MCTL = 0x00001080U | (uint32)0x00000400U | (uint32)0x00000000U | (uint32)8U;
The value 0x00001080U already includes the EOB bit set so every DCAN mailbox is independent by default, thus it can not be used as part of a FIFO unless you create your own custom initCan() function, which is what I did.
With HALCoGen 04.06.00, after checking the EOB checkbox of some DCAN mailboxes in the UI and generating code, the affected lines were changed to:
canREG2->IF1MCTL = 0x00001080U | (uint32)0x00000400U | (uint32)0x00000000U | (uint32)0x00000080U | (uint32)8U;
I could see there was a new fieId added with the value 0x00000080U, but I had the suspect that the 0x00001080U value would remain unchanged even after unchecking the EOB checkbox, so I repeated the code generation after clearing the EOB of the related DCAN mailboxes in the UI. The result was:
canREG2->IF1MCTL = 0x00001080U | (uint32)0x00000400U | (uint32)0x00000000U | (uint32)0x00000000U | (uint32)8U;
It removed the EOB bit from the 0x00000080U value, but the 0x00001080U value still had the EOB bit set, so the generated code was useless.
I repeated the test by creating a new project from the scratch, to see if the problem was caused by migrating the project from a previous HALCoGen version. The result was the same.
Could you please check this one?
Thanks in advance
Antonio López