Skip to content

Commit d4ee440

Browse files
authored
Merge pull request #3475 from tannewt/esp_uf2
Reorganize sdkconfigs and release UF2s
2 parents 6bfcb01 + abdbbf9 commit d4ee440

File tree

14 files changed

+50
-23
lines changed

14 files changed

+50
-23
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ repos:
88
hooks:
99
- id: check-yaml
1010
- id: end-of-file-fixer
11-
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)'
11+
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/esp32s2/esp-idf-config/.*|ports/esp32s2/boards/.*/sdkconfig)'
1212
- id: trailing-whitespace
1313
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)'

ports/esp32s2/Makefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,17 @@ IDF_PATH = $(realpath ./esp-idf)
228228
$(BUILD)/esp-idf:
229229
$(Q)$(MKDIR) -p $@
230230

231+
FLASH_SDKCONFIG = esp-idf-config/sdkconfig-$(CIRCUITPY_ESP_FLASH_SIZE).defaults
232+
ifeq ($(DEBUG), 1)
233+
DEBUG_SDKCONFIG = esp-idf-config/sdkconfig-debug.defaults
234+
else
235+
DEBUG_SDKCONFIG = esp-idf-config/sdkconfig-opt.defaults
236+
endif
237+
SDKCONFIGS = esp-idf-config/sdkconfig.defaults;$(DEBUG_SDKCONFIG);$(FLASH_SDKCONFIG);boards/$(BOARD)/sdkconfig
238+
231239
# create the config headers
232240
$(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf
233-
IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig-$(CIRCUITPY_ESP_FLASH_SIZE).defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja
241+
IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja
234242

235243
# build a lib
236244
# Adding -d explain -j 1 -v to the ninja line will output debug info
@@ -247,10 +255,11 @@ $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld: $(BUILD)/esp-idf/config/
247255
$(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sdkconfig.h
248256
IDF_PATH=$(IDF_PATH) ninja -C $(BUILD)/esp-idf partition_table/partition-table.bin
249257

250-
# run menuconfig
258+
# run menuconfig and then remove standard settings
251259
menuconfig: $(BUILD)/esp-idf/config
252260
$(Q)ninja -C $(BUILD)/esp-idf menuconfig
253-
$(Q)diff --old-line-format= --unchanged-line-format= sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > boards/$(BOARD)/sdkconfig || true
261+
$(Q)diff --old-line-format= --unchanged-line-format= esp-idf-config/sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > $(BUILD)/sdkconfig.diff || true
262+
$(Q)grep -Fvxf $(DEBUG_SDKCONFIG) -f $(FLASH_SDKCONFIG) $(BUILD)/sdkconfig.diff > boards/$(BOARD)/sdkconfig
254263

255264
# qstr builds include headers so we need to make sure they are up to date
256265
$(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h
@@ -307,8 +316,6 @@ $(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp
307316
$(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf
308317
$(STEPECHO) "Create $@"
309318
$(Q)esptool.py --chip esp32s2 elf2image $(FLASH_FLAGS) --elf-sha256-offset 0xb0 -o $@ $^
310-
# $(Q)$(OBJCOPY) -O binary $^ $@
311-
# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@
312319

313320
$(BUILD)/firmware.bin: $(BUILD)/circuitpython-firmware.bin | esp-idf-stamp
314321
$(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin

ports/esp32s2/boards/microdev_micro_s2/sdkconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ CONFIG_DEFAULT_PSRAM_CLK_IO=30
1616
CONFIG_DEFAULT_PSRAM_CS_IO=26
1717
# end of PSRAM clock and cs IO for ESP32S2
1818

19-
CONFIG_SPIRAM_SPIWP_SD3_PIN=28
2019
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
2120
# CONFIG_SPIRAM_RODATA is not set
22-
# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set
2321
# CONFIG_SPIRAM_SPEED_80M is not set
2422
CONFIG_SPIRAM_SPEED_40M=y
2523
# CONFIG_SPIRAM_SPEED_26M is not set
@@ -33,3 +31,4 @@ CONFIG_SPIRAM_USE_MEMMAP=y
3331
CONFIG_SPIRAM_MEMTEST=y
3432
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
3533
# end of SPI RAM config
34+

ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ CONFIG_DEFAULT_PSRAM_CLK_IO=30
1616
CONFIG_DEFAULT_PSRAM_CS_IO=26
1717
# end of PSRAM clock and cs IO for ESP32S2
1818

19-
CONFIG_SPIRAM_SPIWP_SD3_PIN=28
2019
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
2120
# CONFIG_SPIRAM_RODATA is not set
22-
# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set
2321
# CONFIG_SPIRAM_SPEED_80M is not set
2422
CONFIG_SPIRAM_SPEED_40M=y
2523
# CONFIG_SPIRAM_SPEED_26M is not set
@@ -33,3 +31,4 @@ CONFIG_SPIRAM_USE_MEMMAP=y
3331
CONFIG_SPIRAM_MEMTEST=y
3432
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
3533
# end of SPI RAM config
34+
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
1+
# No newlines in this file so they are preserved in the board sdkconfig.
22
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
33
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
44
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
55
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
66
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
77
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
8-
9-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MB.csv"
10-
CONFIG_PARTITION_TABLE_FILENAME="partitions-16MB.csv"
8+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-16MB.csv"
9+
CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-16MB.csv"
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
1+
# No newlines in this file so they are preserved in the board sdkconfig.
22
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
33
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
44
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
55
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
66
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
77
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
8-
9-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MB.csv"
10-
CONFIG_PARTITION_TABLE_FILENAME="partitions-4MB.csv"
8+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB.csv"
9+
CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB.csv"
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
1+
# No newlines in this file so they are preserved in the board sdkconfig.
22
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
33
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
44
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
55
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
66
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
77
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"
8-
9-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MB.csv"
10-
CONFIG_PARTITION_TABLE_FILENAME="partitions-8MB.csv"
8+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB.csv"
9+
CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB.csv"

0 commit comments

Comments
 (0)