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.

simpleBLEPeripheral 例程中增加UART调试程序跑飞。

Other Parts Discussed in Thread: CC2650

我在调试CC2650,simpleBLEPeripheral 例程中增加UART调试程序跑飞。,UART已经在mian()中执行了初始化,在LED闪烁控制任务中调用  UART_write(SbpUartHandle, txbuf, 5); 就会程序跑飞。不知道什么原因?

下面是初始化:

static void Uart_init(void)

{

 UART_Params      params;

 // Init UART and specify non-default parameters

  UART_Params_init(&params);

 params.baudRate      = 115200;

 params.writeDataMode = UART_DATA_BINARY;  

params.readMode      = UART_MODE_CALLBACK;

 params.readDataMode  = UART_DATA_BINARY;

 params.readCallback  = readCallback;

 // Open the UART and do the read

  uarthandle = UART_open(Board_UART, &params);  // Enable RETURN_PARTIAL  

UART_control(uarthandle, 32, NULL);  // UART_read()  

UART_read(uarthandle, rxBuf, 100);

}

static void led_clockHandler(UArg arg)

 {   // Store the event.   events |= LED_PERIODIC_EVT;

  // Wake up the application.  

Semaphore_post(sem);  

  if(fg_led)  

  {  

         PIN_setOutputValue(ledPin,Board_LED3,1);  

        fg_led=0;

   }   

 else  

  {    

      fg_led=1;   PIN_setOutputValue(ledPin,Board_LED3,0);   

 }

    UART_write(SbpUartHandle, txbuf, 5);    UART_write(uarthandle, txBuf, 5);

}