Skip to content

Commit e568c6c

Browse files
authored
Merge pull request #1776 from espruino/ep32_firmware_size_check
updates for using a new partitions_espruino.bin
2 parents ba0bd50 + 433708f commit e568c6c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

boards/ESP32.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
],
3838
'makefile' : [
3939
'DEFINES+=-DESP_PLATFORM -DESP32=1',
40-
'DEFINES+=-DJSVAR_MALLOC' # Allocate space for variables at jsvInit time
40+
'DEFINES+=-DJSVAR_MALLOC', # Allocate space for variables at jsvInit time
41+
'ESP32_FLASH_MAX=1572864'
4142
]
4243
}
4344
};
@@ -55,7 +56,7 @@
5556
'adc' : 2,
5657
'dac' : 0,
5758
'saved_code' : {
58-
'address' : 0x2C0000,
59+
'address' : 0x320000,
5960
'page_size' : 4096,
6061
'pages' : 64,
6162
'flash_available' : 1344, # firmware can be up to this size - see partitions_espruino.csv

make/targets/ESP32.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ $(ESP_ZIP): $(PROJ_NAME).bin
1414
$(Q)rm -rf build/$(basename $(ESP_ZIP))
1515
$(Q)mkdir -p build/$(basename $(ESP_ZIP))
1616
$(Q)cp $(PROJ_NAME).bin espruino_esp32.bin
17+
@echo "** $(PROJ_NAME).bin uses $$( stat $(STAT_FLAGS) $(PROJ_NAME).bin) bytes of" $(ESP32_FLASH_MAX) "available"
18+
@if [ $$( stat $(STAT_FLAGS) $(PROJ_NAME).bin) -gt $$(( $(ESP32_FLASH_MAX) )) ]; then echo "$(PROJ_NAME).bin is too big!"; false; fi
1719
$(Q)cp $(ESP_APP_TEMPLATE_PATH)/build/bootloader/bootloader.bin \
1820
espruino_esp32.bin \
1921
$(ESP_APP_TEMPLATE_PATH)/build/partitions_espruino.bin \

0 commit comments

Comments
 (0)