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.

DCAN Message Object, Receive Message Interrupt Processing, DCANINT apparently incorrect

Hi,

I have two DCAN message objects configured with all parameters the same except for the 11-bit arbitration id (in DCANIF1ARB). Message object 5 is the first receive message object configured and is the lowest numbered (i.e. highest priority receive message). Message object 10 is configured following message object 5 and is a lower priority). So:

DCANIF1MSK=0xC00007FF, DCANIF1ARB=0x88880000, DCANIF1MCTL=0x00001486, DCANIF1CMD=0xF8, DCANIF1NO=0x5, DCAN1INT bit set active for message object 5 (0x222).

DCANIF1MSK=0xC00007FF, DCANIF1ARB=0x88A40000, DCANIF1MCTL=0x00001486, DCANIF1CMD=0xF8, DCANIF1NO=0xA, DCAN1INT bit set active for message object 10 (0x229).

My problem is that receipt of message 0x229 is recorded as 0x00050000 in DCANINT rather than expected 0x000A0000 (i.e. the message object associated with message id 0x222 and not message id 0x229). DCANNWDAT12 is also incorrectly set to 0x00000010 (for message object 5)

Receipt of message 0x222 is correctly reported in DCANINT (0x0005000) and DCANNWDAT12 (0x00000010).

I have the same problem with other message arbitration ids, on receipt, they are all reported in DCANINT as being sourced from message object 5 (the highest priority receive message object).

Does anybody have any idea what I am doing wrong, presumably a configuration problem?

Regards, Tony.

  • Hi Tony,

    I'm in discussion with a CAN expert reagrding the issue that you are facing.

    I will get back to you soon.

    Best Regards,

    Pratip

     

  • Hi Tony,

    We tried to replicate this scenario and we do not see any issue from our side with your settings as you have explained above:

    - 2 Nodes

    - 2 Mail boxes [0x5 (configured for ID 0x222)and 0x10(configured for ID 0x229)]

    I assume the configuration on the receive side is as on the transmit side.

    I would like to know:

       1. Which ID you transmit first and which one the second , which order do you receive the ID's ?

      2. Do  you clear the pending interrupt after you receive ?

    If possible you can provide your code snippet for us to analise further .

    You can also try without changing the values of DCANIF1MSK and leave it as default (after reset) - Not sure if this would help.

    Do get back with your observations.

     

    Regards,

    Pratip

  • Hi Pratip,

    Please excuse my slow response.

    Answers to your questions are:

    1. Which ID you transmit first and which one the second , which order do you receive the ID's ?

    The order makes no difference. I can send the 'first configured message object' first or the 'second configured message object' first. It makes no difference, all registers indicate that the received message is always recognised/identified as 'first configured message object'.

    2. Do  you clear the pending interrupt after you receive ?

    I believe so, I do this:

    Set DCANIF1CMD to 0x08U
    Set DCANIF1NO to <message object read from DCANINT

    I don't really have an executable code snippet I can give you, I have a table driven implementation, but I have extracted everything relevant into the following file. These are all the registers I set, so maybe one is missing?

    Regards,

    Tony 

     

  • Hi Tony,

    Sorry for jumping in late.

    So you mean you are receiving all the messages with the right ID but all in the one mail box  (0x5)?

    Is my understanding right ?

    If so would you be able to check what happens  :

     1. On transmit side when you interchange the message objects (0xA (configured for ID 0x222)and 0x5(configured for ID 0x229)]) .

     2. On the receive side  apply  the same configuraten of message box 0x5 to message box 0xA and see if all messages are received in 0xA, this time .

    And one more question are you using two seperate CAN  nodes  and are both TMS470's ?

    Best Regards,

    Pratip

     

  • Hi Pratip,

    This remains a real puzzle, I've stepped through assembler trying to find the obvious mistake but to no avail. Below are the answers to your questions:

    You understanding is correct, I am receiving all my messages, but they are all placed in my highest priority defined mailbox (the one with the lowest number). The messages are all received with their correct IDs.

    It doesn't matter in what order I transmit the messages.

    My messages and message boxes all have exactly the same configuration except for the message id itself and the message box number of course. It doesn't matter in what order I actually configure the message boxes, lowest number first, or highest number first; messages are always routed to the lowest numbered message box.

    I am using a single CAN node (DCAN2) with only two receive messages defined (I have removed my transmit message configuration and it makes no difference). My processor is a TMS570.

    Regards, Tony.

  • Hi Pratip,

    I have finally discovered the reason for all messages being routed to the first message box. It is a calibration error on my part. I am using an 11-bit message identifier (as opposed to 29-bit) and had not shifted my identifier mask bits into register DCANIFxMSK:Msk bits [28:18], they were defined at [10:0] instead. As you will understand, this means that my acceptance filter matched all my 11-bit identified messages to the first defined receive message box!

    So, this problem is resolved for me. Thanks for your help, have a good holiday.

    Regards, Tony.

  • Hi Tony,

    Nice to hear this news. I was trying to make  a simplifed version of the code I had, so that you could try it out.

    Anyways. Hope you have a good time with your CAN software development.

    Do get back if you have further queries. :-)

    Regards,

    Pratip