8000 [v1.20.0.rc12] Release Candidate · pycom/pycom-micropython-sigfox@81167ed · GitHub
[go: up one dir, main page]

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

Commit 81167ed

Browse files
author
iwahdan88
committed
[v1.20.0.rc12] Release Candidate
### New Features - Adding CoAp Micropython module - Disable RGBLED functionality with Makefile switch RGB_LED=disable ### Improvments - Updated pycom.nvs_get to support return of a predefined `NoExistValue` for unmatched Keys - PYFW-104: Add timestamp metadata to files and folders - Updated modlte - [PYFW-86] Implement Fallback to Wifi when lte is disconnected - [PYFW-214] Increase App partition Size For FIPy, GPy and LoPy4 to 1980K - [PYFW-344] Refactor BLE - Lorawan: Added support for the CN470 region ### Bug Fixes - PYFW-348: Make RX buffer of machuart module configurable #300
1 parent 976af3b commit 81167ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2051
-204
lines changed

Jenkinsfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ node {
3131
board_variant = board + "_" + variant
3232
open_thread = 'off'
3333
// Enable openthread in case of FIPY/LoPy4/LoPy BASE builds
34-
if (variant == 'BASE')
34+
if (board == 'FiPy' || board == 'LoPy4' || board == 'LoPy')
3535
{
36-
if (board == 'FiPy' || board == 'LoPy4' || board == 'LoPy')
37-
{
38-
open_thread = 'on'
39-
}
36+
// openthread is currently disabled
37+
open_thread = 'off'
4038
}
4139
parallelSteps[board_variant] = boardBuild(board, variant, open_thread)
4240
}

esp32/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ BTYPE ?= release
2323

2424
# make Non-Pybytes firmware default
2525
VARIANT ?=BASE
26+
# make Coap Module off by default
27+
COAP_MODULE ?=disabled
2628

2729
ifeq ($(VARIANT),BASE)
2830
BUILD_DIR ?=build
@@ -40,7 +42,7 @@ LTE_LOG_BUFF ?= 0
4042
RGB_LED ?= enable
4143

4244
# by default openthread over LoRa is enabled
43-
OPENTHREAD ?= on
45+
OPENTHREAD = off
4446

