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.

How to enable UART functionality for TIMAC sample application?

Other Parts Discussed in Thread: CC2530, TIMAC, Z-STACK

I am using sample project from TIMAC 1.5.2.43299 on CC2530. How can I enable serial interface functionality to be able receive and transmit data? I checked documentation and found other recommendations by link below, but documented API seems not straightforward for me and so far I didn't succeed with it. Is there any samples like for Z-Stack or some application note? I need something quick and dirty just for proof of concept. At least to be able to pass through raw data received from ZigBee to UART interface. Maybe there is some logging functionality, which can be utilized?

  • Why not use the same code (init, write, read, etc) for UART used in the CoP firmware? It uses the hal drivers that come with the TIMAC stack. As for documentation, refer to the "HAL DRIVER API.pdf" document located in the following folder:

    • C:\Texas Instruments\TIMAC 1.5.2.43299\Documents\API

    What you need to do:

    1. Call HalUARTInit();
    2. Define and configure your IOs
    3. Configure your UART driver
    halUARTCfg_t uartConfig;
    
    // Example configuration. Refer to HAL DRIVER API documentation for all options
    uartConfig.configured           = TRUE;
    uartConfig.baudRate             = 0x01; // check hal_uart.h for valid values
    uartConfig.flowControl          = FALSE; //you can change this to true if you need flow control
    uartConfig.intEnable            = TRUE;
    uartConfig.callBackFunc         = npUartCback;
    HalUARTOpen(UART_PORT, &uartConfig);
    
    // To write to uart once it is open
    uint16 len = HalUARTWrite(UART_PORT, pMsg, UartTxCnt);

    Regards,

    Michel

    EDIT: for the IOs, you can re-use the ones that are configured in hal_board_cfg.h