diff --git a/pio-tools/set_partition_table_esp32.py b/pio-tools/set_partition_table_esp32.py new file mode 100644 index 000000000..e123d40ec --- /dev/null +++ b/pio-tools/set_partition_table_esp32.py @@ -0,0 +1,22 @@ +# +# The scipt sets the missing "PARTITIONS_TABLE_CSV" when using the command `pio run -t nobuild` +# Adopted from https://github.com/platformio/platform-espressif32/issues/861#issuecomment-1241871437 +# Possible now to upload the firmware or the filesystem with (when builded already!): +# +# `pio run -t nobuild -t upload` and `pio run -t nobuild -t uploadfs` +# + +Import("env") + +import os +from SCons.Script import COMMAND_LINE_TARGETS + +board_config = env.BoardConfig() + +if "nobuild" in COMMAND_LINE_TARGETS: + env.Replace( + PARTITIONS_TABLE_CSV=os.path.join( + board_config.get("build.partitions"), + ) + ) +# print("Set PARTITIONS_TABLE_CSV to: ", os.path.join(board_config.get("build.partitions"))) diff --git a/pio-tools/set_partition_table_esp8266.py b/pio-tools/set_partition_table_esp8266.py new file mode 100644 index 000000000..a74c6cec7 --- /dev/null +++ b/pio-tools/set_partition_table_esp8266.py @@ -0,0 +1,28 @@ +# +# The scipt sets the missing "LDSCRIPT_PATH" when using the command `pio run -t nobuild` +# Adopted from https://github.com/platformio/platform-espressif32/issues/861#issuecomment-1241871437 +# Possible now to upload the firmware or the filesystem with (when builded already!): +# +# `pio run -t nobuild -t upload` and `pio run -t nobuild -t uploadfs` +# + +Import("env") + +import os +from SCons.Script import COMMAND_LINE_TARGETS + +board_config = env.BoardConfig() +framework_dir = env.PioPlatform().get_package_dir("framework-arduinoespressif8266") +assert os.path.isdir(framework_dir) + +if "nobuild" in COMMAND_LINE_TARGETS: + env.Replace( + LDSCRIPT_PATH=os.path.join( + framework_dir, + "tools", + "sdk", + "ld", + board_config.get("build.arduino.ldscript"), + ) + ) +# print("Set LDSCRIPT_PATH to: ", os.path.join(framework_dir,"tools","sdk","ld",board_config.get("build.arduino.ldscript"))) diff --git a/platformio.ini b/platformio.ini index 611ffbb11..0805bf840 100644 --- a/platformio.ini +++ b/platformio.ini @@ -65,11 +65,11 @@ lib_extra_dirs = [scripts_defaults] extra_scripts = pre:pio-tools/pre_source_dir.py - pio-tools/strip-floats.py - pio-tools/name-firmware.py - pio-tools/gzip-firmware.py - pio-tools/override_copy.py - pio-tools/download_fs.py + pre:pio-tools/strip-floats.py + post:pio-tools/name-firmware.py + post:pio-tools/gzip-firmware.py + post:pio-tools/override_copy.py + post:pio-tools/download_fs.py [esp_defaults] extra_scripts = ${scripts_defaults.extra_scripts} @@ -92,6 +92,8 @@ build_flags = -DCORE_DEBUG_LEVEL=0 ; ********************************************************************* [esp82xx_defaults] +extra_scripts = ${esp_defaults.extra_scripts} + pre:pio-tools/set_partition_table_esp8266.py build_flags = ${esp_defaults.build_flags} -DNDEBUG -DFP_IN_IROM diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index 1d2c2f2db..c475bd1f1 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -37,7 +37,8 @@ build_flags = ${esp_defaults.build_flags} -Wl,--wrap=_Z11analogWritehi ; `analogWrite(unsigned char, int)` use the Tasmota version of analogWrite for deeper integration and phase control -Wl,--wrap=ledcReadFreq ; `uint32_t ledcReadFreq(uint8_t chan)` extra_scripts = pre:pio-tools/add_c_flags.py - pio-tools/gen-berry-structures.py + pre:pio-tools/gen-berry-structures.py + pre:pio-tools/set_partition_table_esp32.py post:pio-tools/post_esp32.py ${esp_defaults.extra_scripts} diff --git a/platformio_tasmota_env.ini b/platformio_tasmota_env.ini index b6357670a..270046bcb 100644 --- a/platformio_tasmota_env.ini +++ b/platformio_tasmota_env.ini @@ -29,6 +29,8 @@ lib_ignore = Hash ; Disable next if you want to use ArduinoOTA in Tasmota (default disabled) ArduinoOTA +; Add files to Filesystem for all env (global). Remove no files entry and add add a line with the file to include +custom_files_upload = no_files [env:tasmota]