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.

CC2642R: When calling the UART serial port to write a string, the pin has no waveform output.

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG, SIMPLELINK-CC13XX-CC26XX-SDK, LAUNCHXL-CC26X2R1

Hi team,

Here's the request from the customer:

The related configuration of uart in sysconfig is shown in the following figure:

The relevant code in simple_central.c is as follows, the pin 25 is connected to the LED, the light will flash during the cycle, but the uart tx has no waveform at all, and there is no waveform after changing several pins as tx. Is there any error in my code and settings?

 

Could you help check this case? Thanks.

Best Regards,                                                            

Nick    

  • Hello Nick,

    The customer needs to make sure that their UART TI Driver setup does not interfere with the UART peripheral or TX/RX pins initialized by the UART2 TI Driver in SysConfig.  As the warnings suggest, they will also need to remove the XDS110 RX/TX jumpers if they do not plan to use the backchannel UART connection.  Also, please note that the UART TI Driver was deprecated and replaced by UART2 in the SIMPLELINK-CC13XX-CC26XX-SDK v6.20 as stated in the Release Notes.  They can reference the UART to UART2 Porting Guide from the BLE5-Stack Migration Guide and TI Drivers Runtime APIs.

    Regards,
    Ryan

  • Hi Ryan,

    Customer replied that I was not using the UART2 module in sysconfig, should he use UART2 instead of UART?

    More details shown in the following figure:

    • Code:
      //UART2 param
      UART2_Params_init(&uartParams);
      uartParams.readMode = UART2_Mode_BLOCKING;
      uartParams.writeMode = UART2_Mode_CALLBACK;
      uartParams.writeCallback = UART2Write_Callback;
      
      //UART2_write() callback function
      void UART2Write_Callback(UART2_Handle handle, void *buf, size_t count, void *userArg, int_fast16_t status){
          PIN_setOutputValue(pinHandle, LED_PIN, 0);
          return;
      }
      The on and off of the LED is normal, but the serial port still has no output
    • Initialization code:
      UART2_Params_init(&uartParams);
      uartParams.readMode = UART2_Mode_BLOCKING;
      uartParams.writeMode = UART2_Mode_CALLBACK;
      uartParams.writeCallback = UART2Write_Callback;
      uartParams.baudRate = 256000;
            
            // Open an instance of the UART drivers
      uart = UART2_open(0, &uartParams);
      if (uart == NULL) {
          // UART_open() failed
          while (1);
      }
    • Sysconfig configuration for UART2:
    • When customer debug, the return result of UART2_write() is stored in the status variable and the value of this variable is 0. Is it successful? But the serial port debugging assistant doesn't show any output.

    Regards and thanks,

    Nick

  • I suggest using UART2 unless there is a need for the BLE5-Stack’s NPI.  Nothing appears incorrect from looking at their initialization code.  A zero being returned by UART2_write indicates a UART2_STATUS_SUCCESS.  This could be a hardware issue, is the customer using a LAUNCHXL-CC26X2R1 or custom PCB?  Have they tried using different DIOs for the RX/TX pins in SysConfig or do they need to select "Use Custom Board"?  They should verify that the uart2callback example works as expected.

    Note: the PIN TI Driver has also been replaced with GPIO.  Please see "What's New" in the SDK Release Notes.

    Regards,
    Ryan

  • Hi Ryan,

    Customer used the custom PCB, and tried different pins for TX, but no serial data output on any of the pins.

    Regards.

    Nick

  • Has the customer confirmed that their custom PCB works with a default TI Driver UART example?  Next, they should make sure that the existing UART display module used on the simple_central example is disabled by defining Display_DISABLE_ALL, this would ensure that there is no conflict.  What is the return status of UART2_write and during the UART2Write_Callback?

    Regards,
    Ryan

  • Hi Ryan,

    Customer has some question about the example uart2callback. Syscfg cannot pass parameters normally and report error:

    Error parsing CLI arguments in script file: Error: Unrecognized argument: --rtos

    Than he said ccs cannot import the sysconfig given by the example and build failed but the return status of UART2_write is SUCCESS.

    Best Regard,

    Nick

  • What version of CCS, SIMPLELINK-CC13XX-CC26XX-SDK, XDCTools, and SysConfig are they using?  They can check under Project Properties->General->Products.

    Regards,
    Ryan

  • Hi Ryan,

    I will ask customer for details about version.

    What's more, could you please check this circuit diagram from customer, he tested the pin of CC2642 and found that the TX pin of the serial port has no waveform at all, and there is no waveform after replacing several pins as TX.

    Best Regard and Thanks,

    Nick

  • You had earlier stated that they could get LEDs to flash in accordance with their firmware, this would confirm that the main core is active and running.  Nothing appears out of the ordinary in their schematic at first glance, but there could also be an issue with their layout.  They should apply to SIMPLELINK-2-4GHZ-DESIGN-REVIEWS for further review.  I would expect they could build uart2callback if they have simple_peripheral working, you could also try a UART TI Driver example if it is available as a proof of hardware operation.

    Regards,
    Ryan

  • Hi Ryan,

    Which SDK version is recommended due to customer tried the latest version before but there are some problems that he can't solve when burning.

    Best Regard and Thanks,

    Nick

  • The latest SIMPLELINK-CC13XX-CC26XX-SDK is recommended, which is currently v6.20.  What issues can they not solve when programming?  This could again indicate a problem with their custom board layout.  SWRA640

    Regards,
    Ryan