PlatformIO Community

The command line is too long (windows)

Using the latest platformio vscode to build an esp32 with arduino and the espidf. The linker doesn’t seem to convert the command into a long cmd like during includes and compiling.

Building in release mode
xtensa-esp32-elf-g++ -o .pio\build\e32\firmware.elf -T esp32_out.ld -u esp_app_desc -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -u app_main -T esp32.project.ld -T esp32.peripherals.ld -u call_user_start_cpu0 -u ld_include_panic_highint_hdl -T esp32.rom.ld -T esp32.rom.libgcc.ld -T esp32.rom.syscalls.ld -T esp32.rom.newlib-data.ld -T esp32.rom.newlib-funcs.ld -u vfs_include_syscalls_impl -u newlib_include_locks_impl -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -u __cxa_guard_dummy -u __cxx_fatal_exception -Wl,–Map=C:/Users/ani/codebase/microcontroller/.pio/build/e32/microcontroller.map -Wl,–cref -Wl,–gc-sections -Wl,–undefined=uxTopUsedPriority -Wno-frame-address -fno-lto -fno-rtti -mlongcalls -nostdlib .pio\build\e32\esp-idf\src\AirControl\Motor\Motor.cpp.o .pio\build\e32\esp-idf\src\AirControl\PID\PID.cpp.o .pio\build\e32\esp-idf\src\AirControl\Pattern\Pattern.cpp.o .pio\build\e32\esp-idf\src\AirControl\Pattern\PatternDefinitions.cpp.o .pio\build\e32\esp-idf\src\AirControl\Phase\Phase.cpp.o .pio\build\e32\esp-idf\src\AirControl\Phase\PhaseDefinitions.cpp.o .pio\build\e32\esp-idf\src\AirControl\Routine\Routine.cpp.o .pio\build\e32\esp-idf\src\AirControl\Routine\RoutineDefinitions.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\DangerousFlowCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\DangerousPressureCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\DangerousPressureFluctuationCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\FlowCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\OverpressureCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\PressureCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\SensorIssueCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\TerminationConditions.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\TimeCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\TerminationConditions\VolumeCondition.cpp.o .pio\build\e32\esp-idf\src\AirControl\Valve\ExpiratoryValve.cpp.o .pio\build\e32\esp-idf\src\AirControl\Valve\OxygenRegulator.cpp.o .pio\build\e32\esp-idf\src\AirControl\Valve\Valve.cpp.o .pio\build\e32\esp-idf\src\Config\Alarm.cpp.o .pio\build\e32\esp-idf\src\Config\Config.cpp.o .pio\build\e32\esp-idf\src\Config\Developer.cpp.o .pio\build\e32\esp-idf\src\Config\Operating.cpp.o .pio\build\e32\esp-idf\src\Config\Patient.cpp.o .pio\build\e32\esp-idf\src\Config\Pattern.cpp.o .pio\build\e32\esp-idf\src\Config\Pin.cpp.o .pio\build\e32\esp-idf\src\Config\Settings.cpp.o .pio\build\e32\esp-idf\src\Display.cpp.o .pio\build\e32\esp-idf\src\DoublePID\DoublePID.cpp.o .pio\build\e32\esp-idf\src\Event\EventWatcher.cpp.o .pio\build\e32\esp-idf\src\Event\EventWatcherDefinitions.cpp.o .pio\build\e32\esp-idf\src\Measuring\AnalogReadings\AnalogReadings.cpp.o .pio\build\e32\esp-idf\src\Measuring\MeasuringFunctions\Flow.cpp.o .pio\build\e32\esp-idf\src\Measuring\MeasuringFunctions\LeastSquareFit\test.c.o .pio\build\e32\esp-idf\src\Measuring\MeasuringFunctions\Oxygen.cpp.o .pio\build\e32\esp-idf\src\Measuring\MeasuringFunctions\PatientStatistics.cpp.o .pio\build\e32\esp-idf\src\Measuring\MeasuringFunctions\Pressure.cpp.o .pio\build\e32\esp-idf\src\Measuring\MeasuringFunctions\RespiratoryMechanics.cpp.o .pio\build\e32\esp-idf\src\Measuring\Observable\Observable.cpp.o .pio\build\e32\esp-idf\src\Measuring\Observable\ObservableDefinitions.cpp.o .pio\build\e32\esp-idf\src\Sound\Sound.cpp.o .pio\build\e32\esp-idf\src\Web\HandleWiFi.cpp.o .pio\build\e32\esp-idf\src\Web\OTA\AsyncOTA.cpp.o .pio\build\e32\esp-idf\src\Web\SendReadings.cpp.o .pio\build\e32\esp-idf\src\Web\Server.cpp.o .pio\build\e32\esp-idf\src\main.cpp.o .pio\build\e32\esp-idf\src\tasks.cpp.o -L.pio\build\e32 -LC:\Users\ani.platformio\packages\framework-espidf@3.40001.200521\components\esp_wifi\lib_esp32 -LC:\Users\ani.platformio\packages\framework-espidf@3.40001.200521\components\esp_wifi\lib_esp32 -L.pio\build\e32\esp-idf\esp32 -L.pio\build\e32\esp-idf\esp32\ld -LC:\Users\ani.platformio\packages\framework-espidf@3.40001.200521\components\esp32\ld -LC:\Users\ani.platformio\packages\framework-espidf@3.40001.200521\components\xtensa\esp32 -LC:\Users\ani.platformio\packages\framework-espidf@3.40001.200521\components\esp_rom\esp32\ld -Wl,–start-group .pio\build\e32\libb65\libArduinoJson_ID64.a .pio\build\e32\liba10\libMAX30100.a .pio\build\e32\lib790\libAsyncTCP.a “.pio\build\e32\libbb5\libESP Async WebServer.a” .pio\build\e32\lib95f\libMiniPID.a .pio\build\e32\lib551\libesp8266-oled-ssd1306.a .pio\build\e32\libd47\libJQ6500_Serial.a .pio\build\e32\lib7f6\libcircular_buffer.a .pio\build\e32\esp-idf\esp_ringbuf\libesp_ringbuf.a .pio\build\e32\esp-idf\asio\libasio.a .pio\build\e32\esp-idf\esp-tls\libesp-tls.a .pio\build\e32\esp-idf\console\libconsole.a
.pio\build\e32\esp-idf\coap\libcoap.a .pio\build\e32\esp-idf\nghttp\libnghttp.a .pio\build\e32\esp-idf\esp_adc_cal\libesp_adc_cal.a .pio\build\e32\esp-idf\esp_gdbstub\libesp_gdbstub.a .pio\build\e32\esp-idf\tcp_transport\libtcp_transport.a .pio\build\e32\esp-idf\esp_http_server\libesp_http_server.a .pio\build\e32\esp-idf\esp_http_client\libesp_http_client.a .pio\build\e32\esp-idf\esp_https_ota\libesp_https_ota.a .pio\build\e32\esp-idf\protobuf-c\libprotobuf-c.a .pio\build\e32\esp-idf\esp_local_ctrl\libesp_local_ctrl.a .pio\build\e32\esp-idf\protocomm\libprotocomm.a .pio\build\e32\esp-idf\esp_websocket_client\libesp_websocket_client.a .pio\build\e32\esp-idf\mdns\libmdns.a .pio\build\e32\esp-idf\sdmmc\libsdmmc.a .pio\build\e32\esp-idf\fatfs\libfatfs.a .pio\build\e32\esp-idf\wear_levelling\libwear_levelling.a .pio\build\e32\esp-idf\expat\libexpat.a .pio\build\e32\esp-idf\freemodbus\libfreemodbus.a .pio\build\e32\esp-idf\json\libjson.a .pio\build\e32\esp-idf\jsmn\libjsmn.a .pio\build\e32\esp-idf\spiffs\libspiffs.a .pio\build\e32\esp-idf\libsodium\liblibsodium.a .pio\build\e32\esp-idf\openssl\libopenssl.a .pio\build\e32\esp-idf\ulp\libulp.a .pio\build\e32\esp-idf\mqtt\libmqtt.a .pio\build\e32\esp-idf\unity\libunity.a .pio\build\e32\esp-idf\wifi_provisioning\libwifi_provisioning.a .pio\build\e32\esp-idf\framework-arduinoespressif32-src-c69fc9322995db5694e2741d307d9723\libframework-arduinoespressif32-src-c69fc9322995db5694e2741d307d9723.a .pio\build\e32\esp-idf\app_trace\libapp_trace.a .pio\build\e32\esp-idf\app_update\libapp_update.a .pio\build\e32\esp-idf\bootloader_support\libbootloader_support.a .pio\build\e32\esp-idf\cxx\libcxx.a .pio\build\e32\esp-idf\driver\libdriver.a .pio\build\e32\esp-idf\efuse\libefuse.a .pio\build\e32\esp-idf\esp32\libesp32.a .pio\build\e32\esp-idf\esp_common\libesp_common.a .pio\build\e32\esp-idf\esp_eth\libesp_eth.a .pio\build\e32\esp-idf\esp_event\libesp_event.a .pio\build\e32\esp-idf\esp_rom\libesp_rom.a .pio\build\e32\esp-idf\esp_wifi\libesp_wifi.a .pio\build\e32\esp-idf\espcoredump\libespcoredump.a .pio\build\e32\esp-idf\freertos\libfreertos.a .pio\build\e32\esp-idf\heap\libheap.a .pio\build\e32\esp-idf\log\liblog.a .pio\build\e32\esp-idf\lwip\liblwip.a .pio\build\e32\esp-idf\newlib\libnewlib.a .pio\build\e32\esp-idf\nvs_flash\libnvs_flash.a .pio\build\e32\esp-idf\pthread\libpthread.a .pio\build\e32\esp-idf\soc\libsoc.a .pio\build\e32\esp-idf\spi_flash\libspi_flash.a .pio\build\e32\esp-idf\tcpip_adapter\libtcpip_adapter.a .pio\build\e32\esp-idf\vfs\libvfs.a .pio\build\e32\esp-idf\wpa_supplicant\libwpa_supplicant.a .pio\build\e32\esp-idf\xtensa\libxtensa.a .pio\build\e32\esp-idf\mbedtls\mbedtls\library\libmbedcrypto.a .pio\build\e32\esp-idf\mbedtls\mbedtls\library\libmbedtls.a .pio\build\e32\esp-idf\mbedtls\mbedtls\library\libmbedx509.a -lcoexist -lcore -lespnow -lmesh -lnet80211 -lphy -lpp -lrtc -lsmartconfig -lhal -lstdc++ -lgcov -lc -lm -lgcc -Wl,–end-group

The command line is too long.
*** [.pio\build\e32\firmware.elf] Error 1

I’m afraid this won’t help you much but in a cmd.com session the limit is 2047 characters. I believe in PowerShell it’s 8191. This is true on Windows 10 as well as previous versions.

https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation has some details and a workaround. I’m not sure it applies though.

If you are using VSCode, open the settings page and search for “terminal.integrated.shell.window”. I believe you can select cmd.com, the default, or choose PowerShell.

Knowing Windows, using PowerShell will introduce its own bucket of problems! :grin:

Cheers,
Norm.

Bug reports to https://github.com/platformio/platform-espressif32/issues for @valeros, not the forum.