ESP32S2 running ULP-FSM example sought

User avatar
BB5000
Posts: 5
Joined: Mon Jun 08, 2020 8:07 am

ESP32S2 running ULP-FSM example sought

Postby BB5000 » Thu Jun 25, 2020 4:42 pm

Dear ESP32 S2 experts.
Currently I am having trouble to get the ULP to run in the ESP32S2 (Saloa-Board).
Apparently since the ULP has two modes (FSM as well as RISC-V) which can be utilized alternatively, further settings have to be done to get it off the ground. However despite following the steps as outlined in the "esp32-s2_technical_reference_manual" in chapter "27.4 ULP Coprocessor Workflow" it is not starting.
Before I waste even more time seeking for the other things that might have to be set, I would be more than happy if anyone had or knew of any simple operational example of ULP code running in an ESP32S2.
Thanks a lot in advance.
Bernd

ESP_Angus
Posts: 2175
Joined: Sun May 08, 2016 4:11 am

Re: ESP32S2 running ULP-FSM example sought

Postby ESP_Angus » Fri Jun 26, 2020 3:55 am

Hi Bernd,

I'm afraid that, as you've noticed, we haven't updated the ESP-IDF ULP-FSM examples to work on ESP32-S2 yet. However the two ULPs are very similar, it should be possible to start with an ESP32 ULP-FSM program and make a few tweaks until it works.

Sorry I don't have anything more specific I can offer for now.

Regarding RISC-V ULP, support for this should be merged to master in the next couple of weeks.

User avatar
BB5000
Posts: 5
Joined: Mon Jun 08, 2020 8:07 am

Re: ESP32S2 running ULP-FSM example sought

Postby BB5000 » Fri Jun 26, 2020 6:40 am

HI ESP_Angus.

Thanks for the swift reply.

My feeling is there might be other obstacles even within the IDF that are currently in my way, and thus it could be tedious to seek by trial and error what could be the root cause. May be there is even a wrong library linked at some stage or something else.

Talking about libraries I guess I found another issue that you perhaps are interested to forward to the right people:
There appears to be an inconsistency between with documentation and a library in connection with the RTC I2C implementation.
In the "esp32-s2_technical_reference_manual_en" in "27.7.2 Configuring RTC I2C" the registers for SDA High and Timeout are labled RTC_I2C_SCL_HIGH_PERIOD_REG and RTC_I2C_TIME_OUT_REG (or even RTC_I2C_TO_REG in 27.10). The labels offered by ESP-IDF are however RTC_I2C_SCL_HIGH_REG and RTC_I2C_TIMEOUT_REG respecitvely. How should anyone know?
From my point of view that should be fixed by a complete review of the "rtc_i2c_reg.h" library since e.g. SDA Low, the sibling of SDA High, has the naming scheme as outlined in the documentation RTC_I2C_SCL_LOW_PERIOD_REG while SDA HIgh differs.

I'll put my ULP attempts to rest for the time being then and give the the tooling some more time to mature until I resume my trial with the ULP.
If you however have a ULP-FSM example cookbook other than "27.4 ULP Coprocessor Workflow" or any additional hint please do not hesitate to lay it on me.

Best regards.
Bernd

boarchuz
Posts: 256
Joined: Tue Aug 21, 2018 5:28 am

Re: ESP32S2 running ULP-FSM example sought

Postby boarchuz » Fri Jun 26, 2020 6:40 pm

I've uploaded an example here:
https://github.com/boarchuz/s2-ulp-fsm-demo (fiddles with some variables, shows some new instructions, toggles LED)

You'll need the changes to IDF here:
https://github.com/boarchuz/esp-idf/tree/s2-ulp-fsm

User avatar
BB5000
Posts: 5
Joined: Mon Jun 08, 2020 8:07 am

Re: ESP32S2 running ULP-FSM example sought

Postby BB5000 » Sat Jun 27, 2020 9:29 am

@boarchuz
Thanks a lot for the example.
It works like charme!
Compiling your example without updating the IDF to the version uploaded by you lead to the compiler throwing complaints at me regarding the amended FSM instruction set.
After over-installing your IDF it worked right away.
And guess what: My example with assembler code in .S files in the ulp subfolder now work as well!!!
Again thanks a lot, you are my personal hero of today :D
Bernd

Who is online

Users browsing this forum: Baidu [Spider], ESP_Roland and 12 guests