-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32C3 fails to boot with otadata partition and no factory app. (QEMU-160) #83
Comments
Hello @Samureimer , Thank you for reporting the issue and sorry for the delay of reply. I was able to reproduce the issue you are seeing with The good thing is this issue is now fixed on the |
Hi @o-marshmallow. It first gets stuck trying to do a ADC calibration at: I "fixed" this by removing the while loop and just returning some raw ADC value. I would expect the emulator to "just" connect to any WiFi and substitute the actual WiFi driver with another driver that uses my computers network interface. Is this incorrect? |
No, there is no support for Wi-Fi emulation on ESP32 or ESP32-C3 in this QEMU fork. Some work on this has been done in #80, but it's not ready yet. If you need to test anything network-related, you can initialize Ethernet, instead. The steps to do this for ESP32 are described here: https://github.com/espressif/esp-toolchain-docs/blob/main/qemu/esp32/README.md#ethernet-support. For ESP32-C3, this will be supported in the next release. |
Hi @Samureimer, this fork of Espressif QEMU has support to WIFI for ESP32 and ESP32C3. |
Hi @lcgamboa. I use the Arduino framework for ESP-IDF (Shouldn't really matter I guess).
The QEMU command I use to start the emulator:
The output of the application:
I would expect the emulator to connect to any SSID and password combinations. Is this incorrect? |
No. In Station mode, you must use one of the hardcoded SSIDs (PICSimLabWifi, Espressif, or MasseyWifi) without a password. Sorry for the lack of documentation. I don't know if the function |
@lcgamboa Thanks for the quick reply. When calling I ended up running the container with the arg Now I was able to connect to the SSID, obtain a valid IP and access the internet.
I only have some minor issues left. When the IP is returned from the DHCP request the gateway seems to be incorrect. I'm still able to resolve DNS and do HTTP requests so this is not a problem for me, just odd. The RTC/time seems to be broken in the sense that I can't change the system time.
The NTP request is supposed to set the system time automatically I believe. NTP example code After calling |
HI @Samureimer , when using Qemu The RTC peripheral isn't fully implemented yet. I will look and try to fix the example code to work as soon as possible. |
The RTC works for ESP32 Qemu but doesn´t work for ESP32C3 Qemu. The RTC timer support is implemented in esp32c3_timg.c, but it doesn't work correctly as expected for the sntp example. Using my fork with WIFI or official Espressif with Opencores Ethernet MAC for ESP32C3 get the same date time error:
I have used the command line:
I think is better to open an issue to Espressif to fix the RTC for ESP32C3, as they wrote the code, they will be able to fix it faster than me, who would have to study and understand it before trying to fix it. |
I did more research and found that the sntp example always get 0 seconds from the server. The Arduino example SimpeTime has the same problem. But the Using code that does not depend on IDF sntp and time functions works (as in the example below).
|
This new commit f5de023 fixes the return of the |
Hello @lcgamboa @Samureimer , The commit f5de023 should now fix the RTC on the ESP32-C3, please check and tell me if it fixed your issue EDIT: I forgot to refresh this page before sending my reply 😄 |
Hi @o-marshmallow and @lcgamboa I pulled the latest changes from @lcgamboa WiFi branch and it just worked! |
Hi @lcgamboa I have a sample program that I would like to share with you. |
Hi @Samureimer, I have enabled the issue creation on my fork. |
When I try to run the emulator with the following partitions table the program fails to enter the main function it seems.
When targeting the ESP32 it works just fine.
Link to repo that reproduces and documents this:
https://github.com/Samureimer/ESP32C3QemuProblem
QEMU version:
esp-qemu-riscv32-softmmu-develop_8.0.0_20230522
https://github.com/espressif/qemu/releases/tag/esp-develop-8.0.0-20230522
Console output:
And then nothing.....
If I remove the otadata from the partitions table, or change the partition table to: Factory app, two OTA definitions, it runs just fine:
Console output:
The text was updated successfully, but these errors were encountered: