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.

TI RTOS 使用信号量调度任务出错

Other Parts Discussed in Thread: CC3200, TIDC-BLE-TO-WIFI-IOT-GATEWAY, CC2650

大家好,初次接触CC3200,我有个问题想请教一下。

我在程序中创建了三个任务,实现电脑和cc3200 launch pad的数据通信,通过WiFi,采用TCP协议。我直接在 getting_started_with_wlan_ap 例程上修改,新建了一个receive 任务。本来是打算建立TCP连接后post 一个信号量来启动 receive 任务。大致框架如下:

main()

{

     lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY);

    

}

task1()

{

}

task2()

{

  osi_SyncObjSignal(pStartReceive);

  osi_Sleep(100);

}

receive()

{

while( osi_SyncObjWait(pStartReceive,1000) != 0)

{

sleep(100);

}

message(“begin”);

}

其中task1优先级为9,task2为1,receive为3。可是运行时程序执行完task1,直接进入receive,然后显示begin,然后程序自动跳到exit.c。就结束了。我想知道这个信号量用法到底是什么样的,任务又是怎样调度的?

希望得到大家的帮助。不胜感激!

wlan_test_new.zip
  • 更正一下,task1就是simplelink任务,也没有执行,超级终端上直接显示begin。

  • 建议你参考例程idle_profile, 里面有TASK间通信的例子。

  • 你好!

             请问有没有任务之间使用信号量通信的例子?谢谢!

  • 有一个TI Design的例子,使用了CC3200的多任务操作系统,建议可以下载安装程序包,里面有大量的任务之间的消息传递

    http://www.ti.com.cn/tool/cn/tidc-ble-to-wifi-iot-gateway?keyMatch=blefi&tisearch=Search-CN-Everything

    Ble-Fi Gatewaty Software 

    BleFi - BLE Wifi IOT 网关参考设计

    TIDC-BLE-TO-WIFI-IOT-GATEWAY

    网关通过 Wi-Fi® 将蓝牙智能设备连接到互联网。通过它可以将蓝牙智能节点用于家庭/楼宇自动化和零售环境中。此参考设计使用 SimpleLink 超低功耗 CC2650 无线 MCU 和 SimpleLink WiFi CC3200 无线 MCU 将 SimpleLink™ SensorTag 数据连接到 IBM Bluemix 云服务。


    int main()
    {
    volatile unsigned char LoopVar = 0xFF;

    Blefi_HW_Init(); //初始化UART1,Button and LED, 复位CC2650
    // Wifi Configuration
    SimpleLink_Init(); //创建CC3200-NWP内核启动任务、是否打开HTTP服务
    /* Kick off Gateway Central application - Priority 2 */
    Gateway_Init(); //初始化Gateway--(1)创建<1> NPI-UART信息收发任务
    // <2> BLE GAP/GATT task
    // <3> BLE Application task
    GW_GenericTask_Init(); //---------------(2)创建<4>Gateway 任务--------------
    //<1>与MQTT 数据分发 <2>Ble配置信息写入 <3> Ble子设备扫描
    // Kick off CLI(Command Line Interface) task - Priority 1 */
    CLI_Init(); //---------------(3)创建<5>CLI 任务--------------
    //<1>启动NWP内核,CC3200连接路由器 <2>CC3200的UART1 等待输入配置信息
    // Initialize the MQTT App, always after Wifi_Init
    // 原函数在mqtt_app_main.c中
    MQTT_Init(); //---------------(4)创建<6>MQTT 任务--------------
    //<1>MQTT 服务器信息交互 <2>与Ble数据交互
    // Start the task scheduler
    OTA_Init(); //---------------(5)创建<7>OTA 任务--------------
    //<1>初始化GPIO_15 CC3200 Button <2>是否要进行OTA升级
    // Start the task scheduler
    osi_start();
    while(LoopVar);
    // we will never reach here
    return 0;
    }

  • 您好!看到您解说这个 TIDC-BLE-TO-WIFI-IOT-GATEWAY  ,我要在这块板子上实现将sensortag的九轴传感器数据上传到云端,但是对于这块板子已经有的4个传感器数据上传到云端的数据流在代码中是如何实现的,我没有搞清楚,还请您给讲解一下,