0

I have an ESP32-D0WDQ6, which is part of the ESPIRIT freematics development kit. The processor is a 2-core Tensilica LX6 and the module has 520 kB SRAM + 4 MB external on-module flash. It also has the SIM5360E 3G/GSM module. So with that connection, I don't need neither the Bluetooth nor the WiFi stack. However, it seem that when compiling using the Arduino IDE, all these libraries are still included in the compile, even if not used. This is bad as it seem to take up a lot of extra FW space that I need for my growing app, while running my device at high currents, and heating it up.

How can I ensure that WiFi/Bluetooth libraries are not compiled in with the Sketch when using Arduino IDE?

At this point I have tried to disable them, but that required to #include Wifi.h (or similar) which no longer fit on my sketch. (This doesn't make any sense, that I need to include Wifi.h just to be able to disable it.)


UPDATE:
It's most definitely linking all those...


#--------------------------------------
# Linking everything together...
#--------------------------------------

"C:\\Users\\XXX\\Documents\\Arduino\\hardware\\espressif\\esp32/tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc" 
-nostdlib "-LC:\\Users\\XXX\\Documents\\Arduino\\hardware\\espressif\\esp32/tools/sdk/lib"

    "-LC:\\Users\\XXX\\Documents\\Arduino\\hardware\\espressif\\esp32/tools/sdk/ld" 
    -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld 
    -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static 
    -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception 
    -Wl,--start-group "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\sketch\\BTHealthThermometer.cpp.o"

    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\sketch\\ECUBluetoothTask.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\sketch\\FreematicsNetwork.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\sketch\\FreematicsPlus.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\sketch\\KolbanTask.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\sketch\\eCUesp32.ino.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\sketch\\eCUlogging.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\sketch\\esp32fota.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLE2902.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLE2904.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEAddress.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEAdvertisedDevice.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEAdvertising.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEBeacon.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLECharacteristic.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLECharacteristicMap.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEClient.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEDescriptor.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEDescriptorMap.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEDevice.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEEddystoneTLM.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEEddystoneURL.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEExceptions.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEHIDDevice.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLERemoteCharacteristic.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLERemoteDescriptor.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLERemoteService.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEScan.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLESecurity.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEServer.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEService.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEServiceMap.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEUUID.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEUtils.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\BLEValue.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\FreeRTOS.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\BLE\\GeneralUtils.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\ETH.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFi.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFiAP.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFiClient.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFiGeneric.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFiMulti.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFiSTA.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFiScan.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFiServer.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFi\\WiFiUdp.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\SPI\\SPI.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\SD\\SD.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\SD\\sd_diskio.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\SD\\sd_diskio_crc.c.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\FS\\FS.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\FS\\vfs_api.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\HTTPClient\\HTTPClient.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFiClientSecure\\WiFiClientSecure.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\WiFiClientSecure\\ssl_client.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\libraries\\Update\\Updater.cpp.o"
    "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833\\core\\core.a" 


-lgcc
-lopenssl
-lbtdm_app
-lfatfs
-lwps
-lcoexist
-lwear_levelling
-lesp_http_client
-lprotobuf-c
-lhal
-lnewlib
-ldriver
-lbootloader_support
-lpp
-lfreemodbus
-lmesh
-lsmartconfig
-ljsmn
-lwpa
-lethernet
-lphy
-lapp_trace
-lconsole
-lulp
-lwpa_supplicant
-lfreertos
-lbt
-lmicro-ecc
-lesp32-camera
-lcxx
-lxtensa-debug-module
-ltcp_transport
-lmdns
-lvfs
-lesp_ringbuf
-lsoc
-lcore
-lfb_gfx
-lsdmmc
-llibsodium
-lcoap
-ltcpip_adapter
-lprotocomm
-lesp_event
-limage_util
-lc_nano
-lesp-tls
-lasio
-lrtc
-lspi_flash
-lwpa2
-lwifi_provisioning
-lesp32
-lface_recognition
-lapp_update
-lnghttp
-lspiffs
-lface_detection
-lespnow
-lnvs_flash
-lesp_adc_cal
-llog
-ldl_lib
-lsmartconfig_ack
-lexpat
-lm
-lfr
-lmqtt
-lc
-lheap
-lmbedtls
-llwip
-lnet80211
-lesp_http_server
-lpthread
-ljson
-lesp_https_ota
-lfd
-lstdc++
-Wl,--end-group
-Wl,-EL
-o "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833/eCUesp32.ino.elf"

"C:\\Users\\XXX\\Documents\\Arduino\\hardware\\espressif\\esp32/tools/gen_esp32part.exe" 
-q "C:\\Users\\XXX\\Documents\\Arduino\\hardware\\espressif\\esp32/tools/partitions/default.csv" 
"C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833/eCUesp32.ino.partitions.bin"


"C:\\Users\\XXX\\Documents\\Arduino\\hardware\\espressif\\esp32/tools/esptool/esptool.exe" 
--chip esp32 elf2image --flash_mode dio --flash_freq 80m --flash_size 4MB 
-o "C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833/eCUesp32.ino.bin" 
"C:\\Users\\XXX\\AppData\\Local\\Temp\\arduino_build_245833/eCUesp32.ino.elf"


  • the arduino libraries are not linked if you don't use them. but the closed source SDK is precompiled in 80 .a files. using esp without Espressif SDK is like using a computer without OS. – Juraj Jul 2 at 17:59
  • That's weird, because during the linker part it seem that it links a whole bunch of libraries that I'm supposedly not using. So then there must be 2nd/3rd dependencies that are using them. I'll post the linker output tomorrow. So are there any open alternatives to the SDK? – not2qubit Jul 2 at 18:28
  • Arduino libraries are a thin layer over the SDK. – Juraj Jul 3 at 5:25
  • 1
    I'm not quite sure, but I'd think that your best option would be to forfeit the Arduino libs and build directly on the Espressif SDK... – orithena Jul 3 at 14:45
  • Yeah, I really wish that Arduino devs could provide better control for this. Or at least clearly document what are the dependency chain of all the other libraries. WiFi and BT are both huge, so it would be great to be able to get rid of those, when not needed. – not2qubit Jul 4 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.