GXAirCom icon indicating copy to clipboard operation
GXAirCom copied to clipboard

Add 8MB/16MB flash configs for Heltec Lora32/lilygo T-sim7000

Open bzed opened this issue 2 years ago • 5 comments

bzed avatar Nov 19 '22 16:11 bzed

The Problem is, that many boards have only 4MB Flash and I want to be comatible. So I want to leave it to 4MB Flash. As when I switch to esp v5.0.0 the Flash is completely full. Maybe it works, when switching from PlatformIO (Arduino-IDE) to ESP-IDF In ESP-IDF you can switch of components, which are not used and so you can safe flash-image-size.

What do you think about it ?

gereic avatar Nov 21 '22 17:11 gereic

@gereic yes, but the change doesn't change anything for those boards? it just adds the option to have more features on larger boards. Like I'll implement wireguard for the larger boards. Wrapping that into ifdefs and enabling it only for the boards with more flash is possible. I've kept the spiff/data size the same on all boards, so thats also compatible.

As far as I understand the esp-idf component thing, its the same as the libraries in pio. You can't disable the library dependency finder and handle them manually in pio, too - although in theory it should not include libraries that are not in use.

But what I think you might want to set is lib_ldf_mode = chain+ (default is chain, without +), so ifdefs are actually handled properly.

bzed avatar Nov 21 '22 18:11 bzed

lib_ldf_mode = chain+ (or deep+) doesn't work as its not able to find the include of WiFi.h deeep in the websockets header. Not sure if there is a workaround except for managing the libs manually.

bzed avatar Nov 21 '22 18:11 bzed

I think it will decrease the flash-size, when I unset Options for the small Boards (IPV6, BLuettoth Classic, CAN, ...) Will Try it.

gereic avatar Nov 21 '22 18:11 gereic

I think it will decrease the flash-size, when I unset Options for the small Boards (IPV6, BLuettoth Classic, CAN, ...) Will Try it.

I'd expect that the parts might be built by pio, but not linked into the image.

Tricking the LDF into using the wifi module for websockets doesn't change the image size. But a large part of the image seem to be debug information:

debug_frame                                                                                                                                                                                                427116            0
.debug_info                                                                                                                                                                                               10752201            0
.debug_abbrev                                                                                                                                                                                               874442            0
.debug_loc                                                                                                                                                                                                 2648728            0
.debug_aranges                                                                                                                                                                                              158696            0
.debug_ranges                                                                                                                                                                                               251584            0
.debug_macro                                                                                                                                                                                                650315            0
.debug_line                                                                                                                                                                                                3480464            0
.debug_str                                                                                                                                                                                                 2804742            0

bzed avatar Nov 21 '22 18:11 bzed