Possible bug in FreeRTOS and AtWiFi Arduino library

I am trying to implement FreeRTOS with WiFi feature. However, I find that the task cannot be created even if I only include the AtWiFi.h. Here is the code:

#include <Seeed_Arduino_FreeRTOS.h>
//#include <AtWiFi.h> // Uncomment this and try again
TaskHandle_t Handle_aTask;
TaskHandle_t Handle_bTask;
static void ThreadA(void* pvParameters) {
    Serial.println("Thread A: Started");
    while (1) {
        Serial.println("Hello World!");
static void ThreadB(void* pvParameters) {
    Serial.println("Thread B: Started");
    for (int i = 0; i < 10; i++) {
        Serial.println("---This is Thread B---");
    Serial.println("Thread B: Deleting");
void setup() {
    vNopDelayMS(1000); // prevents usb driver crash on startup, do not omit this
    while(!Serial);  // Wait for Serial terminal to open port before starting program
    Serial.println("        Program start         ");
    // Create the threads that will be managed by the rtos
    // Sets the stack size and priority of each task
    // Also initializes a handler pointer to each task, which are important to communicate with and retrieve info from tasks
    xTaskCreate(ThreadA,     "Task A",       256, NULL, tskIDLE_PRIORITY + 2, &Handle_aTask);
    xTaskCreate(ThreadB,     "Task B",       256, NULL, tskIDLE_PRIORITY + 1, &Handle_bTask);
    // Start the RTOS, this function will never return and will schedule the tasks.
void loop() {
    // NOTHING

As you uncomment the AtWiFi.h include and flash it into Wio Terminal, you will only see the output stucks at:

        Program start         

, instead of going forward. It seems that xTaskCreate cannot be called.
What makes it worse, the uploading will not be available anymore as it will stuck at “uploading” stage, whose solution is to download Ardupy firmware into it and then flash the normal Arduino code.

Any ideas?

There is a problem in this area and we are working to fix it. Sorry for the bad experience.

Thanks. Looking forward to the fixed update! :smiley:

.cpp file of AtWifi.h is missing in the library

What do you mean, can you provide a screen shot?

I encounter the same task issue in my application. Any estimate on when the fix can occur?
Is it possible for user to modify the library before official release.


@gedgar We have updated the wifi software.Please update to the latest version.