用TI-RTOS实现用两个线程分别控制一个串口一收一发,提示未初始化TASK

我想用TI-RTOS实现用两个线程分别控制一个串口一收一发,但查看ROV却未初始化TASK ,我看UART.h的文档里说可以同时进行一个读和一个写的啊。我屏蔽和UART相关的代码后就可以正常跑两个TASK。代码如下:

   /* TI-RTOS Header files */
  #include <xdc/std.h>
  #include <ti/sysbios/BIOS.h>
  #include <ti/sysbios/knl/Task.h>
  #include <ti/sysbios/knl/Clock.h>

  #include <ti/drivers/GPIO.h>
  #include <ti/drivers/UART.h>

  /* Example/Board Header files */
  #include "Board.h"

  void myDelay(int count);

  /* Could be anything, like computing primes */
  #define FakeBlockingSlowWork()   myDelay(12000000)
  #define FakeBlockingFastWork()   myDelay(2000000)

  Task_Struct workTask;
  Task_Struct urgentWorkTask;
  /* Make sure we have nice 8-byte alignment on the stack to avoid wasting memory */
  #pragma DATA_ALIGN(workTaskStack, 8)
  #define STACKSIZE 2048
  static uint8_t workTaskStack[STACKSIZE];
  static uint8_t urgentWorkTaskStack[STACKSIZE];

  UART_Handle uart;

  void doUrgentWork(void)
  {
      GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_OFF);
      FakeBlockingFastWork(); /* Pretend to do something useful but time-consuming */
      GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_ON);
  }

  void doWork(void)
  {
      GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_OFF);
      FakeBlockingSlowWork(); /* Pretend to do something useful but time-consuming */
      GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);
  }

  Void workTaskFunc(UArg arg0, UArg arg1)
  {
//      char input;

      while (1) {
//          UART_read(uart, &input, 1);

          /* Do work */
          doWork();

          /* Wait a while, because doWork should be a periodic thing, not continuous.*/
          //myDelay(24000000);
          Task_sleep(500 * (1000 / Clock_tickPeriod));
      }
  }

  Void urgentWorkTaskFunc(UArg arg0, UArg arg1)
  {
      char text[] = "urgentwork:\r\n";
      while (1) {

          /* Do work */
          doUrgentWork();

          /* Wait a while, because doWork should be a periodic thing, not continuous.*/
          //myDelay(24000000);
          Task_sleep(50 * (1000 / Clock_tickPeriod));

//          UART_write(uart, text, sizeof(text));
      }
  }

  /*
   *  ======== uart init ========
   */
  void uart_init(void)
  {

      UART_Params uartParams;

      const char  echoPrompt[] = "Echoing characters:\r\n";

//      Semaphore_Params semParams;
//
//      /* Construct a Semaphore object to be use as a resource lock, inital count 1 */
//      Semaphore_Params_init(&semParams);
//
//      Semaphore_construct(&semStruct, 0, &semParams);
//      /* Obtain instance handle */
//      semHandle = Semaphore_handle(&semStruct);
//
//      Semaphore_construct(&buf_semStruct, 1, &semParams);
//      /* Obtain instance handle */
//      buf_semHandle = Semaphore_handle(&buf_semStruct);


      /* Call driver init functions */
      UART_init();

      /* Turn on user LED */
      GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);

      /* Create a UART with data processing off. */
      UART_Params_init(&uartParams);
      uartParams.writeDataMode = UART_DATA_BINARY;
      uartParams.readDataMode = UART_DATA_BINARY;
      uartParams.readReturnMode = UART_RETURN_FULL;
      uartParams.readEcho = UART_ECHO_OFF;
      uartParams.baudRate = 115200;

      uart = UART_open(Board_UART0, &uartParams);

      if (uart == NULL) {
          /* UART_open() failed */
          while (1);
      }

      UART_write(uart, echoPrompt, sizeof(echoPrompt));
  }

  /*
   *  ======== main ========
   *
   */
  int main(void)
  {
      Board_initGeneral();
      GPIO_init();

//      uart_init();

      /* Set up the led task */
      Task_Params workTaskParams;
      Task_Params_init(&workTaskParams);
      workTaskParams.stackSize = STACKSIZE;
      workTaskParams.priority = 2;
      workTaskParams.stack = &workTaskStack;

      Task_construct(&workTask, workTaskFunc, &workTaskParams, NULL);

      workTaskParams.priority = 3;
      workTaskParams.stack = &urgentWorkTaskStack;

      Task_construct(&urgentWorkTask, urgentWorkTaskFunc, &workTaskParams, NULL);



      /* Start kernel. */
      BIOS_start();

      return (0);
  }

  /*
   *  ======== myDelay ========
   *  Assembly function to delay. Decrements the count until it is zero
   *  The exact duration depends on the processor speed.
   */
  __asm("    .sect \".text:myDelay\"\n"
        "    .clink\n"
        "    .thumbfunc myDelay\n"
        "    .thumb\n"
        "    .global myDelay\n"
        "myDelay:\n"
        "    subs r0, #1\n"
        "    bne.n myDelay\n"
        "    bx lr\n");