File tree Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -538,16 +538,20 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_WPA_SUPPLICANT_O))
538
538
# ###############################################################################
539
539
# Main targets
540
540
541
- all : $(BUILD ) /bootloader.bin $( BUILD ) /partitions.bin $( BUILD ) /application .bin
541
+ all : $(BUILD ) /firmware .bin
542
542
543
543
.PHONY : idf-version deploy erase
544
544
545
545
idf-version :
546
546
$(ECHO ) " ESP IDF supported hash: $( ESPIDF_SUPHASH) "
547
547
548
- deploy : $(BUILD ) /bootloader.bin $(BUILD ) /partitions.bin $(BUILD ) /application.bin
548
+ $(BUILD ) /firmware.bin : $(BUILD ) /bootloader.bin $(BUILD ) /partitions.bin $(BUILD ) /application.bin
549
+ $(ECHO ) " Create $@ "
550
+ $(Q )$(PYTHON ) makeimg.py $^ $@
551
+
552
+ deploy : $(BUILD ) /firmware.bin
549
553
$(ECHO ) " Writing $^ to the board"
550
- $(Q )$(ESPTOOL ) --chip esp32 --port $(PORT ) --baud $(BAUD ) write_flash -z --flash_mode $(FLASH_MODE ) --flash_freq $(FLASH_FREQ ) --flash_size $(FLASH_SIZE ) 0x1000 $( BUILD ) /bootloader.bin 0x8000 $( BUILD ) /partitions.bin 0x10000 $( BUILD ) /application.bin
554
+ $(Q )$(ESPTOOL ) --chip esp32 --port $(PORT ) --baud $(BAUD ) write_flash -z --flash_mode $(FLASH_MODE ) --flash_freq $(FLASH_FREQ ) --flash_size $(FLASH_SIZE ) 0 $^
551
555
552
556
erase :
553
557
$(ECHO ) " Erasing flash"
Original file line number Diff line number Diff line change
1
+ import sys
2
+
3
+ OFFSET_BOOTLOADER = 0x1000
4
+ OFFSET_PARTITIONS = 0x8000
5
+ OFFSET_APPLICATION = 0x10000
6
+
7
+ files_in = [
8
+ ('bootloader' , OFFSET_BOOTLOADER , sys .argv [1 ]),
9
+ ('partitions' , OFFSET_PARTITIONS , sys .argv [2 ]),
10
+ ('application' , OFFSET_APPLICATION , sys .argv [3 ]),
11
+ ]
12
+ file_out = sys .argv [4 ]
13
+
14
+ cur_offset = 0
15
+ with open (file_out , 'wb' ) as fout :
16
+ for name , offset , file_in in files_in :
17
+ assert offset >= cur_offset
18
+ fout .write (b'\xff ' * (offset - cur_offset ))
19
+ cur_offset = offset
20
+ with open (file_in , 'rb' ) as fin :
21
+ data = fin .read ()
22
+ fout .write (data )
23
+ cur_offset += len (data )
24
+ print ('%-12s% 8d' % (name , len (data )))
25
+ print ('%-12s% 8d' % ('total' , cur_offset ))
You can’t perform that action at this time.
0 commit comments