ESP32-S3 ULP #11175
-
Just wanted to check - there is currently no way to use the ULP with the ESP-32 S3 in micropython, correct? Would it be possible using a native C module? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 9 replies
-
Yes, this would appear to be true. The |
Beta Was this translation helpful? Give feedback.
-
The ESP32-S3 has two ULPs; the 'classic' or 'FSM' ULP which I believe should work and is intended to be backwards-compatible with the ULP on the original ESP32. Currently it's only enabled for the original ESP32 but I think it ought to work on the S2 and S3 where the ULP FSM is available. The second ULP is based on a RISC-V core, and this is currently unsupported in MicroPython, to my knowledge. The RISC-V ULP is present on the S2 and S3. It would be a nice addition to the esp32 module and looks similar to the FSM ULP in implementation. For someone keen, take a look at the current esp32_ulp.c file and compare with the RISC-V ULP IDF docs. |
Beta Was this translation helpful? Give feedback.
-
Thanks both! That's interesting to know. I thought I would test it by compiling with the ifdef statement removed (along with the corresponding endif) but it ends up with an error message. (I've compiled and tested the regular old GENERIC_S3_SPIRAM_OCTAL without issues already so the error should be related to this change)
For now I will make do without the ULP on this board but good to know there's an option if I can put in the work. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Wall of text below the details of which aren't particularly important - I am curious how far off am I? If I continue doing these sort of tests do you think I might get something working? Or will it need a lot more playing with the internals to get there? Wondering if I should try a bit more or not. I also saw the comment below: Wall of textGot a bit curious so was playing around a bit more. I think the issue previously was I didnt remake the submodules with the board parameter passed, so I just had to
and then
Still fails, but a lot later. Here's the error message:
so I changed to
and ran make again. Which worked. I've attached the compiled firmware here in case anyone wants to play with it but it doesn't work, esp32 doesn't have a ULP module here
|
Beta Was this translation helpful? Give feedback.
-
So I also commented out the following ifdef in
And ULP import works fine now. All this means of course is that the module will import - I don't yet know if it will work at all.
|
Beta Was this translation helpful? Give feedback.
-
Ok so after the module loads, running the counter example from here (link) leads to Firmware attached on the off chance anyone wants to look into it. Looking at https://github.com/espressif/esp-idf/blob/master/components/esp_common/include/esp_err.h This seems to be
And here is the code that seems to be throwing the error (link):
In my build/sdkconfig I see
(I had added So I am thinking the library here may not be compiling the source correctly? https://github.com/micropython/micropython-esp32-ulp Makes sense given it was designed for ESP32 not ESP32S3 |
Beta Was this translation helpful? Give feedback.
-
Yeah I saw that, nice work.
…On Sat, 15 July 2023, 2:14 am Wilko Nienhaus, ***@***.***> wrote:
Yes, the C3 does not have a ULP at all, so micropython-esp32-ulp is not
relevant for the C3.
(Not related to the C3, but In case you are interested in using the RISC-V
ULP of the S2 or S3, there is a draft PR to MicroPython aiming to make that
possible: #11572 <#11572>)
—
Reply to this email directly, view it on GitHub
<#11175 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV562M4BKTLENPU7HXXZPUTXQFV6RANCNFSM6AAAAAAWPW4WMA>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
v1.21 now has support for S2 & S3. I've tested this with an S2 although running in to a bug that borks Wifi, so had to manually install the code rather than use the documented process with mip. https://docs.micropython.org/en/latest/library/esp32.html#esp32.ULP There is a very clear but slightly confusing note. DOES NOT WORK WITH RISC-V, the fine print though, there are two ULPs and it implements the Finite State Machine (FSM). So I hope this now answers/resolves your initial question of can you ULP. I certainly can now, getting at least as far as blink. RISC-V ULP looks to be a potential future work to come. ULP output of GPIO on/off:
This is a wicked cool trick, write some assembly in repl and convert to running code! |
Beta Was this translation helpful? Give feedback.
v1.21 now has support for S2 & S3. I've tested this with an S2 although running in to a bug that borks Wifi, so had to manually install the code rather than use the documented process with mip.
https://docs.micropython.org/en/latest/library/esp32.html#esp32.ULP
There is a very clear but slightly confusing note. DOES NOT WORK WITH RISC-V, the fine print though, there are two ULPs and it implements the Finite State Machine (FSM). So I hope this now answers/resolves your initial question of can you ULP. I certainly can now, getting at least as far as blink. RISC-V ULP looks to be a potential future work to come.
ULP output of GPIO on/off:
This is a wicked cool trick, w…