4547
# by default Secure Boot and Flash Encryption are disabled
4648
SECURE ?= off
@@ -104,7 +106,7 @@ LIBS = -L$(ESP_IDF_COMP_PATH)/esp32/lib -L$(ESP_IDF_COMP_PATH)/esp32/ld -L$(ESP_
104106
$(ESP_IDF_COMP_PATH)/newlib/lib/libc-psram-workaround.a \
105107
-lfreertos -ljson -ljsmn -llwip -lnewlib -lvfs -lopenssl -lmbedtls -lwpa_supplicant \
106108
-lxtensa-debug-module -lbt -lsdmmc -lsoc -lheap -lbootloader_support -lmicro-ecc \
107-
-u ld_include_panic_highint_hdl -lsmartconfig_ack -lmesh
109+
-u ld_include_panic_highint_hdl -lsmartconfig_ack -lmesh -lcoap
108110
ifeq ($(BOARD), $(filter $(BOARD), FIPY))
109111
LIBS += sigfox/modsigfox_fipy.a
110112
endif
@@ -122,6 +124,10 @@ ifeq ($(OPENTHREAD), on)
122124
CFLAGS += -DLORA_OPENTHREAD_ENABLED
123125
endif
124126

127+
ifeq ($(COAP_MODULE), enabled)
128+
CFLAGS += -DENABLE_COAP
129+
endif
130+
125131
# Enable or Disable LTE_LOG_BUFF
126132
ifeq ($(BOARD), $(filter $(BOARD), GPY FIPY))
127133
ifeq ($(LTE_DEBUG_BUFF),1)

esp32/application.mk 10000

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ APP_INC += -I$(BUILD)/genhdr
2525
APP_INC += -I$(ESP_IDF_COMP_PATH)/bootloader_support/include
2626
APP_INC += -I$(ESP_IDF_COMP_PATH)/bootloader_support/include_priv
2727
APP_INC += -I$(ESP_IDF_COMP_PATH)/mbedtls/mbedtls/include
28-
APP_INC += -I$(ESP_IDF_COMP_PATH)/mbedtls/mbedtls/include/mbedtls
2928
APP_INC += -I$(ESP_IDF_COMP_PATH)/mbedtls/port/include
3029
APP_INC += -I$(ESP_IDF_COMP_PATH)/driver/include
3130
APP_INC += -I$(ESP_IDF_COMP_PATH)/driver/include/driver
@@ -41,6 +40,7 @@ APP_INC += -I$(ESP_IDF_COMP_PATH)/json/include
4140
APP_INC += -I$(ESP_IDF_COMP_PATH)/expat/include
4241
APP_INC += -I$(ESP_IDF_COMP_PATH)/lwip/include/lwip
4342
APP_INC += -I$(ESP_IDF_COMP_PATH)/lwip/include/lwip/port
43+
APP_INC += -I$(ESP_IDF_COMP_PATH)/lwip/include/lwip/posix
4444
APP_INC += -I$(ESP_IDF_COMP_PATH)/newlib/include
4545
APP_INC += -I$(ESP_IDF_COMP_PATH)/newlib/platform_include
4646
APP_INC += -I$(ESP_IDF_COMP_PATH)/nvs_flash/include
@@ -67,6 +67,10 @@ APP_INC += -I$(ESP_IDF_COMP_PATH)/bt/bluedroid/hci/include
6767
APP_INC += -I$(ESP_IDF_COMP_PATH)/bt/bluedroid/gki/include
6868
APP_INC += -I$(ESP_IDF_COMP_PATH)/bt/bluedroid/api/include
6969
APP_INC += -I$(ESP_IDF_COMP_PATH)/bt/bluedroid/btc/include
70+
APP_INC += -I$(ESP_IDF_COMP_PATH)/coap/libcoap/include/coap
71+
APP_INC += -I$(ESP_IDF_COMP_PATH)/coap/libcoap/examples
72+
APP_INC += -I$(ESP_IDF_COMP_PATH)/coap/port/include
73+
APP_INC += -I$(ESP_IDF_COMP_PATH)/coap/port/include/coap
7074
APP_INC += -I../lib/mp-readline
7175
APP_INC += -I../lib/netutils
7276
APP_INC += -I../lib/oofatfs
@@ -149,6 +153,7 @@ APP_MODS_SRC_C = $(addprefix mods/,\
149153
machrmt.c \
150154
lwipsocket.c \
151155
machtouch.c \
156+
modcoap.c \
152157
)
153158

154159
APP_MODS_LORA_SRC_C = $(addprefix mods/,\
@@ -358,7 +363,7 @@ BOOT_LDFLAGS = $(LDFLAGS) -T esp32.bootloader.ld -T esp32.rom.ld -T esp32.periph
358363
APP_LDFLAGS += $(LDFLAGS) -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld
359364

360365
# add the application specific CFLAGS
361-
CFLAGS += $(APP_INC) -DMICROPY_NLR_SETJMP=1 -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM -DFFCONF_H=\"lib/oofatfs/ffconf.h\"
366+
CFLAGS += $(APP_INC) -DMICROPY_NLR_SETJMP=1 -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -DWITH_POSIX
362367
CFLAGS_SIGFOX += $(APP_INC) -DMICROPY_NLR_SETJMP=1 -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM
363368
CFLAGS += -DREGION_AS923 -DREGION_AU915 -DREGION_EU868 -DREGION_US915 -DREGION_CN470 -DREGION_IN865 -DBASE=0 -DPYBYTES=1
364369
# Specify if this is base or Pybytes Firmware
@@ -371,7 +376,7 @@ else
371376
$(error Invalid Variant specified)
372377
endif
373378
endif
374-
# Give the possibility to use LittleFs on /flash, otherwise FatFs is used
379+
# Give the possibility to use LittleFs on /flash, otherwise FatFs is used
375380
FS ?= ""
376381
ifeq ($(FS), LFS)
377382
CFLAGS += -DFS_USE_LITTLEFS
@@ -439,12 +444,17 @@ ifeq ($(BOARD), FIPY)
439444
$(BUILD)/lora/spi-board.o: CFLAGS = $(CFLAGS_SIGFOX)
440445
endif
441446

442-
APP_IMG = $(BUILD)/appimg.bin
443-
PART_CSV = lib/partitions.csv
444447
PART_BIN = $(BUILD)/lib/partitions.bin
445448
PART_BIN_ENCRYPT = $(PART_BIN)_enc
446449
APP_BIN_ENCRYPT = $(APP_BIN)_enc_0x10000
450+
APP_IMG = $(BUILD)/appimg.bin
451+
ifeq ($(BOARD), $(filter $(BOARD), FIPY GPY LOPY4))
452+
PART_CSV = lib/partitions_8MB.csv
453+
APP_BIN_ENCRYPT_2 = $(APP_BIN)_enc_0x210000
454+
else
455+
PART_CSV = lib/partitions_4MB.csv
447456
APP_BIN_ENCRYPT_2 = $(APP_BIN)_enc_0x1C0000
457+
endif
448458

449459
ESPPORT ?= /dev/ttyUSB0
450460
ESPBAUD ?= 921600
@@ -476,7 +486,11 @@ SIGN_BINARY = $(ESPSECUREPY) sign_data --keyfile $(SECURE_KEY)
476486
# $(ENCRYPT_BINARY) $(ENCRYPT_0x10000) -o image_encrypt.bin image.bin
477487
ENCRYPT_BINARY = $(ESPSECUREPY) encrypt_flash_data --keyfile $(ENCRYPT_KEY)
478488
ENCRYPT_0x10000 = --address 0x10000
479-
ENCRYPT_0x1C0000 = --address 0x1C0000
489+
ifeq ($(BOARD), $(filter $(BOARD), FIPY GPY LOPY4))
490+
ENCRYPT_APP_PART_2 = --address 0x210000
491+
else
492+
ENCRYPT_APP_PART_2 = --address 0x1C0000
493+
endif
480494

481495
GEN_ESP32PART := $(PYTHON) $(ESP_IDF_COMP_PATH)/partition_table/gen_esp32part.py -q
482496

@@ -644,9 +658,13 @@ ifeq ($(SECURE), on)
644658
$(ECHO) "Signing $@"
645659
$(Q) $(SIGN_BINARY) $@
646660
$(ECHO) $(SEPARATOR)
661+
ifeq ($(BOARD), $(filter $(BOARD), FIPY GPY LOPY4))
662+
$(ECHO) "Encrypt image into $(APP_BIN_ENCRYPT) (0x10000 offset) and $(APP_BIN_ENCRYPT_2) (0x210000 offset)"
663+
else
647664
$(ECHO) "Encrypt image into $(APP_BIN_ENCRYPT) (0x10000 offset) and $(APP_BIN_ENCRYPT_2) (0x1C0000 offset)"
665+
endif
648666
$(Q) $(ENCRYPT_BINARY) $(ENCRYPT_0x10000) -o $(APP_BIN_ENCRYPT) $@
649-
$(Q) $(ENCRYPT_BINARY) $(ENCRYPT_0x1C0000) -o $(APP_BIN_ENCRYPT_2) $@
667+
$(Q) $(ENCRYPT_BINARY) $(ENCRYPT_APP_PART_2) -o $(APP_BIN_ENCRYPT_2) $@
650668
$(ECHO) "Overwrite $(APP_BIN) with $(APP_BIN_ENCRYPT)"
651669
$(CP) -f $(APP_BIN_ENCRYPT) $(APP_BIN)
652670
$(ECHO) $(SEPARATOR)
@@ -677,6 +695,8 @@ $(BUILD)/esp32_out.ld: $(ESP_IDF_COMP_PATH)/esp32/ld/esp32.ld sdkconfig.h
677695
endif #ifeq ($(TARGET), $(filter $(TARGET), app boot_app))
678696

679697
release: $(APP_BIN) $(BOOT_BIN)
698+
$(ECHO) "checking size of image"
699+
$(Q) bash tools/size_check.sh $(BOARD) $(BTYPE) $(VARIANT)
680700
$(Q) tools/makepkg.sh $(BOARD) $(RELEASE_DIR) $(BUILD)
681701

682702
flash: $(APP_BIN) $(BOOT_BIN)

esp32/tools/script renamed to esp32/boards/FIPY/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
["e", "0x1C1000", "0x40000"],
1010
["w", "0x1000", "bootloader.bin"],
1111
["w", "0x8000", "partitions.bin"],
12-
["w", "0x10000", "appimg.bin"]
12+
["w", "0x10000", "fipy.bin"]
1313
]

esp32/boards/FIPY/script2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version" : "2.1",
3+
"partitions" : {
4+
"factory" : ["0x10000", "0x1EF000"],
5+
"ota_0" : ["0x210000", 10000 "0x1EF000"],
6+
"otadata" : ["0x1FF000", "0x1000"]
7+
},
8+
"script" : [
9+
["w", "bootloader", "bootloader.bin"],
10+
["w", "partitions", "partitions.bin"],
11+
["w", "factory", "fipy.bin"]
12+
]
13+
}

