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.

AWR1642BOOST: AWR1642 new BOARD with label "XA1642ABSABL ES2.0 label" CANFD port with classic can frame in short range radar code

Part Number: AWR1642BOOST
Other Parts Discussed in Thread: AWR1642

HI,

we are using AWR1642boost with label XA1642ABSABL ES2.0 label . we downloaded relevant sdk i.e 02_00_00_04.we are using short range radar code with CANFD driver to transmit radar in CLASSIC FRAME format.I have attached pcan tool settings below.

what we observe that if the detected objects are around 40(>31) ,pcan view  trace gets stopped logging.I have attached can_send() function we are using below.we have fdmode ,brs registers set to 0, dar register set to 0 in mcan initialization and all hardware changes are taken care.Our observation is from multiple logs which we did not see with old awr1642 boards. please look into below queries.

1) we are following Task_sleep(1); in below code even though it is classic frame(as I see in other threads ,it is necessary if we are using only CANFD format) But in our case if we remove Task_sleep(1); for classic frame format then we are seeing only magic 8 bytes only in pcan view tool(no other bytes,only maigc no 8 bytes continuously).It looks strange.

2)From our calculation 1Mbps CAN speed means roughly it needs 10micro seconds for 1 byte transmission, In our case 40 detected objects means a frame of 376 bytes .It needs 3760 micro seconds for completing CAN transmission. Does it mean, Before it completes the transmission, next frame send request arrived? we are using standard SRR code only .

3) If really scenario 2 is true,there is no issue with UART transmission.is it because we are using uart_writepolling()? Any next frame request will overwrite previous request?

4) If the problem is really with can_send() ,if we implement printf() statements ,is it possible to see it in running mode i.e after flashing binary also?

void can_send(uint8_t *buffer,uint32_t size)
{
    int32_t                 errCode = 0;
    uint8_t                 i;
   uint32_t remdatsize=0;

   if(buffer != NULL)
   {
       if((size>0))
      {
         remdatsize = size;

         while((remdatsize >0))
         {
             memset(&appDcanRadarData, 0xff, sizeof (appDcanRadarData));
           
             if(remdatsize >7)
             {
                 appDcanRadarData[0]= *(uint8_t*)buffer;  buffer = (uint8_t*)buffer+1;
                 appDcanRadarData[1]= *(uint8_t*)buffer;  buffer = (uint8_t*)buffer+1;
                 appDcanRadarData[2]= *(uint8_t*)buffer;  buffer = (uint8_t*)buffer+1;
                 appDcanRadarData[3]= *(uint8_t*)buffer;  buffer = (uint8_t*)buffer+1;
                 appDcanRadarData[4]= *(uint8_t*)buffer;  buffer = (uint8_t*)buffer+1;
                 appDcanRadarData[5]= *(uint8_t*)buffer;  buffer = (uint8_t*)buffer+1;
                 appDcanRadarData[6]= *(uint8_t*)buffer;  buffer = (uint8_t*)buffer+1;
                 appDcanRadarData[7]= *(uint8_t*)buffer;  buffer = (uint8_t*)buffer+1;
                 
                 CANFD_transmitData (txMsgObjHandle, txMsgObjectParams.msgIdentifier, CANFD_MCANFrameType_CLASSIC, 8U, &appDcanRadarData[0], &errCode);
                 remdatsize = remdatsize-8;
             }
             else if(remdatsize>0)
             {
                 for(i=0;i<remdatsize;i++)
                 {
                   appDcanRadarData[i]= *(uint8_t*)buffer;
                   buffer = (uint8_t*)buffer+1;
                 }
                 CANFD_transmitData (txMsgObjHandle, txMsgObjectParams.msgIdentifier, CANFD_MCANFrameType_CLASSIC, 8U, &appDcanRadarData[0], &errCode);
                 remdatsize=0;
             }
             else
             {

             }
             Task_sleep(1);
        }

      }
   }
}

  • Hello Tulasikrishna,
    This ticket is being assigned to concern expert. He'll get back to you soon.



    Regards,
    Jitendra
  • Hello Tulasikrishna,

    Do you want to use single message identifier and transmit all the data ?
    Is there a reason you would not like to use the FD mode of operation?

    -Raghu
  • HI Raghu,

    somehow we re-organized the code and it is working.we are sending only detected points over CAN(clusters and trackers are not included) and below code 

    is working and we want to test it continuously for longer period.we will implement fd as well but our primary requirement is on MCAN.

     - Could you please clarify how to rout sys_printf() data to console ,so that in future we want to see any problems arising because of too frequent can_send() requests.

    - Also could you clarify whether the below version works fine if can_send() is requested before the previous request is completed.we do not want pcan tool gets stopped .we are OK with 

    current frame data is  ignored in MSS software if previous frame is not completely sent over CAN as below.

    void can_send(uint8_t *buffer,uint32_t size)
    {
        int32_t       errCode = 0;

        uint32_t remdatsize=0;
        static int32_t prev_req=0;
        uint32_t index = 0;

      if(prev_req >=0)
      {
        if(buffer != NULL)
        {
               if((size>0))
               {
                   remdatsize = size;

                   while((remdatsize >0))
                   {

                       if(remdatsize >7)
                       {

                           prev_req = CANFD_transmitData (txMsgObjHandle, txMsgObjectParams.msgIdentifier, CANFD_MCANFrameType_CLASSIC, 8U, &buffer[index], &errCode);
                           if (prev_req < 0) { continue; }
                           index = index+8;
                           remdatsize = remdatsize-8;
                       }
                       else if(remdatsize>0)
                       {
                           prev_req = CANFD_transmitData (txMsgObjHandle, txMsgObjectParams.msgIdentifier, CANFD_MCANFrameType_CLASSIC, remdatsize, &buffer[index], &errCode);
                           while(prev_req < 0)
                           {
                               prev_req = CANFD_transmitData (txMsgObjHandle, txMsgObjectParams.msgIdentifier, CANFD_MCANFrameType_CLASSIC, remdatsize, &buffer[index], &errCode);
                           }
                           index =0;
                           remdatsize=0;
                       }
                       else
                       {

                       }


                   }

               }
           }
      }
    }

  • Hello Tulasikrishna,
    Do you have a constraint on the timing of receiving the CAN message? If not , you can include a Task_sleep() in the while loop after your transmit.

    This should make sure the CAN message is transmitted.

    Thanks,
    Raghu
  • HI Raghu,

     Do you recommend Task_sleep() for CLASSIC message 8 bytes transmission as well ? since In above code We are transmitting 8 bytes only in each request.

    If yes,After every 8 byte send request .,Task_Sleep(1) is recommended?

    Thanks,

    P Tulasi Krishna.

  • Hello Tulasikrishna,
    I am not recommending to use a sleep function in your code. I am asking if you have any timing constraint, meaning, do you have any other task waiting for this CAN message at hard timing boundary.


    -Raghu
  • Hi Raghu,
    No we don't have any other tasks with hard time boundary.Just radar software with CAN messages transmission and observed through CAN tool only.

    Thanks,
    P Tulasi Krishna.