Page 1 of 1

Project does not compile anymore with latest esp32 arduino board support. Can you help?

Posted: Tue Jun 11, 2024 6:57 am
by brebisson
Hello,

I am restarting work on a project that I was working with based on an ESP32-CAM.
I changed PC and had to re-install the arduino system and the ESP board support.

Now, my project does not compile anymore (while it compiles on the old computer when I take it out of storage, but this is not a good solution)...

It seems that the esp API has changed. Could you please help me find how to convert my "old code" to "new code"?

I have 2 set of errors. One around the setup of the LED control
ledcSetup(LED_LEDC_CHANNEL, 5000, 8);
ledcAttachPin(pin, LED_LEDC_CHANNEL);

And one around a HW timer interrupt!
hw_timer_t *timer = timerBegin(0, 80, true); // set timer 0 of 4 to 80 prescaler. No clue on speed...
timerAttachInterrupt(timer, onTimer, true); // attach onTimer to our timer
timerAlarmWrite(timer, 100, true); // timer every 10micros, repeating
timerAlarmEnable(timer); // enable the interrupt


Thanks for your help.
Cyrille

Re: Project does not compile anymore with latest esp32 arduino board support. Can you help?

Posted: Tue Jun 11, 2024 12:38 pm
by aruffato
HI, you MUST update your CODE, because the API change-

See the LINK:
https://docs.espressif.com/projects/ard ... o_3.0.html

Re: Project does not compile anymore with latest esp32 arduino board support. Can you help?

Posted: Tue Jun 11, 2024 4:28 pm
by lbernstone
Migration guide from arduino-esp32 2.x to 3.0

Re: Project does not compile anymore with latest esp32 arduino board support. Can you help?

Posted: Wed Jun 12, 2024 5:38 am
by brebisson
Hello,

Thanks for the link and info...

Is there a way, in arduino systems, to load previous versions of API/board dev so as not to have this type of issues?
I faced the same problem with another project (on an other board)...

Cyrille

Re: Project does not compile anymore with latest esp32 arduino board support. Can you help?

Posted: Wed Jun 12, 2024 6:55 am
by lbernstone
Sure. If you look at the last image in the install doco, you can see there is a drop down box in the board manager to choose the version installed.