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.

TM4C1230E6 CAN extended adressing failure?

I've something a little odd going on.  I'm still working to track it down but I thought it was time to star sharing symptoms in case it triggers a memory for someone.

I've been using CAN on this micro for a little while now and I'm just stated to add some extended identifiers.  Reception appears to be working fine but it appears that if I set a bit above the 12'th (11 if you are starting at zero) I don't get transmission. 

I'm using an IXXAT USB/CAN converter and their minimon application for monitoring and it sees no messages.

I have narrowed this down to just changing the message ID making the difference.  It's not 11 bit ids vs 29 bit ids since both working and non-working are the extended 29-bit ids.

The code below shows the lines (marked by /***<<<<*/) that cause the difference between seeing a message on the monitor and not.

The simplest answer would be that I've missed something in the set up to the CANMessageSet routine, but I'm missing it if that is the case.

Robert

/*** SendMessage - Send a particular message.
 * Sets up CAN registers to send a particular message.
 ***/
/*lint -sem(SendMessage, 1p)*/
static void SendMessage(Message *msg)
{
    tCANMsgObject sCANMessage;
   
    if(msg->Message_ID>1024){              
     (void)SWO_fputs("SM ",0u);}
    sCANMessage.ui32MsgID = msg->Message_ID;
    if(msg->Message_ID>1024){               
     sCANMessage.ui32MsgID = 0x1000; /***<<<<*/ /* Fails */
     /*sCANMessage.ui32MsgID = 0x800;*/ /***<<<<*/ /* Works */     
    }
    sCANMessage.ui32MsgIDMask = 0u;
    sCANMessage.ui32Flags = MSG_OBJ_TX_INT_ENABLE;
   
    sCANMessage.ui32MsgLen = (uint32_t)msg->MsgLen;
    sCANMessage.pui8MsgData = (void *)msg->data;

  /* Send the CAN message using object number 2.  This function
     will cause the message to be transmitted right away. */
    CANMessageSet(CAN0_BASE, 2, &sCANMessage, MSG_OBJ_TYPE_TX);

    if(msg->Message_ID>1024){              
     SWO_fputhexint((unsigned int)(sCANMessage.ui32MsgID), 0u);
     (void)SWO_fputs("\n",0u);
     }
}

  • Thankfully, this is looking like a red herring.

    I'll confirm when I find out more but I think there may be a race condition elsewhere.

    Robert

  • And yes, indeed it was a race condition.  Two competing protocols stepping on each other's toes.  Properly semaphored the problem dissappeared.

    The fact the symptoms changed when changing the ID lead me down the garden path.

    And I think that metaphore has run its race.

     

    Robert

  • Robert Adsett said:
    IXXAT USB/CAN converter

    Glad you presented - diagnosed - and resolved (and neatly reported here) your issue.  Thank you.

    "IXXAT USB/CAN converter" is interesting - also of value to those here.  We used a KVasser - bit aged but similar in performance/capability. 

    Sub 300 USD for such a CAN tool appears as - presently unmet - "holy grail"...  Appears that extending beyond CAN (i.e. I2C, SPI, RS232/485) may enhance marketability - w/out adding greatly to HW costs...