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/IWR1642: UART

Part Number: IWR1642
Other Parts Discussed in Thread: IWR6843

Tool/software: Code Composer Studio

  • Does the 1642 chip support serial data receiving? if the support,why is the data sent again every time it is received ? we never set the send function。

  • Hello JianFeng,

     

    Can you provide more information in regards to the application you are building? Referring to Section 5.10.3.1 of the IWR1642 datasheet, you can see that the device supports serial input/output for a serial bit stream. Please elaborate on what data is being sent and received.

     

    Regards,

     

    Peter

  • hello ,this is the  uart  initialization

    /* Open UART Driver: */
    UART_Params_init(&uartParams);
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.clockFrequency = MSS_SYS_VCLK;
    uartParams.baudRate = 115200;
    uartParams.isPinMuxDone = 1;

    /* Open the Command UART Instance */
    gSrrMSSMCB.commandUartHandle = UART_open(0, &uartParams);
    if (gSrrMSSMCB.commandUartHandle == NULL)
    {
    System_printf("Error: Unable to open the Command UART Instance\n");
    return;
    }

    this is the receive function :

    while(1)
    {
    uint8_t cjl[5];
    UART_read(gSrrMSSMCB.commandUartHandle, (uint8_t*)cjl,4);
    memset(cjl,0,5);
    }

     

  • Hi JianFeng,

     

    Are you using a lab from the industrial toolbox for reference? The IWR1642 features two COM ports: a User UART port used for sending commands to the device and a Data Port used for receiving bit stream data from the device. For reference, here is the UART code from the Out of Box Demo.

        /* Setup the default UART Parameters */
        UART_Params_init(&uartParams);
        uartParams.clockFrequency = gMmwMssMCB.cfg.platformCfg.sysClockFrequency;
        uartParams.baudRate       = gMmwMssMCB.cfg.platformCfg.commandBaudRate;
        uartParams.isPinMuxDone   = 1;
    
        /* Open the UART Instance */
        gMmwMssMCB.commandUartHandle = UART_open(0, &uartParams);
        if (gMmwMssMCB.commandUartHandle == NULL)
        {
            MmwDemo_debugAssert (0);
            return;
        }
    
        /* Setup the default UART Parameters */
        UART_Params_init(&uartParams);
        uartParams.writeDataMode = UART_DATA_BINARY;
        uartParams.readDataMode = UART_DATA_BINARY;
        uartParams.clockFrequency = gMmwMssMCB.cfg.platformCfg.sysClockFrequency;
        uartParams.baudRate       = gMmwMssMCB.cfg.platformCfg.loggingBaudRate;
        uartParams.isPinMuxDone   = 1U;
    
        /* Open the Logging UART Instance: */
        gMmwMssMCB.loggingUartHandle = UART_open(1, &uartParams);
        if (gMmwMssMCB.loggingUartHandle == NULL)
        {
            System_printf("Error: Unable to open the Logging UART Instance\n");
            MmwDemo_debugAssert (0);
            return;
        }
    

    Notice that there is a commandUartHandle and a loggingUartHandle. In reference to the receive function, here is reference code derived from the Gesture Recognition lab.

    uint8_t                 cmdString[256];
    memset ((void *)&cmdString[0], 0, sizeof(cmdString));
    UART_read (gCLI.cfg.cliUartHandle, &cmdString[0], (sizeof(cmdString) - 1));
    

    Please reference the Out of Box demo from the industrial toolbox if you wish to implement the UART_writePolling() function.

     

    Regards,

    Peter

  • hello ,now we  knew how to use two COM ports to send and receive message, if we want to use only one COM port to receive and send message ,how do we do?

  • Hi JianFeng,

     

    Can I ask why you would only want to use a single COM port? Using the sensor requires two COM ports, one to send the configuration information to the sensor and one to receive the stream data. An alternative approach would be to hardcode the chirp configuration onto the device so that it is able to start streaming data on bootup. This method only requires a single COM port to receive the stream data after the image binary has been flashed on the device.

    Information and steps on how to do this can be found in the mmWave doxygen. Additionally, we are releasing a new OOB demo for the IWR6843 in the next TIREX update that utilizes this hardcoded configuration method. Once that is available within the next 2 weeks, you could use the example code and take the same approach to bypass the CLI and hardcode the configuration onto your IWR 1642 device. If you have any further questions, do not hesitate to ask.

     

    Regards,

    Peter