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/MSP-EXP432E401Y: Using CAN in network_terminal

Part Number: MSP-EXP432E401Y
Other Parts Discussed in Thread: BOOSTXL-CC3135

Tool/software: Code Composer Studio

Hi,

i want to use CAN in network_terminal in order to transmit CAN-data via Wi-Fi. After inserting some CAN-code to network_terminal, i recognized that i need to place the jumpers JP4 and JP5 in horizontal position for using PA0 & PA1 for CAN. But then i can no longer see the network_terminal text in the console because i think it uses UART0 but with the switched jumpers it is no longer connected. So i have to change the UART0 from network_terminal to UART2(?) or using the other CAN output. Is this correct so far?

I don't know which one is easier to change and i'm not sure where and what to change in the cde for that. For the CAN-configuration i use parts of the CAN-code from the can_singlemessage_transmit/receive examples.

edit: for Wi-Fi i use the BOOSTXL-CC3135

Regards

Christoph

  • Hi Christoph,

    Let me run this by our MSP432 CAN experts.

  • Hi Christoph,

    In section 2.1.6.2 in the user guide for the LaunchPad explains which UART you need to use if you want CAN.

  • Hi Dennis,

    Thanks so far. Now i'm trying to modify the network_terminal example to use UART2 instead of UART0. I already added and modified some code for this but it's not working. What i added/modified:

    In uart_term.c i now use Board_UART2 :

    UART_Params uartParams;
    
        UART_init();
        UART_Params_init(&uartParams);
    
        uartParams.writeDataMode = UART_DATA_BINARY;
        uartParams.readDataMode = UART_DATA_BINARY;
        uartParams.readReturnMode = UART_RETURN_FULL;
        uartParams.readEcho = UART_ECHO_OFF;
        uartParams.baudRate = 115200;
    
        uartHandle = UART_open(Board_UART2, &uartParams);

    In board.h i added:

    #define Board_UART2                 MSP_EXP432E401Y_UART2

    In MSP_EXP432E401Y.h i added UART1 and UART2:

    typedef enum MSP_EXP432E401Y_UARTName
    {
        MSP_EXP432E401Y_UART0 = 0,
        MSP_EXP432E401Y_UART1,
        MSP_EXP432E401Y_UART2,
    
        MSP_EXP432E401Y_UARTCOUNT
    } MSP_EXP432E401Y_UARTName;

    In MSP_EXP432E401Y.c i added the code for UART1 and UART2:

    /* UART configuration structure */
    const UARTMSP432E4_HWAttrs uartMSP432E4HWAttrs[MSP_EXP432E401Y_UARTCOUNT] = {
        {
            .baseAddr = UART0_BASE,
            .intNum = INT_UART0,
            .intPriority = (~0),
            .flowControl = UARTMSP432E4_FLOWCTRL_NONE,
            .ringBufPtr = uartMSP432E4RingBuffer[MSP_EXP432E401Y_UART0],
            .ringBufSize = sizeof(uartMSP432E4RingBuffer[MSP_EXP432E401Y_UART0]),
            .rxPin = UARTMSP432E4_PA0_U0RX,
            .txPin = UARTMSP432E4_PA1_U0TX,
            .ctsPin = UARTMSP432E4_PIN_UNASSIGNED,
            .rtsPin = UARTMSP432E4_PIN_UNASSIGNED
        },
        {
            .baseAddr = UART1_BASE,
            .intNum = INT_UART1,
            .intPriority = (~0),
            .flowControl = UARTMSP432E4_FLOWCTRL_NONE,
            .ringBufPtr = uartMSP432E4RingBuffer[MSP_EXP432E401Y_UART1],
            .ringBufSize = sizeof(uartMSP432E4RingBuffer[MSP_EXP432E401Y_UART1]),
            .rxPin = UARTMSP432E4_PB0_U1RX,
            .txPin = UARTMSP432E4_PB1_U1TX,
            .ctsPin = UARTMSP432E4_PIN_UNASSIGNED,
            .rtsPin = UARTMSP432E4_PIN_UNASSIGNED
        },
        {
            .baseAddr = UART2_BASE,
            .intNum = INT_UART2,
            .intPriority = (~0),
            .flowControl = UARTMSP432E4_FLOWCTRL_NONE,
            .ringBufPtr = uartMSP432E4RingBuffer[MSP_EXP432E401Y_UART2],
            .ringBufSize = sizeof(uartMSP432E4RingBuffer[MSP_EXP432E401Y_UART2]),
            .rxPin = UARTMSP432E4_PD4_U2RX,
            .txPin = UARTMSP432E4_PD5_U2TX,
            .ctsPin = UARTMSP432E4_PIN_UNASSIGNED,
            .rtsPin = UARTMSP432E4_PIN_UNASSIGNED
            },
    };
    
    const UART_Config UART_config[MSP_EXP432E401Y_UARTCOUNT] = {
        {
            .fxnTablePtr = &UARTMSP432E4_fxnTable,
            .object = &uartMSP432E4Objects[MSP_EXP432E401Y_UART0],
            .hwAttrs = &uartMSP432E4HWAttrs[MSP_EXP432E401Y_UART0]
        },
        {
            .fxnTablePtr = &UARTMSP432E4_fxnTable,
            .object = &uartMSP432E4Objects[MSP_EXP432E401Y_UART1],
            .hwAttrs = &uartMSP432E4HWAttrs[MSP_EXP432E401Y_UART1]
        },
        {
            .fxnTablePtr = &UARTMSP432E4_fxnTable,
            .object = &uartMSP432E4Objects[MSP_EXP432E401Y_UART2],
            .hwAttrs = &uartMSP432E4HWAttrs[MSP_EXP432E401Y_UART2]
        },
    };

    In addition i get the following error on the console:

    Is there still something missing or wrong with the code what i did so far? There are no errors when compiling.

    Regards

    Christoph

  • Hi,

    i succesfully switched the CAN configuration to CAN1, so i can still use the UART0 in network_terminal. Thanks.

    Regards

    Christoph

**Attention** This is a public forum