-
Notifications
You must be signed in to change notification settings - Fork 64
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
timer not working on esp32 with zephyr #2124
Comments
Thanks for the report, @georgedlu! I've tagged two people who might be able to assist with this. |
Thanks for reporting this @georgedlu! I don't have this board myself so I will need some help to debug it. The program crashes when calling You could also try commenting out those lines in reactor_threaded.c and recompiling. You can make changes in |
Hi @erlingrj , thanks for your contribution on zephyr support. I don't have the JTAG interface handy. I have commented out 1142-1144:
then "cd src-gen/timer && west build -p always":
Here are the relevant lines from Timer/src-gen/Timer/core/threaded/reactor_threaded.c
|
Thanks George. It makes sense that it wasn't the |
@georgedlu, were you able to able to pinpoint the issue using a debugger? |
@georgedlu I spoke with another person that had issues with the ESP32 which were resolved by replacing calls to |
The other user reports that the issue is related to our use of newlib. Unfortunately, newlib was the only C library that I fully got to work with the LF runtime. The other user reports that simple Timer programs work with picolib, but the WIFI examples crash with exception. I am afraid that we for now must conclude that we don't support ESP32 with our Zephyr port. It would be a nice challenge for anyone interested to get it to work, but I highly recommend doing this with a debugger so you can understand better the nature of the exceptions etc. |
Yet another update here is that we have gotten picolibc to work with ESP32. There was an issue in what malloc and calloc returned if asked to allocate something of zero size. In picolib it returned NULL which was interpreted as an out-of-memory exception. I have fixed it in this PR: #2167 I should also add docs about ESP32 specifically since there is an issue with newlib and ESP32, but it works now if you use picolibc instead. It would be great to understand why there is an issue with newlib, but I do not have an ESP32 to test with |
Testing zephyr using lf-cli-0.5.2-SNAPSHOT-nightly-20231201050232-Linux-x86_64.
Builds and runs fine for native_sim:
Now changed to
board: esp32_devkitc_wroom
(actually a Adafruit HUZZAH32 - ESP32 Feather). Prior to this, I have confirmed zephyr's blinky works on it withwest build -b esp32_devkitc_wroom samples/basic/blinky -p always
The same test repeated on nucleo_h7a3zi_q and rpi_pico have gotten the expected "Hello" output. Am I missing something for it to work on esp32?
The text was updated successfully, but these errors were encountered: