char input;
UART_Handle uart;
UART_Params uartParams;
uint8_t cQF_Buf[20],cLenth=0;
uint8_t StatusWrite;
// osal_snv_init();
// NVOCOP_initNV(NULL);
//osal_snv_read(BLE_NVID_CSRK, KEYLEN, cQF_Buf);
Board_initUART();
/* Create a UART with data processing off. */
UART_Params_init(&uartParams);
uartParams.writeDataMode = UART_DATA_BINARY;
// uartParams.readTimeout = 20;//
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 9600;
uart = UART_open(Board_UART0, &uartParams);
/* Loop forever echoing */
while (1) {
RxNum = UART_read(uart, &input, 1);
ProRxData(RxNum, (uint8_t)input);
// osal_snv_read(BLE_NVID_CSRK, KEYLEN, cQF_Buf);
cLenth = QF_UartAnalysis(cQF_Buf);
if (cLenth)
{
StatusWrite = osal_snv_write(BLE_NVID_CUST_START, 9, cQF_Buf);
memset(cQF_Buf, 0, 9);
if(StatusWrite==SUCCESS)
osal_snv_read(BLE_NVID_CUST_START, 9, cQF_Buf);
UART_write(uart, cQF_Buf, cLenth);
}
}
这是我串口接收程序,不知道为什么调用osal_snv_write函数不成功,用的是CC2650STK_app修改的
Loops:
你好. 你的问题和这个帖子一样.请尝试帖子里的解决方式.
http://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/597220