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.

CC3220SF: UARTCC32XX_PIN_04_UART0_RX is not working

Part Number: CC3220SF

Hi I am trying to Use UART0 with GPIO12 and GPIO13 for TX and RX respectively.

But, no data is receiving in PIN04  or GPIO13. I wondered that same data is receiving in GPIO2 where I assigned GPIO13,  similarly GPIO1 & GPIO12 both are individually working for TX where I assigned GPIO12 for TX.

Can I know the magic behind this? and how to use GPIO13 as RX in UART0.

Thank you.

  • Hello,

    Could you share your initialization code? What peripherals is your application using?

    Jesu
  • Hi Jesu,

    I am using "simplelink_cc32xx_sdk_2_30_00_05" , please find the attach of my project.

    uartecho_CC3220SF_LAUNCHXL_tirtos_ccs.zip

    Thank you

  • Hello,

    You're using the UART DMA with the wrong pin mode macros. If you're going to use DMA you need UARTCC32XXDMA_PIN_04_UART0_RX not UARTCC32XX_PIN_04_UART0_RX.

    Jesu

  • Jesu,

    I am not using UART DMA.

    And for doubt I disabled the below part of code. it is working as I told in 1st post.

    #include <ti/drivers/UART.h>
    #if TI_DRIVERS_UART_DMA
    #include <ti/drivers/uart/UARTCC32XXDMA.h>
    

    //#include <ti/drivers/UART.h>
    //#if TI_DRIVERS_UART_DMA
    //#include <ti/drivers/uart/UARTCC32XXDMA.h>
    //
    //UARTCC32XXDMA_Object uartCC3220SDmaObjects[CC3220SF_LAUNCHXL_UARTCOUNT];
    //
    ///* UART configuration structure */
    //const UARTCC32XXDMA_HWAttrsV1 uartCC3220SDmaHWAttrs[CC3220SF_LAUNCHXL_UARTCOUNT] = {
    //    {
    //        .baseAddr = UARTA0_BASE,
    //        .intNum = INT_UARTA0,
    //        .intPriority = (~0),
    //        .flowControl = UARTCC32XXDMA_FLOWCTRL_NONE,
    //        .rxChannelIndex = UDMA_CH8_UARTA0_RX,
    //        .txChannelIndex = UDMA_CH9_UARTA0_TX,
    //        .rxPin = UARTCC32XX_PIN_04_UART0_RX,
    //        .txPin = UARTCC32XX_PIN_03_UART0_TX,
    //        .ctsPin = UARTCC32XXDMA_PIN_UNASSIGNED,
    //        .rtsPin = UARTCC32XXDMA_PIN_UNASSIGNED,
    //        .errorFxn = NULL
    //    },
    //    {
    //        .baseAddr = UARTA1_BASE,
    //        .intNum = INT_UARTA1,
    //        .intPriority = (~0),
    //        .flowControl = UARTCC32XXDMA_FLOWCTRL_NONE,
    //        .rxChannelIndex = UDMA_CH10_UARTA1_RX,
    //        .txChannelIndex = UDMA_CH11_UARTA1_TX,
    //        .rxPin = UARTCC32XXDMA_PIN_08_UART1_RX,
    //        .txPin = UARTCC32XXDMA_PIN_07_UART1_TX,
    //        .ctsPin = UARTCC32XXDMA_PIN_UNASSIGNED,
    //        .rtsPin = UARTCC32XXDMA_PIN_UNASSIGNED,
    //        .errorFxn = NULL
    //    }
    //};
    //
    //const UART_Config UART_config[CC3220SF_LAUNCHXL_UARTCOUNT] = {
    //    {
    //        .fxnTablePtr = &UARTCC32XXDMA_fxnTable,
    //        .object = &uartCC3220SDmaObjects[CC3220SF_LAUNCHXL_UART0],
    //        .hwAttrs = &uartCC3220SDmaHWAttrs[CC3220SF_LAUNCHXL_UART0]
    //    },
    //    {
    //        .fxnTablePtr = &UARTCC32XXDMA_fxnTable,
    //        .object = &uartCC3220SDmaObjects[CC3220SF_LAUNCHXL_UART1],
    //        .hwAttrs = &uartCC3220SDmaHWAttrs[CC3220SF_LAUNCHXL_UART1]
    //    }
    //};
    //
    //#else

    Thank you  

  • Glad I could help - closing thread.
  • Hi Jesu,
    I said the issue is not solved. I am using the "uartecho" project from SDK "simplelink_cc32xx_sdk_2_30_00_05"
    I changed nothing other than UART TX and RX pins.
    Thank you
  • Hello,

    My mistake, I thought you said it is working. I'm not sure what you did wrong but I get it working with no problem. I just imported uartecho and changed pins like you did. I thought you were using DMA because you updated the rx/tx pins structure for UART DMA in your file incorrectly. Try importing a fresh example and do it again.

    Jesu
  • 1261.uartecho_CC3220SF_LAUNCHXL_tirtos_ccs.zipHi Jesu,

    Please find my project in attach. I imported new project, but the same issue.

    By wrong click I entered resolved but not yet.

    Thank you.

  • Hello,

    I cannot re-create your problem. I copied your CC3220SF_LAUNCHXL.c to my project and it still works. Did you make changes anywhere else? Are you sure your terminal is set to the proper baud rate? When the program starts does it print "Echoing characters:"?

    Jesu
  • We were lucky enough to find this thread. We are having the exact same issue on the 3220S LaunchXL. We are also trying to move UART0 from pins 55 and 57 to pins 3 and 4. And, we are seeing pin 3 data output. We are also not using DMA.

    We are able to see transmissions from uart tx (pin 3) using our logic analyzer, but the uart rx (pin 4) does not receive the data when they are jumpered together. 

    Here is out UART configuration:

    *
     *  =============================== UART ===============================
     */
    #include <ti/drivers/UART.h>
    #include <ti/drivers/uart/UARTCC32XX.h>
    
    UARTCC32XX_Object uartCC3220SObjects[CC3220S_LAUNCHXL_UARTCOUNT];
    unsigned char uartCC3220SRingBuffer[CC3220S_LAUNCHXL_UARTCOUNT][256];
    
    /* UART configuration structure */
    const UARTCC32XX_HWAttrsV1 uartCC3220SHWAttrs[CC3220S_LAUNCHXL_UARTCOUNT] = {
        {.baseAddr = UARTA0_BASE,
         .intNum = INT_UARTA0,
         .intPriority = (~0),
         .flowControl = UARTCC32XX_FLOWCTRL_NONE,
         .ringBufPtr = uartCC3220SRingBuffer[CC3220S_LAUNCHXL_UART0],
         .ringBufSize = sizeof(uartCC3220SRingBuffer[CC3220S_LAUNCHXL_UART0]),
         .rxPin = UARTCC32XX_PIN_04_UART0_RX,
         .txPin = UARTCC32XX_PIN_03_UART0_TX,
         .ctsPin = UARTCC32XX_PIN_UNASSIGNED,
         .rtsPin = UARTCC32XX_PIN_UNASSIGNED,
         .errorFxn = NULL},
        {.baseAddr = UARTA1_BASE,
         .intNum = INT_UARTA1,
         .intPriority = (~0),
         .flowControl = UARTCC32XX_FLOWCTRL_NONE,
         .ringBufPtr = uartCC3220SRingBuffer[CC3220S_LAUNCHXL_UART1],
         .ringBufSize = sizeof(uartCC3220SRingBuffer[CC3220S_LAUNCHXL_UART1]),
         .rxPin = UARTCC32XX_PIN_08_UART1_RX,
         .txPin = UARTCC32XX_PIN_07_UART1_TX,
         .ctsPin = UARTCC32XX_PIN_UNASSIGNED,
         .rtsPin = UARTCC32XX_PIN_UNASSIGNED,
         .errorFxn = NULL}};
    
    const UART_Config UART_config[CC3220S_LAUNCHXL_UARTCOUNT] = {
        {.fxnTablePtr = &UARTCC32XX_fxnTable,
         .object = &uartCC3220SObjects[CC3220S_LAUNCHXL_UART0],
         .hwAttrs = &uartCC3220SHWAttrs[CC3220S_LAUNCHXL_UART0]},
        {.fxnTablePtr = &UARTCC32XX_fxnTable,
         .object = &uartCC3220SObjects[CC3220S_LAUNCHXL_UART1],
         .hwAttrs = &uartCC3220SHWAttrs[CC3220S_LAUNCHXL_UART1]}};
    
    const uint_least8_t UART_count = CC3220S_LAUNCHXL_UARTCOUNT;
    

    We did notice that Capture config was using pin_04, but removing that configuration did not solve the problem.

    Any ideas not previously mentioned in this thread?

  • In addition, I should mention, that when we use UART1 with pins UARTCC32XX_PIN_07_UART1_TX and UARTCC32XX_PIN_08_UART1_TX work fine
  • Hi Jesu,
    I am getting "Echoing characters:" print. And also I can print any characters before "UART_read(uart, &input, 1);" call. I checked in debug mode this function call is not returning anything and SW is stopping at this call.

    Raghunandana
  • Hi Christopher,
    Working fine with all other UART supported pins except UARTCC32XX_PIN_04_UART0_RX. I tried with external Pull-down and/or Pull-up also, no progress.
  • Chris,

    The issue here is that the RX pin (Pin04) is being pulled down elsewhere on the launchpad. You will need to remove R141 to get RX working correctly.

    Best Regards,

    Vince

  • Hey Vince,

    We tried removing the resistor but the uart still will not read any data. If we look at our logic analyzer, the data appears to show on pin 4 without any problems, but UART_read still never reads any data. We tried Pins 7 and 8 on UART1 again and it still works just fine, but due to our project constraints, we can only use pins 3 and 4.

    Is there additional configuration that is needed? We tried using the PinMux tool to recreate our configuration, but still no luck.

    Thanks,

    Chris

  • Hey Chris,

    Found the issue.

    Root Cause - 

    Pin 55 and Pin 57 get configured by default on boot to UART0 TX and RX, respectively. inside the PRCM init() function, we should be taking care of this by determining if these pins are configured in UART mode and unconfigure them. This does not occur correctly, and the pins are thus left muxed to our UART peripheral which causes issues if you want to use your other pins (4 & 5). I have reported this bug to our R&D and should get updated in future SDK releases.

    Solution - Multiple Options

    Option 1 - Fix the PRCM.c init function

    To do this, copy the PRCM.c from your SDK into your project, and go to the PRCMCC3200MCUInit() function. (Line 1881)

    Change this:

        //
        // Change UART pins(55,57) mode to PIN_MODE_0 if they are in PIN_MODE_1
        //
        if (PinModeGet(PIN_55) == PIN_MODE_1)
        {
            PinModeSet(PIN_55,PIN_MODE_0);
        }
        if (PinModeGet(PIN_57) == PIN_MODE_1)
        {
            PinModeSet(PIN_57,PIN_MODE_0);
        }

    To:

        //
        // Change UART pins(55,57) mode to PIN_MODE_0 if they are in PIN_MODE_1
        //
        if (PinModeGet(PIN_55) == PIN_MODE_3)
        {
            PinModeSet(PIN_55,PIN_MODE_0);
        }
        if (PinModeGet(PIN_57) == PIN_MODE_3)
        {
            PinModeSet(PIN_57,PIN_MODE_0);
        }

    Option 2: Configure pin 55 and 57 as something else

    You can include these pins in your GPIO config, and then as long as you call GPIO_init(), these pins will be reconfigured.

    Option 3: Perform a Driverlib call to manually reconfigure pins

     Add the following code after your UART_init() function:

    /* Call driver init functions */
        UART_init();
        MAP_PinTypeUART(PIN_57, PIN_MODE_0);

    And add the following header files:

    #include <ti/devices/cc32xx/inc/hw_types.h>
    #include <ti/devices/cc32xx/driverlib/pin.h>
    #include <ti/devices/cc32xx/driverlib/rom_map.h>

    Hope that helps,

    Vince