esp-wifi: dhcp_esp32c3 example fails to get an IP address when compiled in Release

When the dhcp_esp32c3 is ran in release it hangs at Start busy loop on main and never continues. This same dhcp_esp32c3 example gets an IP address from DHCP as expected for me when it’s ran in debug.

Related to #6?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Thanks a lot for the effort

opt-level 0: After setting profile.release opt-level to 0 running cargo clean the esp fails to print the very first println!(“{:?}”, wifi_interface.get_status());. This is very strange since I would have expected opt-level 0 to be equivalent to the dev profile.

That is very surprising since it should be almost the same as dev profile. Very interesting

Really sorry for the inconvenience but the good thing is that we see similar behavior now in a PR ( #39 ) which changes some totally unrelated code - maybe finding out what is going on there might help here

Thanks! There are a few more things worth to try

  • try the different opt-levels for the release profile (0,1,2,3,“s”,“z”) to see if that makes any difference
  • comment out the wifi scanning (it’s not needed for connecting)

Just to summarize what we know until know (and make sure I got everything correctly)

  • it works in debug mode with your access-point
  • it works with your phone’s hot-spot also in release mode

Another thing that would be interesting but probably isn’t convenient to try: Configuring different auth-methods on your AP - but I totally understand if you don’t want to mess with your AP’s configuration

I do have a branch which swaps out the allocator for esp-alloc, and I ran the dhcp_esp32c3 example on it multiple times today successfully. Might be worth giving a shot. I hope to get this merged soon (there are still some issues for the ESP32 in my branch, but ESP32-C3 has been working for me).

https://github.com/jessebraham/esp-wifi/tree/fixes/esp-alloc