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

Commit 2e48c2f

Browse files
author
Islam Wahdan
authored
[v1.20.0.rc13] Release Candidate
### Improvments - LoRaWan refactoring and bug Fixing - Updated Pybytes lib - Updated sqnsupgrade - Update Make Environment for IDF version check and checkout - modpycom: Added API to get Internal and External Free RAM size - PYFW-356 support for sending bytes in lte.send_at_cmd() ### Bug Fix - Fix PYFW-359: When building SW with "BTYPE=debug" littleFS assertion fails with crash - PYFW-348 updated rx buff size max size exception message - PYFW-354: LittleFS causing random crash
1 parent 6c0000f commit 2e48c2f

32 files changed

+1589
-595
lines changed

.issuetracker

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Integration with Issue Tracker
2+
#
3+
# (note that '\' need to be escaped).
4+
5+
[issuetracker "PYFW jira rule"]
6+
regex = "PYFW-(\\d+)"
7+
url = "https://pycomiot.atlassian.net/browse/PYFW-$1"

esp32/Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ifeq ($(wildcard boards/$(BOARD)/.),)
1414
$(error Invalid BOARD specified)
1515
endif
1616

17+
IDF_VERSION=3.1
18+
1719
TARGET ?= boot_app
1820

1921
OEM ?= 0
@@ -70,9 +72,6 @@ ifndef PROJECT_PATH
7072
PROJECT_PATH := $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
7173
endif
7274

73-
#check Frozen files changes
74-
$(shell bash tools/mpy-build-check.sh $(BOARD) $(BTYPE) $(VARIANT))
75-
7675
FROZEN_MPY_DIR = frozen
7776

7877
include ../py/mkenv.mk
@@ -130,7 +129,7 @@ endif
130129

131130
# Enable or Disable LTE_LOG_BUFF
132131
ifeq ($(BOARD), $(filter $(BOARD), GPY FIPY))
133-
ifeq ($(LTE_DEBUG_BUFF),1)
132+
ifeq ($(LTE_LOG_BUFF),1)
134133
CFLAGS += -DLTE_DEBUG_BUFF
135134
endif #ifeq ($(LTE_LOG_BUFF),1)
136135
endif #ifeq ($(BOARD), $(filter $(BOARD), GPY FIPY))

esp32/application.mk

+15-9
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ endif
503503
ifeq ($(TARGET), boot_app)
504504
all: $(BOOT_BIN) $(APP_BIN)
505505
endif
506-
.PHONY: all
506+
.PHONY: all CHECK_DEP
507507

508508
$(info $(VARIANT) Variant)
509509
ifeq ($(SECURE), on)
@@ -562,10 +562,6 @@ $(BUILD)/bootloader/bootloader.a: $(BOOT_OBJ) sdkconfig.h
562562
$(Q) $(AR) cru $@ $^
563563

564564
$(BUILD)/bootloader/bootloader.elf: $(BUILD)/bootloader/bootloader.a $(SECURE_BOOT_VERIFICATION_KEY)
565-
ifeq ($(COPY_IDF_LIB), 1)
566-
$(ECHO) "COPY IDF LIBRARIES $@"
567-
$(Q) $(PYTHON) get_idf_libs.py --idflibs $(IDF_PATH)/examples/wifi/scan/build
568-
endif
569565
ifeq ($(SECURE), on)
570566
# unpack libbootloader_support.a, and archive again using the right key for verifying signatures
571567
$(ECHO) "Inserting verification key $(SECURE_BOOT_VERIFICATION_KEY) in $@"
@@ -627,10 +623,6 @@ $(BUILD)/application.a: $(OBJ)
627623
$(Q) rm -f $@
628624
$(Q) $(AR) cru $@ $^
629625
$(BUILD)/application.elf: $(BUILD)/application.a $(BUILD)/esp32_out.ld $(SECURE_BOOT_VERIFICATION_KEY)
630-
ifeq ($(COPY_IDF_LIB), 1)
631-
$(ECHO) "COPY IDF LIBRARIES $@"
632-
$(Q) $(PYTHON) get_idf_libs.py --idflibs $(IDF_PATH)/examples/wifi/scan/build
633-
endif
634626
ifeq ($(SECURE), on)
635627
# unpack libbootloader_support.a, and archive again using the right key for verifying signatures
636628
$(ECHO) "Inserting verification key $(SECURE_BOOT_VERIFICATION_KEY) in $@"
@@ -750,13 +742,27 @@ GEN_PINS_SRC = $(BUILD)/pins.c
750742
GEN_PINS_HDR = $(HEADER_BUILD)/pins.h
751743
GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
752744

745+
.NOTPARALLEL: CHECK_DEP $(OBJ)
746+
.NOTPARALLEL: CHECK_DEP $(BOOT_OBJ)
747+
748+
$(BOOT_OBJ) $(OBJ): | CHECK_DEP
749+
753750
# Making OBJ use an order-only dependency on the generated pins.h file
754751
# has the side effect of making the pins.h file before we actually compile
755752
# any of the objects. The normal dependency generation will deal with the
756753
# case when pins.h is modified. But when it doesn't exist, we don't know
757754
# which source files might need it.
758755
$(OBJ): | $(GEN_PINS_HDR)
759756

