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.

IWR6843: CANFD_init() appears stuck

Part Number: IWR6843

Hello,

I am looking into the initialization of the canFD module using the mmWave drivers. This code appears to work on all devices, but fails some of the time causing the device to appear locked up. I have done some debugging which narrowed it down to the CANFD_init() function. In the real application, I have serial printouts to use for debug statements and have narrowed it down to this section of code:

CLI_write("queue rx end   %x\n", &canMessages[NUM_CAN_RX_MESSAGES-1].queue);

MCANAppInitParams (&mcanCfgParams);

/* Initialize the CANFD driver */
CLI_write("queueMCAN\n");
canHandle = CANFD_init(&mcanCfgParams, &errCode);
if (canHandle == NULL)
{
    	CLI_write ("Error: CANFD Module Initialization failed [Error code %d]\n", errCode);
        return -1;
}
CLI_write("queue2\n");

The outcome 9 out of 10 times everything works. One out of 10 times I see the final serial printout as "queueMCAN" and then the device does not function which implies to me it goes into CANFD_init() and never returns. I dug in there and found multiple of these potentially inifinite do while loops that I attempted to solve the TODO with a quick counter:

 MCAN_reset(baseAddr);

/* Wait while MCAN is in reset. TODO add timeout */
counter = 0; //USER CODE TO ATTEMPT TO KICK US OUT
do
{
	counter++; //USER CODE TO ATTEMPT TO KICK US OUT
	if (counter > 10000) { //USER CODE TO ATTEMPT TO KICK US OUT
	      *errCode = 35; //USER CODE TO PROVIDE A REASON
	      return (CANFD_Handle)NULL; //USER CODE TO ATTEMPT TO KICK US OUT
	}
} while (MCAN_isInReset(baseAddr) == 1U);

The result was no difference. I could not kick myself out of the function to the next serial print. Perhaps something else in this init function calls a loop or is lockign up somewhere. Also, when running a debug operation where I just load symbols in and cannot replicate the failure. I have to power cycle the device to create this issue. I am still trying to dig through it to see if there is a cause for the process hanging, but figured I should post it on here as well for some parallel support.

Thanks!

  • An update:

    I have found that this problem occurs more often with CAN traffic on the bus during initialization. If I remove all bus traffic, I cannot get this failure to occur.

  • Hi,

    If I understand correctly the environment:

    There is an application running on the IWR8643 that uses CAN to to communicate with a CAN bus.

    Do you use both CAN Tx/Rx communication?

    Which version of SDK are you using?

    Thank you

    Cesar

  • There is another device on the BUS that sends messages. It appears that if that(or any) bus events are occuring while this IWR initializes, there is a chance of locking up in that init function.

    The driver version from mmwave_sdk_version.h is

    #define MMWAVE_SDK_VERSION_BUILD 2
    #define MMWAVE_SDK_VERSION_BUGFIX 1
    #define MMWAVE_SDK_VERSION_MINOR 1
    #define MMWAVE_SDK_VERSION_MAJOR 3

    I have since tried to copy over all of the mmwave sdk/driver files from mmwave_sdk_03_03_00_03 to replace the project's local driver files. I have rebuilt and rerun with the same issue.

    #define MMWAVE_SDK_VERSION_BUILD 3
    #define MMWAVE_SDK_VERSION_BUGFIX 0
    #define MMWAVE_SDK_VERSION_MINOR 3
    #define MMWAVE_SDK_VERSION_MAJOR 3

  • Thank you

    It is possible there is a bug in the CAN driver.

    We have to discuss with the driver team how to further debug this issue.

    I will get back to you early next week

    Thank you

    Cesar

  • Cesar,

    Has there been any progress on this? Do you have an updated timeline when there might be some results?

    Thanks!