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.

CC2640R2F: How to modify low level UART driver

Part Number: CC2640R2F

Hi team,

For specific usage, my customer wants to modify low level UART driver. They refer to MSP432 drivers and implement below code into CC2640R2 project. By run-time debug, the code “Uart0Config()” is really executed. However, the Uart0Int() is not called when user input character from terminal (input UART raw data).

 

void Uart0Config()

     PRCMPeripheralRunEnable(PRCM_PERIPH_UART0);

     PRCMPeripheralSleepEnable(PRCM_PERIPH_UART0);

     PRCMPeripheralDeepSleepEnable(PRCM_PERIPH_UART0);

     PRCMLoadSet();

     while (!PRCMLoadGet()) {}

         ;

     IOCPinTypeUart(UART0_BASE, IOC_PORT_MCU_UART0_RX, IOC_PORT_MCU_UART0_TX,IOC_PORT_MCU_UART0_CTS,IOC_PORT_MCU_UART0_RTS);

                 //  uint32_t ui32Cts, uint32_t ui32Rts)

     UARTConfigSetExpClk(UART0_BASE,PRCMInfClockConfigureGet(PRCM_RUN_MODE),

                  UART_BAUD_RATE0, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |

                   UART_CONFIG_PAR_NONE)); //UART_CONFIG_PAR_NONE

     UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX4_8,UART_FIFO_RX7_8);

     UARTHwFlowControlEnable(UART0_BASE);

 

     UARTIntRegister(UART0_BASE, Uart0Int);

     IntPrioritySet(INT_UART0_COMB, 0x6<<5);

 

 

     UARTIntEnable(UART0_BASE, UART_INT_RX| UART_INT_RT |UART_INT_OE|UART_INT_BE|UART_INT_PE | UART_INT_FE );//

     IntEnable(INT_UART0_COMB);

}

 

void Uart0Int()

{

     //No enter here;

     …

}

  • Hi Jerry,

    The customer should be referring to UART.c/h files and the uart folder (specifically UARTCC26XX.c/h files) from <SimpleLink CC2640R2 SDK directory>\source\ti\drivers to develop their low-level UART driver.  These files can even be imported into their project and used/modified directly to bypass the pre-built UART TI Driver.  I expect there would be differences between this platform and the MSP432 which causes issues.

    Regards,
    Ryan