757+
# Check Dependencies (IDF version, Frozen code and IDF LIBS)
758+
CHECK_DEP:
759+
$(Q) bash tools/idfVerCheck.sh $(IDF_PATH) "$(IDF_VERSION)"
760+
$(Q) bash tools/mpy-build-check.sh $(BOARD) $(BTYPE) $(VARIANT)
761+
ifeq ($(COPY_IDF_LIB), 1)
762+
$(ECHO) "COPY IDF LIBRARIES"
763+
$(Q) $(PYTHON) get_idf_libs.py --idflibs $(IDF_PATH)/examples/wifi/scan/build
764+
endif
765+
760766
# Call make-pins.py to generate both pins_gen.c and pins.h
761767
$(GEN_PINS_SRC) $(GEN_PINS_HDR) $(GEN_PINS_QSTR): $(BOARD_PINS) $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) | $(HEADER_BUILD)
762768
$(ECHO) "Create $@"

esp32/frozen/LTE/sqnsupgrade.py

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
VERSION = "1.2.5"
2+
VERSION = "1.2.6"
33

44
# Copyright (c) 2019, Pycom Limited.
55
#
@@ -339,7 +339,7 @@ def __get_wait_msg(self, load_fff=True):
339339

340340

341341

342-
def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_ffh=False, mirror=False, switch_ffh=False, bootrom=False, rgbled=0x050505, debug=False, pkgdebug=False, atneg=True, max_try=10, direct=True, atneg_only=False, info_only=False, expected_smod=None, verbose=False, load_fff=False, mtools=False):
342+
def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_ffh=False, mirror=False, switch_ffh=False, bootrom=False, rgbled=0x050505, debug=False, pkgdebug=False, atneg=True, max_try=10, direct=True, atneg_only=False, info_only=False, expected_smod=None, verbose=False, load_fff=False, mtools=False, fc=False):
343343
self.__wait_msg = False
344344
mirror = True if atneg_only else mirror
345345
recover = True if atneg_only else load_ffh
@@ -365,7 +365,7 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
365365
external = True
366366
br = 115200 if recover and not direct else baudrate
367367
if debug: print('Setting baudrate to {}'.format(br))
368-
self.__serial = serial.Serial(port, br, bytesize=serial.EIGHTBITS, timeout=1 if info_only else 0.1)
368+
self.__serial = serial.Serial(port, br, bytesize=serial.EIGHTBITS, timeout=1 if info_only else 0.1, rtscts=fc)
369369
self.__serial.reset_input_buffer()
370370
self.__serial.reset_output_buffer()
371371

@@ -447,7 +447,7 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
447447

448448
if verbose: print('Sending AT+FSRDFILE="/fs/crashdump"')
449449
self.__serial.write(b'AT+FSRDFILE="/fs/crashdump"\r\n')
450-
response = self.read_rsp(size=100)
450+
response = self.read_rsp(size=1024)
451451
if verbose: print('AT+FSRDFILE="/fs/crashdump" returned {}'.format(response))
452452
self.__serial.read()
453453

