Freeze up on ESP32 compiler errors

I’m programming an ESP32-S3. If Arduino encounters errors while building it shows the errors and then freezes for several minutes then restarts the program and output is cleared.

Do you mean that the IDE crashes and re-starts?
Or that the ESP restarts after the upload?

In File -> Preferences and Show output during, are either of the options checked?
If you check Upload and compile/build again does is now show an upload in progress?

I mean the IDE locks up and is not responsive for several minutes then it seems to time out and restarts. Start back up like if you clicked on the ino file in a new session.

Thank you for the clarification.

What version of the IDE are you using?

If you start the IDE from a powershell prompt (assuming you are running on Windows) it should show some messages while it is running. If you can view/capture those up until the point of the hang they may provide a clue as to what is happening.

The post here by @ptillisch shows how to do that:

https://forum.arduino.cc/t/ide2-fails-to-start/1125482/4

A first time esp32 compile can be quite lengthy. Post the VERBOSE error log, set warnings to default.

I am using the latest version 2. On windows. I will try the powershell startup when i am back in the office after thanksgiving. Thanks for the reply.

the log only shows the program errors and if it compiles clean there is no hangup. the entire log is huge but i can post a zip? I don’t think you can get anything from it, but it usually dies on linker errors so maybe it is the linker? It will be after Thanksgiving that I can give you a log. Thanks for the reply.

If it compiles clean, then close this thread, if not clean, post it in code tags and also post the verbose error log in code tags.

Don't zip, post in code tags.

Code tags? What do you mean? So it is on errors when it crashes. I get the error messages and linked files like I should but it just locks up instead of stopping and passing back control to the user. If I fix the listed error and then there are no errors it compiles and links and goes on to upload the program to the ESP31-S3 normally. It freezes after the linker errors I cannot explain any better then that.

So the problem is fixed? You said

No what I mean is after the freeze and the program times out, I fix the errors in the code originally in the output before the freeze happens. And if there are no more errors the linking completes ok and no freeze happens. But if there are more errors then they are reported on the output after which the program freezes up and sits there until it seems to time out and restart. this clears the output tab and still has the program code as if you started it by opening the ino file into arduino.

i should have said after I fix the reported error message it gets past it and works normally or it doesn’t if there are more linker errors. Then it freezes

There are compiler or linker errors and then there are Arduino program (the actual EXE) errors. The reported linker errors seem to cause a ARDUINO PROGRAM freeze error.

Bottom line is - if the ARDUINO PROGRAM encounters LINKER errors when compiling it freezes up. IF there are no errors then it works as expected.

Understand now?

Have a read of the following:

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966

In particular also this section om posting code.

It explains forum etiquette and how to post code and error messages so that that they are not affected by HTML formatting and are easily readable.

Ok, but when there are linker errors does it show them?

It may be useful to see an example of these when the problem arises. Ideally they should be copied and pasted into the post as described in the link, assuming that the "freezing" doesn't make the text impossible to copy.

BTW, I believe attaching a ZIP file is allowed for a large e.g log files so if its more than a kb or two, then that should be fine.

Hi @fluxanode1,

I think you're using "esp32 by Espressif Systems" as a platform package. I'd ask you which version you're using?

I'm having a similar issue with 2.0.17.

Here's the condition that causes the issue.

  • Host PC: macOS 11.7.10 Big Sur on a MacBook Pro [Late 2013]
  • Arduino IDE: 2.3.4
  • ESP32 platform package: 2.0.17
  • Board type: ESP32 Dev Module

Here's a screenshot:

While the status bar at the bottom is orange, selecting "Quit Arduino IDE" from the menu will not quit the IDE, and it will not quit until I kill some processes with the kill command.

After a while, the status bar will turn green and the quit command will become effective.

Here's the VERBOSE output: (It's long so I've omitted the middle part)

