Hi,
With the help of TI BLE Wiki, to the SimpleBLEperipheral project, I added UART drivers data transfer was tested. It works fine in callback mode with tasks.
Initially i attempted a basic UART configuration with UART_read() and UART_write() in a while(1) loop. Interesting thing was it displayed the string " Hello_world " only once and in debug mode, the control was not coming out of UART_write() function. (It goes to disassembly) . I have added the code snippet below. .
- Is there anything wrong with the code ?
#include <ti/drivers/UART.h>
#include <ti/drivers/uart/UARTCC26XX.h>
#include "Board.h"
#include <xdc/runtime/Error.h>
#include <ti/sysbios/family/arm/cc26xx/Power.h>
#include <ti/sysbios/BIOS.h>
UART_Handle handle;
UART_Params params;
uint8_t txBuf[]={"Hello_World"};
void main()
{
PIN_init(BoardGpioInitTable);
ret=sizeof(txBuf);
UART_Params_init(¶ms); // To initialize UART drivers
params.baudRate=115200;
params.writeDataMode=UART_DATA_BINARY;
handle = UART_open(Board_UART,¶ms);
while(1)
{
UART_write(handle,txBuf,sizeof(txBuf));
BIOS_start();
}
}
- Second, can't UART be configured for interrupt on RX pin ? I mean, if some data comes via UART_RX pin, the control should be transferred to ISR from the main loop. Is there any API which should be used to register the ISR on UART? Normally IRQ mapping is done using vector number, right? I searched for vector numbers in IAR installation directory, but couldn't locate one for CC2650 board. How can interrupt be enabled on UART pins?