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.

CCS/AWR1642BOOST: Adding CAN-FD capabilities to lab0012_srr_16xx demo project

Part Number: AWR1642BOOST
Other Parts Discussed in Thread: AWR1642

Tool/software: Code Composer Studio

Hi,

I followed the SPRACF7 application note to add CAN_FD Capabilities to the SRR demo project

In order to test it I added the following code to the "void Can_Initialize(void) functions in order to monitor some frames before connection to the real thing in dss

the following works fine for odoc but not at all for srr

void Can_initialize(void)

{

.........

// CANFD object are created for Tx and Rx using: CANFD_createMsgObject(....)

// following my added code

int32_t ctr = -1;
MmwDemo_message message;

while(ctr++ < 500)
{

// Can_Transmit_Schedule(...) from odoc

retVal = Can_Transmit_Schedule( Get_CanMessageIdentifier((MmwDemo_output_message_type)MMWDEMO_HEADER),
                                                      (uint8_t*)&message.body.detObj.header,
                                                      sizeof(MmwDemo_output_message_header));

if(retVal != 0)
{
        System_printf("ctr = %d, retVal %d, Error Status %d, error reason %x\n", ctr, retVal, gErrStatusInt, gReason[0]);

        /* gReason[0] = 0xe0 + (int32_t)reason;// from: MCANAppErrStatusCallback(CANFD_Handle handle, CANFD_Reason reason, CANFD_ErrStatusResp* errStatusResp) */
}
else

        System_printf("ctr = %d, retVal %d, Error Status %d, completion reason %x\n", ctr, retVal, gErrStatusInt, gReason[1]);

        /* gReason[1] = 0xZ0 + (int32_t)reason, Z>0  if MCANAppCallback(CANFD_MsgObjHandle handle, CANFD_Reason reason) is called  */ 
}

}

}

output from odoc: (correct frames are shown in PCAN application)

ctr = 0, retVal 0, Error Status 0, completion reason 0
ctr = 1, retVal 0, Error Status 1, completion reason 0
ctr = 2, retVal 0, Error Status 2, completion reason 0
ctr = 3, retVal 0, Error Status 3, completion reason 0
ctr = 4, retVal 0, Error Status 4, completion reason 0

.... until ctr reaches 500

it looks like the MCANAppErrStatusCallback() is always called... 

output from SRR:(some CAN activity is seen in the CAN_H, CAN_L lines in scope but no frames shown in PCAN application)

ctr = 0, retVal 0, Error Status 0, completion reason 0
ctr = 1, retVal 0, Error Status 1, completion reason 0
ctr = 2, retVal 0, Error Status 2, completion reason 0
ctr = 3, retVal 0, Error Status 3, completion reason 0
ctr = 4, retVal 0, Error Status 4, completion reason 0
ctr = 5, retVal 0, Error Status 5, completion reason 0
ctr = 6, retVal 0, Error Status 6, completion reason 0
ctr = 7, retVal 0, Error Status 7, completion reason 0
ctr = 8, retVal 0, Error Status 8, completion reason 0
ctr = 9, retVal 0, Error Status 9, completion reason 0
ctr = 10, retVal 0, Error Status 10, completion reason 0
ctr = 11, retVal 0, Error Status 11, completion reason 0
ctr = 12, retVal 0, Error Status 12, completion reason 0
ctr = 13, retVal 0, Error Status 13, completion reason 0
ctr = 14, retVal 0, Error Status 14, completion reason 0
ctr = 15, retVal 0, Error Status 15, completion reason 0
ctr = 16, retVal 0, Error Status 16, completion reason 0
ctr = 17, retVal 0, Error Status 17, completion reason 0
ctr = 18, retVal 0, Error Status 18, completion reason 0
ctr = 19, retVal 0, Error Status 19, completion reason 0
ctr = 20, retVal 0, Error Status 20, completion reason 0
ctr = 21, retVal 0, Error Status 21, completion reason 0
ctr = 22, retVal 0, Error Status 22, completion reason 0
ctr = 23, retVal 0, Error Status 23, completion reason 0
ctr = 24, retVal 0, Error Status 24, completion reason 0
ctr = 25, retVal 0, Error Status 25, completion reason 0
ctr = 26, retVal 0, Error Status 26, completion reason 0
ctr = 27, retVal 0, Error Status 27, completion reason 0
ctr = 28, retVal 0, Error Status 28, completion reason 0
ctr = 29, retVal 0, Error Status 29, completion reason 0
ctr = 30, retVal 0, Error Status 30, completion reason 0
ctr = 31, retVal 0, Error Status 31, completion reason 0
ctr = 32, retVal -1, Error Status 33, error reason e6
ctr = 33, retVal -1, Error Status 33, error reason e6
ctr = 34, retVal -1, Error Status 33, error reason e6
ctr = 35, retVal -1, Error Status 33, error reason e6
ctr = 36, retVal -1, Error Status 33, error reason e6
ctr = 37, retVal -1, Error Status 33, error reason e6
ctr = 38, retVal -1, Error Status 33, error reason e6
ctr = 39, retVal -1, Error Status 33, error reason e6
ctr = 40, retVal -1, Error Status 33, error reason e6
ctr = 41, retVal -1, Error Status 33, error reason e6
ctr = 42, retVal -1, Error Status 33, error reason e6

.... until ctr reaches 500

when Can_Transmit_Schedule() tries reached 32, then no more CAN_H, CAN_L activity, Error status counter -incremented in MCANAppErrStatusCallback(...) stuck and Error reason = 6 = CANFD_Reason_PROTOCOL_ERR_DATA_PHASE -

if I log the error from transmiter I get from try 33: CANFD_EINUSE = (MMWAVE_ERRNO_CANFD_BASE-2) = -3502

It looks like the 32 FIFO for transmit is full and the transmit interrupt is not working, that some configurations, present in odoc are missing in srr.

Thanks,

Claudio

  • Hi,
    This thread has been assigned to an expert, you will hear back soon.

    Regards,
    Jitendra
  • Hi all, 

    I resolved the issue!

    In the function:

    void Can_Initialize(void)

    {

    ....

    /* Configure the divide value for MCAN source clock */
    //SOC_setPeripheralClock(gMmwMssMCB.socHandle, SOC_MODULE_MCAN, SOC_CLKSOURCE_VCLK, 4U, &errCode);//commented on from odoc
    SOC_setPeripheralClock(gSrrMSSMCB.socHandle, SOC_MODULE_MCAN, SOC_CLKSOURCE_VCLK, 4U, &errCode);// added for srr


    /* Initialize peripheral memory */
    //SOC_initPeripheralRam(gMmwMssMCB.socHandle, SOC_MODULE_MCAN, &errCode);// commented on from odoc
    SOC_initPeripheralRam(gSrrMSSMCB.socHandle, SOC_MODULE_MCAN, &errCode);// added for srr

    .....

    }

    And I have CAN_FD working for SRR in the AWR1642

    Thanks!

    Claudio