esp32/boards/GPY/script

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
["e", "0x1000", "0x40000"],
3+
["e", "0x41000", "0x40000"],
4+
["e", "0x81000", "0x40000"],
5+
["e", "0xC1000", "0x40000"],
6+
["e", "0x101000", "0x40000"],
7+
["e", "0x141000", "0x40000"],
8+
["e", "0x181000", "0x40000"],
9+
["e", "0x1C1000", "0x40000"],
10+
["w", "0x1000", "bootloader.bin"],
11+
["w", "0x8000", "partitions.bin"],
12+
["w", "0x10000", "gpy.bin"]
13+
]

esp32/boards/GPY/script2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version" : "2.1",
3+
"partitions" : {
4+
"factory" : ["0x10000", "0x1EF000"],
5+
"ota_0" : ["0x210000", "0x1EF000"],
6+
"otadata" : ["0x1FF000", "0x1000"]
7+
},
8+
"script" : [
9+
["w", "bootloader", "bootloader.bin"],
10+
["w", "partitions", "partitions.bin"],
11+
["w", "factory", "gpy.bin"]
12+
]
13+
}

esp32/boards/LOPY/script

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
["e", "0x1000", "0x40000"],
3+
["e", "0x41000", "0x40000"],
4+
["e", "0x81000", "0x40000"],
5+
["e", "0xC1000", "0x40000"],
6+
["e", "0x101000", "0x40000"],
7+
["e", "0x141000", "0x40000"],
8+
["e", "0x181000", "0x40000"],
9+
["e", "0x1C1000", "0x40000"],
10+
["w", "0x1000", "bootloader.bin"],
11+
["w", "0x8000", "partitions.bin"],
12+
["w", "0x10000", "lopy.bin"]
13+
]

