ESP32 C3 problems with IDF5.3

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
MJU20
Posts: 353
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 101 times
Been thanked: 70 times

Flowcode v10 ESP32 C3 problems with IDF5.3

Post by MJU20 »

I've been having problems with a few things in FC10 with the ESP32 C3 (super)mini board.
I've managed to update the IDF to the latest version :

Code: Select all

Python 3.12.5
git version 2.46.0.windows.1
ESP toolchain found at "C:\Espressif\frameworks\esp-idf-v5.3\"
And this setup works for other ESP dev boards (Wroom 32 etc), but gives a lot of problems with the C3 board.

PWM does not compile (after initialisation ), interrupts don't work (after initialisation)...

Can someone please look into this?
Is this a specific C3 problem, or is it a problem with the used IDF?

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: ESP32 C3 problems with IDF5.3

Post by BenR »

Hello,

I've just tried the C6 supermini and this is working fine with PWM. I don't currently have any C3 hardware so I'll get some on order but in the mean time i'll also look into the compile issue for you.

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: ESP32 C3 problems with IDF5.3

Post by BenR »

It looks like the C3 has a different PWM module to all the other ESP32 devices named LEDC.

https://docs.espressif.com/projects/esp ... /ledc.html

I'll see if we can support this alternative module in the CAL code.

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: ESP32 C3 problems with IDF5.3

Post by BenR »

Hello,

Right hopefully this is now resolved for you with the latest library updates. I've confirmed it's working, I managed to find a C3 in my pile of ESP32 bits.

Please note the maximum period overflow for the C3 devices seems to be 16383 (14-bit) rather then the usual 65535 (16-bit).

Now to investigate interrupts. Is it specifically timers that are giving you problems?

MJU20
Posts: 353
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 101 times
Been thanked: 70 times

Re: ESP32 C3 problems with IDF5.3

Post by MJU20 »

Hey BenR,

Thanks for checking this out.

The PWM Cal component has now new settings like the LEDC timers.
This compiles now, that is a great success!

I've tried several times to get an LED on pin0 to dim via the PWM signal, but can't find the right settings.

There are LEDC settings, pin settings channel settings, frequency settings etc.

Can you please post a chart that you've got working? I just want to be able to dim an LED on pin0 (or other).

The interrupt seems to be working OK now? Can't explain this last one...

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: ESP32 C3 problems with IDF5.3

Post by BenR »

Hello,

Excellent sounds like we're making good progress.

The frequency can be whatever you like but the duty can only go from 0 to 16383.

This program uses IO pin 8 as the LED and PWM output pin.
ESP_C3_Test.fcfx
(13.54 KiB) Downloaded 545 times

MJU20
Posts: 353
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 101 times
Been thanked: 70 times

Re: ESP32 C3 problems with IDF5.3

Post by MJU20 »

Thank you again BenR,

This works fine and also on other pins. Thanks!!

What I did was use the CAL_PWM component and that one doesn't work.
Can't always find out, which component I've got to use.

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: ESP32 C3 problems with IDF5.3

Post by BenR »

Hello,

The CAL component should work too but you have to call the SetPeriod macro to setup the clock prior to enabling the channel. This is the same for most MCU families.

The top level PWM output component uses the CAL component but simply does the SetPeriod call for you inside the Enable function.

MJU20
Posts: 353
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 101 times
Been thanked: 70 times

Re: ESP32 C3 problems with IDF5.3

Post by MJU20 »

Thanks, this too works!

I haven't fount a setPeriod macro so I used the changePeriod macro in the CAL PWM..

Too bad these things aren't mentioned in the Wiki pages of the component:
https://www.flowcode.co.uk/wiki/index.p ... AL)_(Misc)

For newer users this could be very handy..

Post Reply