summaryrefslogtreecommitdiff
path: root/ports/esp32s2
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-09-17 16:01:23 -0700
committerScott Shawcroft <scott@tannewt.org>2020-09-17 16:01:23 -0700
commit17bdc969dbd060eec60de067f21f8d4143e80bd8 (patch)
tree84c6bb2a00bf31a433895cfb39fc8f2e558962cb /ports/esp32s2
parent7f60ebd6c76841b338a4566c28c7cbfe28bee797 (diff)
Reorganize sdkconfigs and release UF2s
Diffstat (limited to 'ports/esp32s2')
-rw-r--r--ports/esp32s2/Makefile18
-rw-r--r--ports/esp32s2/boards/microdev_micro_s2/sdkconfig3
-rw-r--r--ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig3
-rw-r--r--ports/esp32s2/esp-idf-config/partitions-16MB.csv (renamed from ports/esp32s2/partitions-16MB.csv)0
-rw-r--r--ports/esp32s2/esp-idf-config/partitions-4MB.csv (renamed from ports/esp32s2/partitions-4MB.csv)0
-rw-r--r--ports/esp32s2/esp-idf-config/partitions-8MB.csv (renamed from ports/esp32s2/partitions-8MB.csv)0
-rw-r--r--ports/esp32s2/esp-idf-config/sdkconfig-16MB.defaults (renamed from ports/esp32s2/sdkconfig-16MB.defaults)7
-rw-r--r--ports/esp32s2/esp-idf-config/sdkconfig-4MB.defaults (renamed from ports/esp32s2/sdkconfig-4MB.defaults)7
-rw-r--r--ports/esp32s2/esp-idf-config/sdkconfig-8MB.defaults (renamed from ports/esp32s2/sdkconfig-8MB.defaults)7
-rw-r--r--ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults13
-rw-r--r--ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults12
-rw-r--r--ports/esp32s2/esp-idf-config/sdkconfig.defaults (renamed from ports/esp32s2/sdkconfig.defaults)0
12 files changed, 49 insertions, 21 deletions
diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile
index 229a3bf3a..662be481e 100644
--- a/ports/esp32s2/Makefile
+++ b/ports/esp32s2/Makefile
@@ -228,9 +228,17 @@ IDF_PATH = $(realpath ./esp-idf)
$(BUILD)/esp-idf:
$(Q)$(MKDIR) -p $@
+FLASH_SDKCONFIG = esp-idf-config/sdkconfig-$(CIRCUITPY_ESP_FLASH_SIZE).defaults
+ifeq ($(DEBUG), 1)
+ DEBUG_SDKCONFIG = esp-idf-config/sdkconfig-debug.defaults
+else
+ DEBUG_SDKCONFIG = esp-idf-config/sdkconfig-opt.defaults
+endif
+SDKCONFIGS = esp-idf-config/sdkconfig.defaults;$(DEBUG_SDKCONFIG);$(FLASH_SDKCONFIG);boards/$(BOARD)/sdkconfig
+
# create the config headers
$(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf
- 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
+ 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
# build a lib
# Adding -d explain -j 1 -v to the ninja line will output debug info
@@ -247,10 +255,12 @@ $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld: $(BUILD)/esp-idf/config/
$(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sdkconfig.h
IDF_PATH=$(IDF_PATH) ninja -C $(BUILD)/esp-idf partition_table/partition-table.bin
-# run menuconfig
+# run menuconfig and then remove standard settings
menuconfig: $(BUILD)/esp-idf/config
$(Q)ninja -C $(BUILD)/esp-idf menuconfig
- $(Q)diff --old-line-format= --unchanged-line-format= sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > boards/$(BOARD)/sdkconfig || true
+ $(Q)diff --old-line-format= --unchanged-line-format= esp-idf-config/sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > $(BUILD)/sdkconfig.diff || true
+ $(Q)grep -Fvxf $(FLASH_SDKCONFIG) $(BUILD)/sdkconfig.diff > $(BUILD)/sdkconfig.stripped1
+ $(Q)grep -Fvxf $(DEBUG_SDKCONFIG) $(BUILD)/sdkconfig.stripped1 > boards/$(BOARD)/sdkconfig
# qstr builds include headers so we need to make sure they are up to date
$(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h
@@ -307,8 +317,6 @@ $(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp
$(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf
$(STEPECHO) "Create $@"
$(Q)esptool.py --chip esp32s2 elf2image $(FLASH_FLAGS) --elf-sha256-offset 0xb0 -o $@ $^
-# $(Q)$(OBJCOPY) -O binary $^ $@
-# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@
$(BUILD)/firmware.bin: $(BUILD)/circuitpython-firmware.bin | esp-idf-stamp
$(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
diff --git a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig
index b73c4a8c2..67ac6d2f3 100644
--- a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig
+++ b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig
@@ -16,10 +16,8 @@ CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26
# end of PSRAM clock and cs IO for ESP32S2
-CONFIG_SPIRAM_SPIWP_SD3_PIN=28
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
# CONFIG_SPIRAM_RODATA is not set
-# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set
# CONFIG_SPIRAM_SPEED_80M is not set
CONFIG_SPIRAM_SPEED_40M=y
# CONFIG_SPIRAM_SPEED_26M is not set
@@ -33,3 +31,4 @@ CONFIG_SPIRAM_USE_MEMMAP=y
CONFIG_SPIRAM_MEMTEST=y
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# end of SPI RAM config
+
diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig
index b73c4a8c2..67ac6d2f3 100644
--- a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig
+++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig
@@ -16,10 +16,8 @@ CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26
# end of PSRAM clock and cs IO for ESP32S2
-CONFIG_SPIRAM_SPIWP_SD3_PIN=28
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
# CONFIG_SPIRAM_RODATA is not set
-# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set
# CONFIG_SPIRAM_SPEED_80M is not set
CONFIG_SPIRAM_SPEED_40M=y
# CONFIG_SPIRAM_SPEED_26M is not set
@@ -33,3 +31,4 @@ CONFIG_SPIRAM_USE_MEMMAP=y
CONFIG_SPIRAM_MEMTEST=y
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# end of SPI RAM config
+
diff --git a/ports/esp32s2/partitions-16MB.csv b/ports/esp32s2/esp-idf-config/partitions-16MB.csv
index 13ea81bea..13ea81bea 100644
--- a/ports/esp32s2/partitions-16MB.csv
+++ b/ports/esp32s2/esp-idf-config/partitions-16MB.csv
diff --git a/ports/esp32s2/partitions-4MB.csv b/ports/esp32s2/esp-idf-config/partitions-4MB.csv
index cf9b3cca8..cf9b3cca8 100644
--- a/ports/esp32s2/partitions-4MB.csv
+++ b/ports/esp32s2/esp-idf-config/partitions-4MB.csv
diff --git a/ports/esp32s2/partitions-8MB.csv b/ports/esp32s2/esp-idf-config/partitions-8MB.csv
index f4ba9b60a..f4ba9b60a 100644
--- a/ports/esp32s2/partitions-8MB.csv
+++ b/ports/esp32s2/esp-idf-config/partitions-8MB.csv
diff --git a/ports/esp32s2/sdkconfig-16MB.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-16MB.defaults
index af477999b..2299feccd 100644
--- a/ports/esp32s2/sdkconfig-16MB.defaults
+++ b/ports/esp32s2/esp-idf-config/sdkconfig-16MB.defaults
@@ -1,10 +1,9 @@
-
+# No newlines in this file so they are preserved in the board sdkconfig.
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
-
-CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MB.csv"
-CONFIG_PARTITION_TABLE_FILENAME="partitions-16MB.csv"
+CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-16MB.csv"
+CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-16MB.csv" \ No newline at end of file
diff --git a/ports/esp32s2/sdkconfig-4MB.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-4MB.defaults
index 561f971c3..4da90d1bc 100644
--- a/ports/esp32s2/sdkconfig-4MB.defaults
+++ b/ports/esp32s2/esp-idf-config/sdkconfig-4MB.defaults
@@ -1,10 +1,9 @@
-
+# No newlines in this file so they are preserved in the board sdkconfig.
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
-
-CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MB.csv"
-CONFIG_PARTITION_TABLE_FILENAME="partitions-4MB.csv"
+CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB.csv"
+CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB.csv" \ No newline at end of file
diff --git a/ports/esp32s2/sdkconfig-8MB.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-8MB.defaults
index fcff17f46..af681c5ea 100644
--- a/ports/esp32s2/sdkconfig-8MB.defaults
+++ b/ports/esp32s2/esp-idf-config/sdkconfig-8MB.defaults
@@ -1,10 +1,9 @@
-
+# No newlines in this file so they are preserved in the board sdkconfig.
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"
-
-CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MB.csv"
-CONFIG_PARTITION_TABLE_FILENAME="partitions-8MB.csv"
+CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB.csv"
+CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB.csv" \ No newline at end of file
diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults
new file mode 100644
index 000000000..f45f6ae9f
--- /dev/null
+++ b/ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults
@@ -0,0 +1,13 @@
+# No newlines in this file so they are preserved in the board sdkconfig.
+CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
+CONFIG_ESP_CONSOLE_UART_DEFAULT=y
+# CONFIG_ESP_CONSOLE_USB_CDC is not set
+# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
+# CONFIG_ESP_CONSOLE_NONE is not set
+CONFIG_ESP_CONSOLE_UART=y
+CONFIG_ESP_CONSOLE_UART_NUM=0
+CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
+CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
+# CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT is not set
+# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set
+# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set \ No newline at end of file
diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults
new file mode 100644
index 000000000..af0746bc0
--- /dev/null
+++ b/ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults
@@ -0,0 +1,12 @@
+# No newlines in this file so they are preserved in the board sdkconfig.
+# CONFIG_ESP_ERR_TO_NAME_LOOKUP is not set
+# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
+# CONFIG_CONSOLE_UART_DEFAULT is not set
+CONFIG_ESP_CONSOLE_UART_NONE=y
+CONFIG_ESP_CONSOLE_NONE=y
+CONFIG_ESP_CONSOLE_UART_NUM=-1
+CONFIG_CONSOLE_UART_NUM=-1
+# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set
+CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y
+# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set
+CONFIG_ESP32S2_PANIC_SILENT_REBOOT=y \ No newline at end of file
diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/esp-idf-config/sdkconfig.defaults
index 4094367e0..4094367e0 100644
--- a/ports/esp32s2/sdkconfig.defaults
+++ b/ports/esp32s2/esp-idf-config/sdkconfig.defaults