esp32/boards/LOPY/script2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version" : "2.1",
3+
"partitions" : {
4+
"factory" : ["0x10000", "0x1AE000"],
5+
"ota_0" : ["0x1C0000", "0x1AE000"],
6+
"otadata" : ["0x1BE000", "0x1000"]
7+
},
8+
"script" : [
9+
["w", "bootloader", "bootloader.bin"],
10+
["w", "partitions", "partitions.bin"],
11+
["w", "factory", "lopy.bin"]
12+
]
13+
}

esp32/boards/LOPY4/script

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
["e", "0x1000", "0x40000"],
3+
["e", "0x41000", "0x40000"],
4+
["e", "0x81000", "0x40000"],
5+
["e", "0xC1000", "0x40000"],
6+
["e", "0x101000", "0x40000"],
7+
["e", "0x141000", "0x40000"],
8+
["e", "0x181000", "0x40000"],
9+
["e", "0x1C1000", "0x40000"],
10+
["w", "0x1000", "bootloader.bin"],
11+
["w", "0x8000", "partitions.bin"],
12+
["w", "0x10000", "lopy4.bin"]
13+
]

esp32/boards/LOPY4/script2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version" : "2.1",
3+
"partitions" : {
4+
"factory" : ["0x10000", "0x1EF000"],
5+
"ota_0" : ["0x210000", "0x1EF000"],
6+
"otadata" : ["0x1FF000", "0x1000"]
7+
},
8+
"script" : [
9+
["w", "bootloader", "bootloader.bin"],
10+
["w", "partitions", "partitions.bin"],
11+
["w", "factory", "lopy4.bin"]
12+
]
13+
}

esp32/boards/SIPY/script

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
["e", "0x1000", "0x40000"],
3+
["e", "0x41000", "0x40000"],
4+
["e", "0x81000", "0x40000"],
5+
["e", "0xC1000", "0x40000"],
6+
["e", "0x101000", "0x40000"],
7+
["e", "0x141000", "0x40000"],
8+
["e", "0x181000", "0x40000"],
9+
["e", "0x1C1000", "0x40000"],
10+
["w", "0x1000", "bootloader.bin"],
11+
["w", "0x8000", "partitions.bin"],
12+
["w", "0x10000", "sipy.bin"]
13+
]

