Changing Library -> Lot of troubles

DeepDiver
Posts: 1
Joined: Wed Nov 12, 2025 9:19 pm

Changing Library -> Lot of troubles

Postby DeepDiver » Wed Nov 12, 2025 10:15 pm

Years ago I started to use the ESP32 Dev Module to manage a complex machine for screwing railroad rails. The ESP32 uses serial interfaces to communicate with an intelligend Display (4D Systems) and an Atmel CPU, SPI interface for SD-Card, FRAM and IO module, digital ports and analog ports. The code is about 530 KB and thousend of lines.
All worked well since I changed the ESP32 library. I forgot the originally Version of the library and thought, there are mistakes in my code. However, the crashes occurred in AnalogRead or SPI communication. Sometimes the ESP Exception Decoder found the exception occured in simple if statements with boolean values.
Some days ago I found in a forum the information, that problems happen in analog readings in version 1.0.5 and 1.0.6 and not in previous versions. So I went back to version 1.0.4 and - oh wonder - no more crashes.
I know, there are a lot of newer versions, but when I tried them, I got a lot of compilation errors. Some definitions are no more available, variables are renamed and functions in my code are suddenly no more available, but correct defined.

So, my question is:
Why are versions released, which are not really tested?
Why is code changed that worked perfect?
And for newer versions, why changing names for functions and properties?

Please understand me correctly. It's a great job to develop and provide such tools for the ESP32, but to provide a new version which makes a lot of troubles with inexplicable crashes made me doubt the ESP32 and I considered using a different controller.

Two more question:
Why are pins available which cannot be used? For example ESP32 DevKit ports 6 - 11.
Has the used CPU no more ports? I had to use an external SPI IO-expander.

I am glad, that my application no is stable with the ESP32 module, but it was a hard work to find out the problem and it cost me a lot of time and nerves. Fortunately, the customer was well-disposed towards me and gave me the time to successfully complete the matter.

Best regards, Manfred

Minatel
Espressif staff
Espressif staff
Posts: 433
Joined: Mon Jan 04, 2021 2:06 pm

Re: Changing Library -> Lot of troubles

Postby Minatel » Thu Nov 13, 2025 6:42 pm

Hi Manfred,

The Arduino core version 1.0.4 was released on Oct 2, 2019, so it's a 6 yo. Since 2019, a lot of things have changed, including new ESP-IDF, new ESP32 chips, new libraries, components, and much more.

If you are following the Arduino core development, you will see that all changes were introduced in a way that the community was aware and was guided on how to migrate from 1.x, to 2.x, then to 3.x.

Keeping compatibility in the API level sometimes is not possible, and we need to improve the new functions by improving the APIs. All changes were made in a smooth way, and for some APIs, we kept the legacy for a while before the deprecation.

In our docs, you will find the migration guide.

Why are pins available which cannot be used? For example ESP32 DevKit ports 6 - 11.
Those are connected to the flash memory, so you can't use it.

Has the used CPU no more ports? I had to use an external SPI IO-expander.
If you have no more ports, then you'll need an port expander or move to a new ESP32 family, like the ESP32-S3.

RandomInternetGuy
Posts: 82
Joined: Fri Aug 11, 2023 4:56 am

Re: Changing Library -> Lot of troubles

Postby RandomInternetGuy » Tue Nov 25, 2025 1:13 am

Further, ISO standard C/C++ is well standardized and has been for decaded. Sure, the ecosystem changes (including potentially things like SPI interfaces and such), but it's not like "boolean things" were exactly thrown out.

It seems unlikely with "thousends of lines" (sic) that fixing syntax errors in "simple if statements with boolean values" would justify "using a different controller".


But there is perhaps a bit of a lesson here for other readers. Code decays over time. Environments change. That approach that was super easy under DOS3 and dBase II might be super terrible under Windows 2000 and Access. It's certainly true for embedded work. You may have built the most awesome project ever that used ESP8266, but when needs change and you have to just tweak "one more thing" in 2042 and you find that 32-bit time no longer works, you can't find anyone that remembers that era of C, and you can't find a way to re-install that compiler inside a VM inside a VM for Windows 38 to run binaries that old. You can either pay that cost incrementally and update a project enough to build and run annually or so on the latest development environments, blowing the dust off a little at a time, or you can wait until you NEEEEEED it and begin an archealogy expedition then to bring an old project back to life.

If your code was in Arduino of that age, it is, as you've discovered, Arduino 1.something and current is Arduino 3. You may not NEED Matter, Threads, and all that other "newfangled" stuff, but if you expect to be able to build/buy/run a system TODAY with skills, tools, and parts available TODAY, and keep it within the Arduino ecosystem, a move to Arduino 3 may be in order.

There are professionals around that help with this kind of project all the time. You don't have to do it on your own. It's not like there's anything actually actionable in this post that anyone can help with. Assuming that releases shouldn't be made (It's not like Espressif quit making chips or that OS companies all went home or that nobodh else had any feature requests) or that they're "not really tested" just because _your_ code didn't work isn't at all a fair perspective.

If you need help in the future, whether you're askign for help or for someone to "fix" it to pass some specific set of criteria/tests, please be more specific with actionable requests.

Who is online

Users browsing this forum: Bytespider and 3 guests