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.

IWR1843BOOST: CANBUS on IWR1843Boost

Part Number: IWR1843BOOST
Other Parts Discussed in Thread: IWR1843, AWR1642, , IWR1443BOOST

Hi,

I wanted to ask if there is an example of the IWR1843 using CAN communication. It seems there is a lab of "Object data over CAN" for the AWR1642 Boost. Mainly looking for a starting point. I am trying to extend the out of the box demo to send the data over CAN. Maybe there is some documentation or example for this.

Best,

Christoph

  • Hi Christoph,

    Yes, lab0005 in the Automotive Toolbox is one example of using CAN to transmit output data from the device.  Another, simpler example is in the CAN driver's test folder, ti\drivers\can\test\xwr18xx. From this you can see the CAN driver calls to initialize/configure the peripheral, and to read/write data.

     -dave

  • Thanks that helped a lot.

    I guess the lab0005 uses CAN-FD and I believe I can see messages on the canbus, however only on the oscilloscope, since my usb-can receiver is CAN2.0. I believe the CAN driver test uses CAN 2.0. I did not get that to work yet.

    I just wanted to ask if it is correct that the CAN driver test uses CAN 2.0 and work with the IWR1843Boost? Just to verify that the IWR1843 is compatible with CAN 2.0.

    Furthermore I worked with the IWR1443Boost in the past and remember that you had to move resistors in order to make can work on the PCB. Is that not the case for the IWR1843Boost? I can not find it in the documentation.

  • Yes, according to the TRM (TI document SWRU520c):

    • One DCAN controller supporting bit rates of up to 1 Mbit/s, and compliant to the controller area

    network (CAN) 2.0B protocol specification

  • ok that makes sense. For whatever reason I am not getting any messages out on the bus. I also probed before the CAN transceiver on the board, which seems to be low all the time, so I am sure the transceiver is ok.

    1. I am trying to run the can demo in ccs. Whenever the menu comes up and says

    [Cortex_R4_0] *******************************************************

    CAN Unit Test Menu                         

    Please select the type of test to execute: 

    1. DCAN Internal loopback test             

    2. DCAN External loopback test             

    3. DCAN Parity test                        

    4. DCAN Tx/Rx test                         

    *******************************************************

    I am trying to send 4 to the module, but that does not seem to work in the ccs console. Is there a way to send the selection to the module?

    2. I also converted and compiled the mmwave demo from the industrial toolbox to send CAN data. I attached my main to this post. It runs the configuration and supposingly sends frames on the canbus, at least no errors occur and the print statements show that it executed the canbus send calls. I was wondering if I maybe setup the cantx configuration wrong. I took that from the canbus driver, but am not 100% sure. I added this part here to have a simpler view than actually looking at the code.

       
    /*Intialize DCAN Config Params*/ dcanCfgParams->parityEnable = 0; dcanCfgParams->intrLine0Enable = 1; dcanCfgParams->intrLine1Enable = 1; dcanCfgParams->eccModeEnable = 0; dcanCfgParams->testModeEnable = 1; dcanCfgParams->testMode = CAN_DCANTestMode_EXT_LPBACK; dcanCfgParams->stsChangeIntrEnable = 1; dcanCfgParams->autoRetransmitDisable = 1; dcanCfgParams->autoBusOnEnable = 0; dcanCfgParams->errIntrEnable = 1; dcanCfgParams->autoBusOnTimerVal = 0; dcanCfgParams->if1DmaEnable = 0; dcanCfgParams->if2DmaEnable = 0; dcanCfgParams->if3DmaEnable = 0; dcanCfgParams->ramAccessEnable = 0; dcanCfgParams->appCallBack = DCANAppErrStatusCallback; /*Intialize DCAN tx Config Params*/ dcanTxCfgParams->xIdFlagMask = 0x1; dcanTxCfgParams->dirMask = 0x1; dcanTxCfgParams->msgIdentifierMask = 0x1FFFFFFF; dcanTxCfgParams->msgValid = 1; dcanTxCfgParams->xIdFlag = CAN_DCANXidType_11_BIT; dcanTxCfgParams->direction = CAN_Direction_TX; dcanTxCfgParams->msgIdentifier = 0xC1; //dcanTxCfgParams->msgIdentifier = 0x73; dcanTxCfgParams->uMaskUsed = 1; dcanTxCfgParams->intEnable = 1; dcanTxCfgParams->remoteEnable = 0; dcanTxCfgParams->fifoEOBFlag = 1; dcanTxCfgParams->appCallBack = DCANAppCallback; /*Intialize DCAN Rx Config Params*/ dcanRxCfgParams->xIdFlagMask = 0x1; //dcanRxCfgParams->msgIdentifierMask = 0x1FFFFFFF; dcanRxCfgParams->msgIdentifierMask = 0x0; dcanRxCfgParams->dirMask = 0x1; dcanRxCfgParams->msgValid = 1; dcanRxCfgParams->xIdFlag = CAN_DCANXidType_11_BIT; dcanRxCfgParams->direction = CAN_Direction_RX; //dcanRxCfgParams->msgIdentifier = 0xC1; dcanRxCfgParams->msgIdentifier = 0x99; dcanRxCfgParams->uMaskUsed = 1; dcanRxCfgParams->intEnable = 1; dcanRxCfgParams->remoteEnable = 0; dcanRxCfgParams->fifoEOBFlag = 1; dcanRxCfgParams->appCallBack = DCANAppCallback;

    
    

    6038.mss_main.c

  • If you are running the CAN example code in CCS you can just set a breakpoint at the while loop where it checks for the test number and set the variable manually.  You can also hardcode the test number that you want and rebuild the executable.  I have noticed what you have reported; I don't know if it's an issue with the console, or perhaps meant to come from UART....

    I would recommend getting the example code to work, so that you will know what you need for the mmw demo.

     -dave

  • Hi Dave,

    thanks for all the help.

    So I ran the different CAN bus driver tests on the IWR1843Boost. It seems like the DCAN Internal and external loopback test are working. Whereas, the Parity test fails and the DCAN RX/TX tests fails or gets stuck. During all tests I probed the CAN_H and CAN_L line and I get no data. The results in the terminal are as follows. 

    1. DCAN Internal loopback test

    [Cortex_R4_0] Debug: Internal loopback testing
    Debug: Number of iterations              : 100
    Debug: Number of messages transmitted    : 100
    Debug: Number of messages received       : 100
    Debug: Number of messages lost           : 0
    Debug: Number of data mismatch           : 0
    Debug: Error Status Interrupt            : 0
    
    
    Debug: Message object number             : 1
    Debug: Direction                         : Transmit
    Debug: Number of interrupts received     : 100
    Debug: Number of messages processed      : 100
    
    
    Debug: Message object number             : 2
    Debug: Direction                         : Receive
    Debug: Number of interrupts received     : 100
    Debug: Number of messages processed      : 100
    Debug: Receive & Transmit Measurements
    Debug: Rx Min:470 Max: 512 Average:470 ticks
    Debug: Tx Min:462 Max: 468 Average:462 ticks
    
    
    Debug: Internal loopback testing for 100 iterations Passed
    Feature: Internal loopback testing: Passed


    2. DCAN External loopback test

    [Cortex_R4_0] Debug: External loopback testing
    Debug: Number of iterations              : 100
    Debug: Number of messages transmitted    : 100
    Debug: Number of messages received       : 100
    Debug: Number of messages lost           : 0
    Debug: Number of data mismatch           : 0
    Debug: Error Status Interrupt            : 0
    
    
    Debug: Message object number             : 1
    Debug: Direction                         : Transmit
    Debug: Number of interrupts received     : 100
    Debug: Number of messages processed      : 100
    
    
    Debug: Message object number             : 2
    Debug: Direction                         : Receive
    Debug: Number of interrupts received     : 100
    Debug: Number of messages processed      : 100
    Debug: Receive & Transmit Measurements
    Debug: Rx Min:463 Max: 505 Average:463 ticks
    Debug: Tx Min:462 Max: 468 Average:462 ticks
    
    
    Debug: External loopback testing for 100 iterations Passed
    Feature: External loopback testing: Passed


    3. DCAN Parity test

    [Cortex_R4_0] Debug: parity testing
    Error: ECC error status check failed. Single bit error 0 Double bit error 1 Message Number 35
    Feature: Parity testing: Failed
    Debug:CAN testing failed


    4. DCAN Tx/Rx test

    [Cortex_R4_0] Debug: External transmit testing

    Is the parity test an indication on what is going wrong?

  • Hi Christoph,

    Sorry for the delay.  No, I don't think a parity test error would affect data on the bus.  If you run the lab0005 pre-built binary, or the  CAN test driver's Tx test, you should see data on the bus. I think you mentioned this in an earlier post.

     -dave