[Arduino][ESP32] Change Partition - By 懶人改法
下面是 ESP32 Dev Module 在 Boards.txt 的描述
Line 29 ~ 61 就描述了 ESP32 Dev Module 支援那些 Partition CSV
以 Line 29,30 為例,就描述支援的 Partition Scheme ,
名稱為 " Default 4MB with spiffs"
對應的Partition CSV File 為 "default.csv"
- esp32.name=ESP32 Dev Module
- esp32.upload.tool=esptool_py
- esp32.upload.maximum_size=1310720
- esp32.upload.maximum_data_size=327680
- esp32.upload.wait_for_upload_port=true
- esp32.serial.disableDTR=true
- esp32.serial.disableRTS=true
- esp32esp32.build.mcu=esp32
- esp32esp32.build.core=esp32
- esp32esp32.build.variant=esp32
- esp32.build.board=ESP32_DEV
- esp32.build.f_cpu=240000000L
- esp32.build.flash_size=4MB
- esp32.build.flash_freq=40m
- esp32.build.flash_mode=dio
- esp32.build.boot=dio
- esp32.build.partitions=default
- esp32esp32.build.defines=
- esp32.menu.PSRAM.disabled=Disabled
- esp32esp32.menu.PSRAM.disabled.build.defines=
- esp32.menu.PSRAM.enabled=Enabled
- esp32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
- esp32.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
- esp32.menu.PartitionScheme.default.build.partitions=default
- esp32.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
- esp32.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
- esp32.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT)
- esp32.menu.PartitionScheme.default_8MB.build.partitions=default_8MB
- esp32.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336
- esp32.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
- esp32.menu.PartitionScheme.minimal.build.partitions=minimal
- esp32.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
- esp32.menu.PartitionScheme.no_ota.build.partitions=no_ota
- esp32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
- esp32.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
- esp32.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
- esp32.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
- esp32.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
- esp32.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
- esp32.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
- esp32.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
- esp32.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
- esp32.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
- esp32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
- esp32.menu.PartitionScheme.huge_app.build.partitions=huge_app
- esp32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
- esp32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
- esp32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
- esp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
- esp32.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT)
- esp32.menu.PartitionScheme.fatflash.build.partitions=ffat
- esp32.menu.PartitionScheme.fatflash.upload.maximum_size=2097152
- esp32.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS)
- esp32.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB
- esp32.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
- esp32.menu.CPUFreq.240=240MHz (WiFi/BT)
- esp32.menu.CPUFreq.240.build.f_cpu=240000000L
- esp32.menu.CPUFreq.160=160MHz (WiFi/BT)
- esp32.menu.CPUFreq.160.build.f_cpu=160000000L
- esp32.menu.CPUFreq.80=80MHz (WiFi/BT)
- esp32.menu.CPUFreq.80.build.f_cpu=80000000L
- esp32.menu.CPUFreq.40=40MHz (40MHz XTAL)
- esp32.menu.CPUFreq.40.build.f_cpu=40000000L
- esp32.menu.CPUFreq.26=26MHz (26MHz XTAL)
- esp32.menu.CPUFreq.26.build.f_cpu=26000000L
- esp32.menu.CPUFreq.20=20MHz (40MHz XTAL)
- esp32.menu.CPUFreq.20.build.f_cpu=20000000L
- esp32.menu.CPUFreq.13=13MHz (26MHz XTAL)
- esp32.menu.CPUFreq.13.build.f_cpu=13000000L
- esp32.menu.CPUFreq.10=10MHz (40MHz XTAL)
- esp32.menu.CPUFreq.10.build.f_cpu=10000000L
- esp32.menu.FlashMode.qio=QIO
- esp32.menu.FlashMode.qio.build.flash_mode=dio
- esp32.menu.FlashMode.qio.build.boot=qio
- esp32.menu.FlashMode.dio=DIO
- esp32.menu.FlashMode.dio.build.flash_mode=dio
- esp32.menu.FlashMode.dio.build.boot=dio
- esp32.menu.FlashMode.qout=QOUT
- esp32.menu.FlashMode.qout.build.flash_mode=dout
- esp32.menu.FlashMode.qout.build.boot=qout
- esp32.menu.FlashMode.dout=DOUT
- esp32.menu.FlashMode.dout.build.flash_mode=dout
- esp32.menu.FlashMode.dout.build.boot=dout
- esp32.menu.FlashFreq.80=80MHz
- esp32.menu.FlashFreq.80.build.flash_freq=80m
- esp32.menu.FlashFreq.40=40MHz
- esp32.menu.FlashFreq.40.build.flash_freq=40m
- esp32.menu.FlashSize.4M=4MB (32Mb)
- esp32.menu.FlashSize.4M.build.flash_size=4MB
- esp32.menu.FlashSize.8M=8MB (64Mb)
- esp32.menu.FlashSize.8M.build.flash_size=8MB
- esp32.menu.FlashSize.8M.build.partitions=default_8MB
- esp32.menu.FlashSize.2M=2MB (16Mb)
- esp32.menu.FlashSize.2M.build.flash_size=2MB
- esp32.menu.FlashSize.2M.build.partitions=minimal
- esp32.menu.FlashSize.16M=16MB (128Mb)
- esp32.menu.FlashSize.16M.build.flash_size=16MB
- esp32.menu.UploadSpeed.921600=921600
- esp32.menu.UploadSpeed.921600.upload.speed=921600
- esp32.menu.UploadSpeed.115200=115200
- esp32.menu.UploadSpeed.115200.upload.speed=115200
- esp32.menu.UploadSpeed.256000.windows=256000
- esp32.menu.UploadSpeed.256000.upload.speed=256000
- esp32.menu.UploadSpeed.230400.windows.upload.speed=256000
- esp32.menu.UploadSpeed.230400=230400
- esp32.menu.UploadSpeed.230400.upload.speed=230400
- esp32.menu.UploadSpeed.460800.linux=460800
- esp32.menu.UploadSpeed.460800.macosx=460800
- esp32.menu.UploadSpeed.460800.upload.speed=460800
- esp32.menu.UploadSpeed.512000.windows=512000
- esp32.menu.UploadSpeed.512000.upload.speed=512000
- esp32.menu.DebugLevel.none=None
- esp32.menu.DebugLevel.none.build.code_debug=0
- esp32.menu.DebugLevel.error=Error
- esp32.menu.DebugLevel.error.build.code_debug=1
- esp32.menu.DebugLevel.warn=Warn
- esp32.menu.DebugLevel.warn.build.code_debug=2
- esp32.menu.DebugLevel.info=Info
- esp32.menu.DebugLevel.info.build.code_debug=3
- esp32.menu.DebugLevel.debug=Debug
- esp32.menu.DebugLevel.debug.build.code_debug=4
- esp32.menu.DebugLevel.verbose=Verbose
- esp32.menu.DebugLevel.verbose.build.code_debug=5
- ##############################################################
這是 NodeMCU-32S 在 Boards.txt 的描述
沒有 Partition Scheme 的描述,只有在 Line 22,說明它使用 default.csv Partition Table
- ##############################################################
- nodemcu-32s.name=NodeMCU-32S
- nodemcu-32s.upload.tool=esptool_py
- nodemcu-32s.upload.maximum_size=1310720
- nodemcu-32s.upload.maximum_data_size=327680
- nodemcu-32s.upload.wait_for_upload_port=true
- nodemcu-32s.serial.disableDTR=true
- nodemcu-32s.serial.disableRTS=true
- nodemcu-32s.build.mcu=esp32
- nodemcu-32s.build.core=esp32
- nodemcunodemcu-32s.build.variant=nodemcu-32s
- nodemcu-32s.build.board=NodeMCU_32S
- nodemcu-32s.build.f_cpu=240000000L
- nodemcu-32s.build.flash_mode=dio
- nodemcu-32s.build.flash_size=4MB
- nodemcu-32s.build.boot=dio
- nodemcu-32s.build.partitions=default
- nodemcunodemcu-32s.build.defines=
- nodemcu-32s.menu.FlashFreq.80=80MHz
- nodemcu-32s.menu.FlashFreq.80.build.flash_freq=80m
- nodemcu-32s.menu.FlashFreq.40=40MHz
- nodemcu-32s.menu.FlashFreq.40.build.flash_freq=40m
- nodemcu-32s.menu.UploadSpeed.921600=921600
- nodemcu-32s.menu.UploadSpeed.921600.upload.speed=921600
- nodemcu-32s.menu.UploadSpeed.115200=115200
- nodemcu-32s.menu.UploadSpeed.115200.upload.speed=115200
- nodemcu-32s.menu.UploadSpeed.256000.windows=256000
- nodemcu-32s.menu.UploadSpeed.256000.upload.speed=256000
- nodemcu-32s.menu.UploadSpeed.230400.windows.upload.speed=256000
- nodemcu-32s.menu.UploadSpeed.230400=230400
- nodemcu-32s.menu.UploadSpeed.230400.upload.speed=230400
- nodemcu-32s.menu.UploadSpeed.460800.linux=460800
- nodemcu-32s.menu.UploadSpeed.460800.macosx=460800
- nodemcu-32s.menu.UploadSpeed.460800.upload.speed=460800
- nodemcu-32s.menu.UploadSpeed.512000.windows=512000
- nodemcu-32s.menu.UploadSpeed.512000.upload.speed=512000
- ##############################################################
所以,從以上兩段描述,就可以得知為何 NodeMCU-32S 為何在Arduino IDE 選單部會沒有 Partition Scheme 可供你選擇了,而 ESP32 Dev Module 卻有 12 種 Partition Scheme 可供選擇。
暴力懶人改法就如下面截圖,從原有真實正確的 Board Type 轉換到 ESP32 Dev Module,
這樣簡單的一個步驟而已!
以我截圖為例,真實的 Board Type 為 NodeMCU-32S ,在Arduino IDE "Tools" 選單下,改選
ESP32 Dev Module ,這樣我就有 12 種 Partition Scheme 選擇了。