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.

IWR6843ISK: Issues when handling mutliple sensors on one can bus

Part Number: IWR6843ISK

Tool/software:

Hello,

I have connected multiple ISKs on one can bus and I am able to receive data from the sensors with no problems after setting the following values:

mcanCfgParams->errInterruptEnable = 0U 

mcanCfgParams->dataInterruptEnable = 0U

However, I am now unable to send any data to the sensors. A fellow e2e user mentioned in this thread that they found a configuration that they can use to both send and receive from multiple sensors.

I'd like to know the exact values I need to set in the config.

Any help is greatly appreciated

 

  • Hey Rami,

    Thanks for reaching out about using CAN on our devices. I will need some more insight into how you are transmitting and receiving data. What is your current mcanCfgParams, mcanBitTimingParams, and rxMsgObjectParams and txMsgObjectParams? When receiving, are you polling for a change in the NDAT register or the FIFO status register?

    Have you taken a look through the user guide and example project included in the Radar Toolbox CAN Integration Guide? There's a couple useful bits of information on using the CAN driver under the CAN Integration for SDK 3 Devices section. This has been tested to transmit and receive CAN data, though only on a bus with two CAN nodes including the 6843 itself.

    Regards,

    Kristien

  • Hello Kristien,

    thank you for your reply. These are are the current settings I am using:

        mcanCfgParams->fdMode                            = 0x1U;
        mcanCfgParams->brsEnable                         = 0x1U;
        mcanCfgParams->txpEnable                         = 0x0U;
        mcanCfgParams->efbi                              = 0x0U;
        mcanCfgParams->pxhddisable                       = 0x0U;
        mcanCfgParams->darEnable                         = 0x1U;
        mcanCfgParams->wkupReqEnable                     = 0x1U;
        mcanCfgParams->autoWkupEnable                    = 0x1U;
        mcanCfgParams->emulationEnable                   = 0x0U;
        mcanCfgParams->emulationFAck                     = 0x0U;
        mcanCfgParams->clkStopFAck                       = 0x0U;
        mcanCfgParams->wdcPreload                        = 0x0U;
        mcanCfgParams->tdcEnable                         = 0x1U;
        mcanCfgParams->tdcConfig.tdcf                    = 0U;
        mcanCfgParams->tdcConfig.tdco                    = 8U;
        mcanCfgParams->monEnable                         = 0x0U;
        mcanCfgParams->asmEnable                         = 0x0U;
        mcanCfgParams->tsPrescalar                       = 0x0U;
        mcanCfgParams->tsSelect                          = 0x0U;
        mcanCfgParams->timeoutSelect                     = CANFD_MCANTimeOutSelect_CONT;
        mcanCfgParams->timeoutPreload                    = 0x0U;
        mcanCfgParams->timeoutCntEnable                  = 0x0U;
        mcanCfgParams->filterConfig.rrfe                 = 0x1U;
        mcanCfgParams->filterConfig.rrfs                 = 0x1U;
        mcanCfgParams->filterConfig.anfe                 = 0x1U;
        mcanCfgParams->filterConfig.anfs                 = 0x1U;
        mcanCfgParams->msgRAMConfig.lss                  = 127U;
        mcanCfgParams->msgRAMConfig.lse                  = 64U;
        mcanCfgParams->msgRAMConfig.txBufNum             = 32U;
        mcanCfgParams->msgRAMConfig.txFIFOSize           = 0U;
        mcanCfgParams->msgRAMConfig.txBufMode            = 0U;
        mcanCfgParams->msgRAMConfig.txEventFIFOSize      = 0U;
        mcanCfgParams->msgRAMConfig.txEventFIFOWaterMark = 0U;
        mcanCfgParams->msgRAMConfig.rxFIFO0size          = 0U;
        mcanCfgParams->msgRAMConfig.rxFIFO0OpMode        = 0U;
        mcanCfgParams->msgRAMConfig.rxFIFO0waterMark     = 0U;
        mcanCfgParams->msgRAMConfig.rxFIFO1size          = 64U;
        mcanCfgParams->msgRAMConfig.rxFIFO1waterMark     = 64U;
        mcanCfgParams->msgRAMConfig.rxFIFO1OpMode        = 64U;
        mcanCfgParams->eccConfig.enable                  = 1;
        mcanCfgParams->eccConfig.enableChk               = 1;
        mcanCfgParams->eccConfig.enableRdModWr           = 1;
        mcanCfgParams->errInterruptEnable                = 1U;
        mcanCfgParams->dataInterruptEnable               = 1U;
        mcanCfgParams->appErrCallBack                    = sblErrStatusCallback;
        mcanCfgParams->appDataCallBack                   = sblDataCallback;

        mcanBitTimingParams.nomBrp     = 0x2U;
        mcanBitTimingParams.nomPropSeg = 0x8U;
        mcanBitTimingParams.nomPseg1   = 0x6U;
        mcanBitTimingParams.nomPseg2   = 0x5U;
        mcanBitTimingParams.nomSjw     = 0x1U;
    
        mcanBitTimingParams.dataBrp     = 0x1U;
        mcanBitTimingParams.dataPropSeg = 0x2U;
        mcanBitTimingParams.dataPseg1   = 0x2U;
        mcanBitTimingParams.dataPseg2   = 0x3U;
        mcanBitTimingParams.dataSjw     = 0x1U;

        /* Setup the receive message object for receiving data packets. */
        rxMsgObject2Params.direction     = CANFD_Direction_RX;
        rxMsgObject2Params.msgIdType     = CANFD_MCANXidType_11_BIT;
        rxMsgObject2Params.msgIdentifier = SBL_CANFD_DATA_MSG_ID;
        rxMsgObj2Handle                  = CANFD_createMsgObject(canHandle, &rxMsgObject2Params, &errCode);
        if (rxMsgObj2Handle == NULL)
        {
            SBL_printf("Error: CANFD create Rx message object failed [Error code %d]\n", errCode);
            return;
        }
        /* Setup the receive message object for receiving terminate packets. */
        rxMsgObject3Params.direction     = CANFD_Direction_RX;
        rxMsgObject3Params.msgIdType     = CANFD_MCANXidType_11_BIT;
        rxMsgObject3Params.msgIdentifier = SBL_CANFD_TERMINATE_MSG_ID;
        rxMsgObj3Handle                  = CANFD_createMsgObject(canHandle, &rxMsgObject3Params, &errCode);
        if (rxMsgObj3Handle == NULL)
        {
            SBL_printf("Error: CANFD create Rx message object failed [Error code %d]\n", errCode);
            return;
        }
    
        /* Setup the receive message object for receiving start packets. */
        rxMsgObject4Params.direction     = CANFD_Direction_RX;
        rxMsgObject4Params.msgIdType     = CANFD_MCANXidType_11_BIT;
        rxMsgObject4Params.msgIdentifier = SBL_CANFD_START_MSG_ID;
        rxMsgObj4Handle                  = CANFD_createMsgObject(canHandle, &rxMsgObject4Params, &errCode);
        if (rxMsgObj4Handle == NULL)
        {
            SBL_printf("Error: CANFD create Rx message object failed [Error code %d]\n", errCode);
            return;
        }

    As for sending the data, I am using the following code on my microcontroller:

    #include <linux/can.h>
    #include <linux/can/raw.h>
        
    bool sendFrame(const canfd_frame &frame) {
        if (write(sock_, &frame, sizeof(struct canfd_frame)) < 0) {
            return false;
        }
        return true;
    }

    When receiving, are you polling for a change in the NDAT register or the FIFO status register?

    No, I am not sure what you mean by that. Would you mind explaining it?

    Have you taken a look through the user guide and example project included in the Radar Toolbox CAN Integration Guide?

    Thanks for the hint, I will check it out.

    Thanks again for your help.

  • Hey Rami,

    Thank you for sending over the requested information! I will need some more time to review what you've sent, but I will send you an update tomorrow. Regarding the polling comment, in your post, you mentioned that the data and error interrupt enables were set to zero which would mean that receiving a message would not trigger an interrupt. As such, I thought you could have been using a polling method - i.e., continuously checking - for monitoring the NDAT register (New Data - triggered by a buffer receiving new data) or the FIFO status register (fill level should increase when a message has been received).

    Regards,

    Kristien

  • Hello Kristien,

    thanks for the info. I am not familiar with neither NDAT nor FIFO registers, but I will take a deeper look.

    Did you check the code snippets I sent you? Any helpful insight you can provide on what needs to be changed?

    Thanks

    Rami

  • Hey Rami,

    I took a look over the code snippets you sent over and can't find anything inherently wrong, but there are a few things we can look into. First of all, with your data bit timing parameters, I noticed you used a different sampling point, 62.5%, from the nominal sampling point, 75%. Was there a particular reason for the decrease in sampling point? Many timing factors such as the bit rate and sampling point are dependent upon bus topology. For example, as bus length increases, bit rate should decrease and sampling point should increase. A sampling point of 87.5% for data and nominal timing is commonly recommended.

    This also leads me to another question: have you verified the following?

    • Both ends of the CAN line should be terminated with a 120 ohm resistor between the CAN low and CAN high lines to prevent reflections from impedance mismatching
    • Ensure all nodes are set to the same timing parameters - i.e. bit rate, propogation segment, phase segments, sync jump width, prescalar, etc.

    If the previous comments have been accounted for, I would recommend taking an oscilloscope or logic analyzer directly to the CAN bus to see if signals are propagating correctly - i.e., correct voltage levels, bit timings, message acknowledgements, etc.

    Regards

    Kristien

  • Hello Kristien,

    sorry for the late reply. I managed to find a solution by setting the following values:

    mcanCfgParams->filterConfig.anfe = 0x3U;
    mcanCfgParams->filterConfig.anfs = 0x3U;
    Thanks for your help!
  • Hey Rami,

    I'm glad I was able to offer some assistance! To help out others who might be having this problem, could you post the complete mcanCfgParams that worked for you? Did you only have to change the non-matching frame filter GFC fields compared to the mcanCfgParams you posted or were there other changes in software or hardware setup since last time?

    Regards,

    Kristien