esp32/boards/SIPY/script2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version" : "2.1",
3+
"partitions" : {
4+
"factory" : ["0x10000", "0x1AE000"],
5+
"ota_0" : ["0x1C0000", "0x1AE000"],
6+
"otadata" : ["0x1BE000", "0x1000"]
7+
},
8+
"script" : [
9+
["w", "bootloader", "bootloader.bin"],
10+
["w", "partitions", "partitions.bin"],
11+
["w", "factory", "sipy.bin"]
12+
]
13+
}

esp32/boards/WIPY/script

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
["e", "0x1000", "0x40000"],
3+
["e", "0x41000", "0x40000"],
4+
["e", "0x81000", "0x40000"],
5+
["e", "0xC1000", "0x40000"],
6+
["e", "0x101000", "0x40000"],
7+
["e", "0x141000", "0x40000"],
8+
["e", "0x181000", "0x40000"],
9+
["e", "0x1C1000", "0x40000"],
10+
["w", "0x1000", "bootloader.bin"],
11+
["w", "0x8000", "partitions.bin"],
12+
["w", "0x10000", "wipy.bin"]
13+
]

esp32/boards/WIPY/script2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version" : "2.1",
3+
"partitions" : {
4+
"factory" : ["0x10000", "0x1AE000"],
5+
"ota_0" : ["0x1C0000", "0x1AE000"],
6+
"otadata" : ["0x1BE000", "0x1000"]
7+
},
8+
"script" : [
9+
["w", "bootloader", "bootloader.bin"],
10+
["w", "partitions", "partitions.bin"],
11+
["w", "factory", "wipy.bin"]
12+
]
13+
}

esp32/bootloader/bootloader.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,24 @@ typedef struct _boot_info_t
4141
uint32_t crc;
4242
} boot_info_t;
4343

44+
#if defined (FIPY) || defined (GPY) || defined (LOPY4) || defined(WIPY3)
45+
46+
#define IMG_SIZE (1980 * 1024)
47+
#define OTAA_DATA_SIZE (4 * 1024)
48+
#define OTA_DATA_INDEX 2
49+
#define IMG_FACTORY_OFFSET (64 * 1024)
50+
#define IMG_UPDATE1_OFFSET (2112 * 1024) // taken from the partitions table
51+
52+
#else
53+
4454
#define IMG_SIZE (1720 * 1024)
4555
#define OTAA_DATA_SIZE (4 * 1024)
4656
#define OTA_DATA_INDEX 2
4757
#define IMG_FACTORY_OFFSET (64 * 1024)
4858
#define IMG_UPDATE1_OFFSET (1792 * 1024) // taken from the partitions table
59+
60+
#endif
61+
4962
#define IMG_UPDATE2_OFFSET (IMG_FACTORY_OFFSET)
5063

5164
#define IMG_STATUS_CHECK 0
@@ -57,8 +70,11 @@ typedef struct _boot_info_t
5770

5871
#define BOOT_VERSION "V0.2"
5972
#define SPI_SEC_SIZE 0x1000
60-
73+
#if defined (FIPY) || defined (GPY) || defined (LOPY4) || defined(WIPY3)
74+
#define PARTITIONS_COUNT 5
75+
#else
6176
#define PARTITIONS_COUNT 7
77+
#endif
6278

6379
#define PART_TYPE_APP 0x00
6480
#define PART_SUBTYPE_FACTORY 0x00

esp32/frozen/LTE/sqnsupgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ def upgrade_uart(self, ffh_mode=False, mfile=None, retry=False, resume=False, co
900900
print('Preparing modem for upgrade...')
901901
if not retry and ffh_mode:
902902
success = False
903-
if self.__check_br(verbose=verbose, debug=debug):
903+
if self.__check_br(br_only=True, verbose=verbose, debug=debug):
904904
success = self.__run(bootrom=True, resume=resume, switch_ffh=True, direct=False, debug=debug, pkgdebug=pkgdebug, verbose=verbose)
905905
time.sleep(1)
906906
else:

0 commit comments

Comments
 (0)
0