Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit e6f4eb6

Browse files
committed
Correction for flashing via "make flash"
1 parent 271d709 commit e6f4eb6

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

esp32/application.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,8 @@ ESPTOOLPY_ERASE_FLASH = $(ESPTOOLPY_SERIAL) erase_flash
685685

686686
ESP_UPDATER_PY_WRITE_FLASH = $(ESP_UPDATER_PY_SERIAL) flash
687687
ESP_UPDATER_PY_ERASE_FLASH = $(ESP_UPDATER_PY_SERIAL) erase_all
688-
ESP_UPDATER_ALL_FLASH_ARGS = -t $(BUILD_DIR)/$(BOARD_L)-$(SW_VERSION).tar.gz --sff_enable $(SMALL_FACTORY_FW_ENABLED)
689-
ESP_UPDATER_ALL_FLASH_ARGS_ENC = -t $(BUILD_DIR)/$(BOARD_L)-$(SW_VERSION)_ENC.tar.gz --secureboot --sff_enable $(SMALL_FACTORY_FW_ENABLED)
688+
ESP_UPDATER_ALL_FLASH_ARGS = -t $(BUILD_DIR)/$(BOARD_L)-$(SW_VERSION).tar.gz
689+
ESP_UPDATER_ALL_FLASH_ARGS_ENC = -t $(BUILD_DIR)/$(BOARD_L)-$(SW_VERSION)_ENC.tar.gz --secureboot
690690

691691
ESPSECUREPY = $(PYTHON) $(IDF_PATH)/components/esptool_py/esptool/espsecure.py
692692
ESPEFUSE = $(PYTHON) $(IDF_PATH)/components/esptool_py/esptool/espefuse.py --port $(ESPPORT)

esp32/tools/fw_updater/updater.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class Args(object):
146146
pass
147147

148148

149-
def load_tar(fileobj, prog, secure=False, sff_enable=True):
149+
def load_tar(fileobj, prog, secure=False):
150150
script = None
151151
legacy = False
152152
try:
@@ -159,15 +159,9 @@ def load_tar(fileobj, prog, secure=False, sff_enable=True):
159159
if fsize == 0x800000:
160160
try:
161161
if secure:
162-
if sff_enable:
163-
script_file = json.loads(tar.extractfile("script_8MB_small_factory_fw_enc").read().decode('UTF-8'))
164-
else:
165-
script_file = json.loads(tar.extractfile("script_8MB_normal_factory_fw_enc").read().decode('UTF-8'))
162+
script_file = json.loads(tar.extractfile("script_8MB_enc").read().decode('UTF-8'))
166163
else:
167-
if sff_enable:
168-
script_file = json.loads(tar.extractfile("script_8MB_small_factory_fw").read().decode('UTF-8'))
169-
else:
170-
script_file = json.loads(tar.extractfile("script_8MB_normal_factory_fw").read().decode('UTF-8'))
164+
script_file = json.loads(tar.extractfile("script_8MB").read().decode('UTF-8'))
171165
except:
172166
print_debug("Error Loading script_8MB ... defaulting to legacy script2!", True)
173167
legacy = True
@@ -1025,7 +1019,6 @@ def process_arguments():
10251019
cmd_parser_flash.add_argument('-p', '--partition', default=None, help=help_msg[:-2] + ')')
10261020
# cmd_parser_flash.add_argument('-d', '--directory', default=None, help='directory to look for files when using -s / --script')
10271021
# cmd_parser_flash.add_argument('-s', '--script', default=None, help='script file to execute')
1028-
cmd_parser_flash.add_argument('-sff', '--sff_enable', default=True, type=str2bool, nargs='?', const=True, help="Select whether Small Factory Firmware mode is supported")
10291022
cmd_parser_copy = subparsers.add_parser('copy', help='Read/Write flash memory partition')
10301023
help_msg = 'The partition to read/write ('
10311024
for partition in PARTITIONS.keys():
@@ -1214,7 +1207,7 @@ def progress_fs(msg):
12141207
if args.tar is not None:
12151208
try:
12161209
tar_file = open(args.tar, "rb")
1217-
script = load_tar(tar_file, nPy, args.secureboot, args.sff_enable)
1210+
script = load_tar(tar_file, nPy, args.secureboot)
12181211
if not args.quiet:
12191212
# sys.stdout = old_stdout
12201213
sys.stderr.flush()

esp32/tools/makepkg.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PKG_TMP_DIR="${BUILD_DIR}/firmware_package"
5858
mkdir -p ${PKG_TMP_DIR}
5959

6060
PART_FILE_8MB=''
61-
SCRIPT_FILE_8MB='script_8MB'
61+
SCRIPT_FILE_8MB=''
6262

6363
if [ $4 -eq 1 ]; then
6464
BOOT_FILE='bootloader-reflash-digest.bin_enc'
@@ -80,12 +80,14 @@ cp ${BUILD_DIR}/bootloader/${BOOT_FILE} ${PKG_TMP_DIR}
8080
cp ${BUILD_DIR}/${APP_FILE} ${PKG_TMP_DIR}
8181

8282
if [ $4 -eq 1 ]; then
83+
SCRIPT_FILE_8MB='script_8MB_enc'
8384
if [ $5 -eq 1 ]; then
8485
PART_FILE_8MB='partitions_8MB_small_factory_fw.bin_enc'
8586
else
8687
PART_FILE_8MB='partitions_8MB_normal_factory_fw.bin_enc'
8788
fi
8889
else
90+
SCRIPT_FILE_8MB='script_8MB'
8991
if [ $5 -eq 1 ]; then
9092
PART_FILE_8MB='partitions_8MB_small_factory_fw.bin'
9193
else

0 commit comments

Comments
 (0)