@@ -819,7 +819,7 @@ def at_negotiation(self, baudrate, port, max_try, mirror, atneg_only, debug, tar
819819
self.__serial = UART(1, baudrate=target_baudrate, pins=self.__pins, timeout_chars=100)
820820
else:
821821
self.__serial = None
822-
self.__serial = serial.Serial(port, target_baudrate, bytesize=serial.EIGHTBITS, timeout=0.1)
822+
self.__serial = serial.Serial(port, target_baudrate, bytesize=serial.EIGHTBITS, timeout=0.1, rtscts=fc)
823823
self.__serial.reset_input_buffer()
824824
self.__serial.reset_output_buffer()
825825
self.__serial.flush()
@@ -882,10 +882,11 @@ def upgrade(self, ffile, mfile=None, baudrate=921600, retry=False, resume=False,
882882
if success:
883883
if self.__run(file_path=ffile, resume=True if mfile is not None else resume, baudrate=baudrate, direct=False, debug=debug, pkgdebug=pkgdebug, verbose=verbose, load_fff=False if mfile else load_fff, mtools=mtools):
884884
if self.__check_br(verbose=verbose, debug=debug):
885-
self.__run(bootrom=True, debug=debug, direct=False, pkgdebug=pkgdebug, verbose=verbose, load_fff=True)
885+
success = self.__run(bootrom=True, debug=debug, direct=False, pkgdebug=pkgdebug, verbose=verbose, load_fff=True)
886886
self.success_message(verbose=verbose, debug=debug)
887887
else:
888888
print('Unable to load updater from {}'.format(mfile))
889+
return success
889890

890891
def upgrade_uart(self, ffh_mode=False, mfile=None, retry=False, resume=False, color=0x050505, debug=False, pkgdebug=False, verbose=False, load_fff=True):
891892
success = False
@@ -923,16 +924,16 @@ def upgrade_uart(self, ffh_mode=False, mfile=None, retry=False, resume=False, co
923924
else:
924925
print('Unable to upgrade bootrom.')
925926

926-
def show_info(self, port=None, debug=False, verbose=False):
927-
self.__run(port=port, debug=debug, info_only=True, verbose=verbose)
927+
def show_info(self, port=None, debug=False, verbose=False, fc=False):
928+
self.__run(port=port, debug=debug, info_only=True, verbose=verbose, fc=fc)
928929

929-
def upgrade_ext(self, port, ffile, mfile, resume=False, debug=False, pkgdebug=False, verbose=False, load_fff=True):
930+
def upgrade_ext(self, port, ffile, mfile, resume=False, debug=False, pkgdebug=False, verbose=False, load_fff=True, fc=False):
930931
success = True
931932
if mfile is not None:
932933
success = False
933-
success = self.__run(file_path=mfile, load_ffh=True, port=port, debug=debug, pkgdebug=pkgdebug, verbose=verbose)
934+
success = self.__run(file_path=mfile, load_ffh=True, port=port, debug=debug, pkgdebug=pkgdebug, verbose=verbose, fc=fc)
934935
if success:
935-
if self.__run(file_path=ffile, resume=True if mfile is not None else resume, direct=False, port=port, debug=debug, pkgdebug=pkgdebug, verbose=verbose, load_fff=load_fff):
936+
if self.__run(file_path=ffile, resume=True if mfile is not None else resume, direct=False, port=port, debug=debug, pkgdebug=pkgdebug, verbose=verbose, load_fff=load_fff, fc=fc):
936937
self.success_message(port=port, verbose=verbose, debug=debug)
937938
else:
938939
print('Unable to load updater from {}'.format(mfile))
@@ -973,6 +974,7 @@ def run(ffile, mfile=None, baudrate=921600, verbose=False, debug=False, load_fff
973974
retry = False
974975
resume = False
975976
mtools = False
977+
success = False
976978
sqnup = sqnsupgrade()
977979
if sqnup.check_files(ffile, mfile, debug):
978980
state = sqnup.detect_modem_state(debug=debug, hangup=hangup)
@@ -991,8 +993,9 @@ def run(ffile, mfile=None, baudrate=921600, verbose=False, debug=False, load_fff
991993
mtools = True
992994
elif state == -1:
993995
detect_error()
994-
sqnup.upgrade(ffile=ffile, mfile=mfile, baudrate=baudrate, retry=retry, resume=resume, debug=debug, pkgdebug=False, verbose=verbose, load_fff=load_fff, mtools=mtools)
996+
success = sqnup.upgrade(ffile=ffile, mfile=mfile, baudrate=baudrate, retry=retry, resume=resume, debug=debug, pkgdebug=False, verbose=verbose, load_fff=load_fff, mtools=mtools)
995997
reconnect_uart()
998+
return success
996999

9971000
def uart(ffh_mode=False, mfile=None, color=0x050505, verbose=False, debug=False, hangup=True):
9981001
print_welcome()
@@ -1054,12 +1057,12 @@ def state(verbose=False, debug=False, retry=5, hangup=False):
10541057
return sqnup.detect_modem_state(debug=debug, hangup=hangup, retry=retry)
10551058

10561059
else:
1057-
def run(port, ffile, mfile=None, resume=False, debug=False, verbose=False, load_fff=True):
1060+
def run(port, ffile, mfile=None, resume=False, debug=False, verbose=False, load_fff=True, fc=False):
10581061
print_welcome()
10591062
sqnup = sqnsupgrade()
10601063
if sqnup.check_files(ffile, mfile, debug):
10611064
sqnup.upgrade_ext(port=port, ffile=ffile, mfile=mfile, resume=resume, debug=debug, pkgdebug=False, verbose=verbose, load_fff=load_fff)
10621065

1063-
def version(port, verbose=False, debug=False):
1066+
def version(port, verbose=False, debug=False, fc=False):
10641067
sqnup = sqnsupgrade()
10651068
sqnup.show_info(port=port, debug=debug, verbose=verbose)

esp32/frozen/Pybytes/_OTA.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
'''
2+
Copyright (c) 2019, Pycom Limited.
3+
This software is licensed under the GNU GPL version 3 or any
4+
later version, with permitted additional terms. For more information
5+
see the Pycom Licence v1.0 document supplied with this file, or
6+
available at https://www.pycom.io/opensource/licensing
7+
'''
8+
19
import network
210
import socket
311
import ssl

esp32/frozen/Pybytes/_flash_control_OTA.py

+9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
'''
2+
Copyright (c) 2019, Pycom Limited.
3+
This software is licensed under the GNU GPL version 3 or any
4+
later version, with permitted additional terms. For more information
5+
see the Pycom Licence v1.0 document supplied with this file, or
6+
available at https://www.pycom.io/opensource/licensing
7+
'''
8+
19
import os
210
try:
311
from pybytes_debug import print_debug
412
except:
513
from _pybytes_debug import print_debug
614

15+
716
class FCOTA:
817
def __init__(self):
918
pass

0 commit comments

Comments
 (0)