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.

TMS320F28335: Ecan MailBox Multiple messages receiving Issue

Part Number: TMS320F28335


Hi,

I have configured  EcanA MailBox31  for receiving multiple ID's. I have taken care of AME bit, LAM Registers for fully acceptances of messages irrespective of ID .

Baud rate is set to 1Mb/s..

The issue is that , I am able to receive all IDs.

But when reading one ID data, the  mailbox 31  is overwritten by new ID and New data. 

I have enabled CANOPC bit and mailbox 30 also enabled for receiving purpose, still the same issue persists.

receive function is called in while loop. 10 IDs are coming with each frequency @10ms . when reading out one ID , ecan Mailboxes are being updated with new one.

At some unperiodic time intervals , the variable test is incrementing 

void Receive_eCAN_A()

{

ECanaShadow.CANRMP.all=ECanaRegs.CANRMP.all;

if(ECanaShadow.CANRMP.bit.RMP31==1)
{
          ECanaShadow.CANRMP.all=0;
          ECanaShadow.CANRMP.bit.RMP31=1;
          ECanaRegs.CANRMP.all=ECanaShadow.CANRMP.all;

           RecvID = ECanaMboxes.MBOX31.MSGID.bit.STDMSGID;
         

         if(RecvID!=ECanaMboxes.MBOX31.MSGID.bit.STDMSGID)
                  test++;

In the above code ,  same issue persists even if timer interrupts are disabled .

with in one instruction execution , the can mailboxe data is changing!!!

Thanks in Advance

  • Hey Satish, 

    Sorry for the delay, our experts are looking into this and a solution for your query will be offered shortly.

    Thanks.

  • Satish,

                    This is a software issue and our ability to help is limited. Solving issues like this requires deep knowledge of your application code which I don’t have. Having said that, I can offer a few suggestions: 

    No matter how many mailboxes you allocate for reception, if you don’t read the mailboxes at the rate at which data is received (or faster) , you will lose data. This has nothing to do with the H/W and needs to be dealt with solely in S/W. When a MBX is protected with the OPC bit, that MBX will be protected from being overwritten until the previous data has been read out and the RMP bit cleared. The solution may be to allocate more mailboxes for reception. For example, set the OPC bits for MBX31 & MBX30. Configure MBX29 also for the MSGIDs. If you still lose loose messages, you may need to rope in one more mailbox.