How to correctly set up FDCAN Message RAM Start Addresses?
How do I have to set the configuration of the FDCAN Message RAM Start Adresses correctly in order to use 2 CANFDs simultaneously?
Is there an example which shows a correct initialisation? The default samples initialize all start Adresses to 0, but this leads to Message corruption!
Here my sample code:
Would this be correct?
if (nCan == CAN0)
{
phCan->Instance = FDCAN1;
uCANOffset = 0;
}
else
{
phCan->Instance = FDCAN2;
uCANOffset = 1024;
}
phCan->msgRam.StandardFilterSA = 0;
phCan->msgRam.ExtendedFilterSA = 0;
// Start-Adressen für Message-RAM:
phCan->msgRam.RxFIFO0SA = 0+uCANOffset;
phCan->msgRam.RxFIFO1SA = 512+ uCANOffset;
phCan->msgRam.RxBufferSA = 1024;
phCan->msgRam.TxEventFIFOSA = 0;
phCan->msgRam.TxBufferSA = 0;
phCan->msgRam.TxFIFOQSA = 0;
phCan->msgRam.TTMemorySA = 0;
phCan->msgRam.EndAddress =0;
phCan->ErrorCode = 0;
Thank you for any help.
