CC2652RSIP: CC2652RSIP UART

Part Number: CC2652RSIP

Tool/software:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/** CODE**/
/***** Includes *****/
/* Standard C Libraries */
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <ti/drivers/timer.h>
/* TI Drivers */
#include <ti/drivers/rf/RF.h>
#include <ti/drivers/GPIO.h>
/* Driverlib Header files */
#include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h)
/* Board Header files */
#include "ti_drivers_config.h"
#include "RFQueue.h"
#include <ti_radio_config.h>
#include <ti/drivers/UART2.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Here i am using  uart function and button function 

first I am reading a data from Uart base on that i do switch case 

case 1 :0x0a is uart read data 

case 2: 0x0b is button data 

case 3: 0x0c is uart write data 

my question is case is 0x0b is working when i switch to case 0x0a  then uart is not reading any data it seems that gpio is only in read mode  . Plese hepl me in this condition 

  • Hi Kumaravel,

    You will need to provide greater detail as to your project's behavior and Debugging efforts that have been performed thus far.

    There is a UART2_read before and during the 0x0A case based on the value of input[1].  As UART2 is in blocking mode by default then UART2_read will wait for 10 bytes before 0x0A and then 10 bytes after entering the case, or 20 bytes in total.  There is no timeout or cancel functionality built into the current code provided.  Please further investigate the UART2 documentation and ensure that the expected number of bytes are being transferred to the device, or that you add in fail safes in case the incoming UART data is faulty or incomplete.

    Regards,
    Ryan

  • can you write a code for  uart timeout fuction in my above code . Is ther any problem with my void button funtion as gpio is in read mode with infint loop function  . How to chane  Uart in Non blocking mode and autocall function 

  • Here is the UART2 TI Driver documentation and uart examples.  You will find timeout, non-blocking, etc. references in the documentation.  I also recommend the FreeRTOS Overview from the stack User's Guides.

    If you ever want your application to exit the button function, I'm not sure how this is accomplished since it appears to wrap its operation within a forever while loop, thus your other infinite while loop is never again serviced.

    Regards,
    Ryan