ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 5
VIEWS: 312
BACK
REPLY TO THIS POST
Joe Bazzoo
29 Jan 2024
Strange ESP32 compiling problem
Hello,

I don't know if someone here can help, it's not really a chipchop related question but it's been driving me crazy all day.
I have a small project that worked fine for the last two months and I needed to change few things. Nothing big, just a change in few variable init values. Before you ask they are just short strings like "zc_1" changing to "zap_coor_x" and stuff like that, nothing really that could affect the code logic whatsoever.

PlatformIO says that it's compiled ok but it does show two warnings that I didn't have before. When I upload and run the code on the device the WiFi client fails maybe 30 seconds to a minute later and comes up with some bogus error?

The code definitely worked absolutely fine so I can't figure out what has changed.

Here are the warnings

.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c:153:9: warning: 'return' with no value, in function returning non-void
return;

.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c:149:6: note: declared here
bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin)

and here is the error when running on the ESP

[154204][E] [WiFiClient. cpp:320] setSocketOption(): fail on -1, errno: 9, "Bad file number"

The board is a DollaTek ESP32-C3 and as I said, it compiles but now with these two warnings and fails on device but not instantly!?

Thnx in advance
fig_jam
29 Jan 2024

Post your code, I've done it countless times convincing myself I've only changed one thing and "forgot" about that little extra tiny change that broke everything!
markfelix
29 Jan 2024

@Joe, no need to post anything, I think I know exactly what it is as I had the same problem two days ago. PlatformIO decided to update itself (I think) and dragged with it the ESP-IDF v5.1.2, it's labeled in PlatformIO the platforms as 6.5.0

I've just downgraded to 6.3.1 and seems to be ok with no errors, haven't had the time to try the 6.4.0 to see if that's stable
Gizmo
29 Jan 2024

ditto, exactly same happened to me but I've re-graded all the way to 6.1.0
Joe Bazzoo
29 Jan 2024

ok, how do you downgrade the espressif sdk in PlatformIO???

I just can't find an obvious option, tried specifying in the platformio.ini (as google said) but nothing, I can clearly see it still compiling with 6.5.
What am I missing or has my brain re-graded!
Joe Bazzoo
30 Jan 2024

don't worry guys I think I've figured it out by accident!

this is what I've done, I've installed the 6.3.1 through the Platforms -> Embedded ->Espressif 32 -> Install
then went back from "Embedded" to the "Installed" option and it was still showing the 6.5.0 so I got annoyed and uninstalled it and bam the 6.3.1 suddenly shows up as the version it will use.

Bit convoluted but it works :)