FQBN: esp32:esp32:esp32:UploadSpeed=460800,PartitionScheme=huge_app
Using board 'esp32' from platform in folder: /Users/xxxx/Library/Arduino15/packages/esp32/hardware/esp32/2.0.17
Using core 'esp32' from platform in folder: /Users/xxxx/Library/Arduino15/packages/esp32/hardware/esp32/2.0.17
..........
<command-line>: error: expected identifier before numeric constant
/Users/xxxx/Documents/Arduino/Arduino-CYD-2432S028R/LVGL/LVGL_Arduino_MP3Player/ESP32.hpp:40:7: note: in expansion of macro 'ESP32'
 class ESP32 {
       ^~~~~
<command-line>: error: expected unqualified-id before numeric constant
/Users/xxxx/Documents/Arduino/Arduino-CYD-2432S028R/LVGL/LVGL_Arduino_MP3Player/ESP32.hpp:40:7: note: in expansion of macro 'ESP32'
 class ESP32 {
       ^~~~~
/Users/xxxx/Documents/Arduino/Arduino-CYD-2432S028R/LVGL/LVGL_Arduino_MP3Player/LVGL_Arduino_MP3Player.ino: In function 'void loop()':
/Users/xxxx/Documents/Arduino/Arduino-CYD-2432S028R/LVGL/LVGL_Arduino_MP3Player/LVGL_Arduino_MP3Player.ino:321:14: error: expected ';' before '::' token
         ESP32::print_task();
              ^~
/Users/xxxx/Documents/Arduino/Arduino-CYD-2432S028R/LVGL/LVGL_Arduino_MP3Player/LVGL_Arduino_MP3Player.ino:324:14: error: expected ';' before '::' token
         ESP32::print_heap();
              ^~

Using library lvgl at version 9.4.0 in folder: /Users/xxxx/Documents/Arduino/libraries/lvgl 
Using library LovyanGFX at version 1.2.7 in folder: /Users/xxxx/Documents/Arduino/libraries/LovyanGFX 
Using library CYD_Audio at version 1.0.0 in folder: /Users/xxxx/Documents/Arduino/libraries/CYD_Audio 
Using library SPI at version 2.0.0 in folder: /Users/xxxx/Library/Arduino15/packages/esp32/hardware/esp32/2.0.17/libraries/SPI 
Using library WiFi at version 2.0.0 in folder: /Users/xxxx/Library/Arduino15/packages/esp32/hardware/esp32/2.0.17/libraries/WiFi 
Using library WiFiClientSecure at version 2.0.0 in folder: /Users/xxxx/Library/Arduino15/packages/esp32/hardware/esp32/2.0.17/libraries/WiFiClientSecure 
Using library SdFat at version 2.3.0 in folder: /Users/xxxx/Documents/Arduino/libraries/SdFat 

The error seems to be caused by using the symbol ESP32 as the class name, which is defined somewhere.

In my case, this problem does not occur with ESP32 3.3.4, the latest version.

Also, the following simple sketch causes a same compilation error, but does not cause a freeze even on 2.0.17.

#include <Arduino.h>

class ESP32 {
public:
  ESP32() {}
  ~ESP32() {}
  static void test(int a) {
    Serial.println(a);
  }
};

void setup() {
  Serial.begin(115200);
  while (millis() < 1000);

  ESP32::test(1);
}

void loop() {}

If I can find a simple example that reproduces the issue, I will report it to Issues, but as the entire source code currently consists of over 130,000 lines, this is not realistic.

The Arduino IDE developers are tracking the problem of the appearance of this "ping timeout" error notification during compilation here:

If you have a GitHub account, you can subscribe to that thread to get notifications of any new developments related to this subject:


:red_exclamation_mark: Please only comment on the GitHub issue thread if you have new technical information that will assist with the resolution. General discussion and support requests are always welcome here on Arduino Forum.


ptillisch

When will this issue be resolved?

I'm not sure if this will help to debug IDE, but I used the top command to capture the process status at the time the issue occurred.

Processes: 476 total, 4 running, 472 sleeping, 2133 threads            17:08:29
Load Avg: 5.14, 7.82, 6.65  CPU usage: 26.35% user, 2.58% sys, 71.5% idle
SharedLibs: 328M resident, 59M data, 30M linkedit.
MemRegions: 430863 total, 3741M resident, 77M private, 1704M shared.
PhysMem: 13G used (2370M wired), 2886M unused.
VM: 31T vsize, 2318M framework vsize, 623797(0) swapins, 1396543(0) swapouts.
Networks: packets: 6291992/4298M in, 5315445/2668M out.
Disks: 10606691/131G read, 3817626/133G written.

PID    COMMAND      %CPU TIME     #TH   #WQ  #PORT MEM    PURG   CMPRS  PGRP
17169  Arduino IDE  98.5 04:14.39 14/1  1    89    258M   0B     0B     17169
21702  top          5.5  00:05.13 1/1   0    26    3800K  0B     0B     21702
146    WindowServer 3.3  04:00:44 12    5    1634+ 553M-  11M    75M    146
0      kernel_task  2.2  85:27.41 183/4 0    0     254M   0B     0B     0
357    Terminal     1.4  01:59.00 10    4    354-  57M    3092K- 20M    357
385    ControlCente 0.7  23:23.40 7     4    370   14M+   1856K- 7208K  385
17176  Arduino IDE  0.3  00:04.63 22/1  1    91    32M+   0B     0B     17169
383    Dock         0.2  16:29.02 3     1    805   48M    0B     41M    383
17168  Arduino IDE  0.2  00:03.51 10    1    90    12M    0B     0B     17129
455    LanguageIM-R 0.2  04:40.35 7     3    317   60M    448K   40M-   455
17129  Arduino IDE  0.2  00:20.16 34    1    436   98M    36K    0B     17129
17171  Arduino IDE  0.1  05:07.94 14    1    215   746M   0B     0B     17129
94771  Dropbox      0.0  04:59.47 156   1    888   303M   0B     249M   94771
458    Google Chrom 0.0  65:10.43 13    1    294   238M   0B     11     377

While compiling normally, the %CPU of the Arduino IDE fluctuates between 30-70%, but when the issue occurs it rises to nearly 99%.