Wio Terminal: hangups when using rpcWiFi 1.0.6

I experience regular hangups when using the latest rpcWiFi on my WIO terminal to connect and/or disconnect sockets. The terminal uses the latest firmware v2.1.3 on the WiFi end. While tracking down the issue, we managed to bring the thing reliably to a hangup after 1147 iterations using the following minimal example:

#include "rpcWiFi.h"

void setup() {
  uint32_t iteration_count = 0;
  Serial.begin(115200);  // init Serial Port with 115200 baud
  delay(1000);

  /* This is just to make the device "catchable" after power up as after crashing,
    the device typically is not connectable via USB */
  Serial.print("Waiting for 5s before stress test");
  while (millis() < 5000) {
    delay(500);
    Serial.print(".");
  }

  while (millis() < 20000) {
    iteration_count++;
    Serial.printf("%d\t%s\t(%d)\n", millis(), rpc_system_version(), iteration_count);
  }
}

void loop() {
  Serial.println("I'm running...");
  delay(500);
}

I believe this behavior causes many stability problems related to rpcWifi. Do I have a chance that an employee of Seeed Studio will take a look at it?

Thanks!
Fabian

1 Like

Hi @Fabian ,
I investigated and found that although the string returned by rpc_system_version() was allocated from the heap, it was not freed.

When I tried freeing it, it worked fine.

#include <erpc/erpc_port.h>
...
    char* version = rpc_system_version();
    Serial.printf("%d\t%s\t(%d)\n", millis(), version, iteration_count);
    erpc_free(version);
...

Since the code is automatically generated by eRPC, it is difficult to modify.

There are two functions that return strings like this.

  • rpc_system_version()
  • rpc_ip4addr_ntoa()