diff --git a/esp32/Makefile b/esp32/Makefile index 0ab16d2762..10ca433cca 100644 --- a/esp32/Makefile +++ b/esp32/Makefile @@ -14,7 +14,7 @@ ifeq ($(wildcard boards/$(BOARD)/.),) $(error Invalid BOARD specified) endif -IDF_HASH=c61fe64 +IDF_HASH=3394ee5 TARGET ?= boot_app @@ -123,6 +123,19 @@ CFLAGS_XTENSA_PSRAM = -mfix-esp32-psram-cache-issue CFLAGS = $(CFLAGS_XTENSA) $(CFLAGS_XTENSA_PSRAM) $(CFLAGS_XTENSA_OPT) -nostdlib -std=gnu99 -g3 -ggdb -fstrict-volatile-bitfields -Iboards/$(BOARD) CFLAGS_SIGFOX = $(CFLAGS_XTENSA) -O2 -nostdlib -std=gnu99 -g3 -ggdb -fstrict-volatile-bitfields -Iboards/$(BOARD) +# Configure floating point support +ifeq ($(MICROPY_FLOAT_IMPL),double) +CFLAGS += -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_DOUBLE +else +ifeq ($(MICROPY_FLOAT_IMPL),none) +CFLAGS += -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_NONE +else +ifeq ($(MICROPY_FLOAT_IMPL),single) +CFLAGS += -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT +endif +endif +endif + LDFLAGS = -nostdlib -Wl,-Map=$(@:.elf=.map) -Wl,--no-check-sections -u call_user_start_cpu0 LDFLAGS += -Wl,-static -Wl,--undefined=uxTopUsedPriority -Wl,--gc-sections diff --git a/esp32/bootloader/lib/libbootloader_support.a b/esp32/bootloader/lib/libbootloader_support.a index 5301603761..7f15307e23 100644 Binary files a/esp32/bootloader/lib/libbootloader_support.a and b/esp32/bootloader/lib/libbootloader_support.a differ diff --git a/esp32/bootloader/lib/libefuse.a b/esp32/bootloader/lib/libefuse.a index 5f5bdc1bc9..173eeec9c4 100644 Binary files a/esp32/bootloader/lib/libefuse.a and b/esp32/bootloader/lib/libefuse.a differ diff --git a/esp32/bootloader/lib/liblog.a b/esp32/bootloader/lib/liblog.a index 1673bcac0a..78a2937b20 100644 Binary files a/esp32/bootloader/lib/liblog.a and b/esp32/bootloader/lib/liblog.a differ diff --git a/esp32/bootloader/lib/libmicro-ecc.a b/esp32/bootloader/lib/libmicro-ecc.a index d4380c398d..0effdb6e3e 100644 Binary files a/esp32/bootloader/lib/libmicro-ecc.a and b/esp32/bootloader/lib/libmicro-ecc.a differ diff --git a/esp32/bootloader/lib/libsoc.a b/esp32/bootloader/lib/libsoc.a index 8fcf86f031..4de815ae6e 100644 Binary files a/esp32/bootloader/lib/libsoc.a and b/esp32/bootloader/lib/libsoc.a differ diff --git a/esp32/bootloader/lib/libspi_flash.a b/esp32/bootloader/lib/libspi_flash.a index 4843d58c84..cd2afbaa38 100644 Binary files a/esp32/bootloader/lib/libspi_flash.a and b/esp32/bootloader/lib/libspi_flash.a differ diff --git a/esp32/esp32.project.ld b/esp32/esp32.project.ld index 67db3674b8..15c9d87d00 100644 --- a/esp32/esp32.project.ld +++ b/esp32/esp32.project.ld @@ -176,29 +176,28 @@ SECTIONS *libgcc.a:lib2funcs.*( .literal .literal.* .text .text.*) *libsoc.a:rtc_time.*( .literal .literal.* .text .text.*) *libsoc.a:cpu_util.*( .literal .literal.* .text .text.*) - *libsoc.a:rtc_sleep.*( .literal .literal.* .text .text.*) *libsoc.a:rtc_clk_init.*( .literal .literal.* .text .text.*) *libsoc.a:rtc_clk.*( .literal .literal.* .text .text.*) *libsoc.a:rtc_init.*( .literal .literal.* .text .text.*) *libsoc.a:rtc_pm.*( .literal .literal.* .text .text.*) + *libsoc.a:rtc_sleep.*( .literal .literal.* .text .text.*) *libsoc.a:rtc_wdt.*( .literal .literal.* .text .text.*) *libsoc.a:rtc_periph.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-time.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:creat.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:isatty.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-makebuf.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strcasestr.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-tzlock.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-memset.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strdup.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-environ.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:lib_a-stdio.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-tzcalc_limits.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-labs.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strlcat.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:lib_a-isdigit.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:lib_a-strstr.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:lib_a-lcltime_r.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-ungetc.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strlen.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:isatty.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-tzset_r.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-asctime_r.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-tolower.*( .literal .literal.* .text .text.*) @@ -216,7 +215,7 @@ SECTIONS *libc-psram-workaround.a:lib_a-isblank.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-read.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-tzset.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:lib_a-wsetup.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:lib_a-rand_r.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-ispunct.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-s_fpclassify.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-quorem.*( .literal .literal.* .text .text.*) @@ -233,7 +232,7 @@ SECTIONS *libc-psram-workaround.a:lib_a-strcmp.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-rshift.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-toascii.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:lib_a-lcltime_r.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:lib_a-isdigit.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-isalpha.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-wcrtomb.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-tzvars.*( .literal .literal.* .text .text.*) @@ -241,22 +240,23 @@ SECTIONS *libc-psram-workaround.a:lib_a-strndup_r.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-gmtime.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-gmtime_r.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:lib_a-sccl.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-wbuf.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-mktime.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-ctime_r.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-isascii.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-memcpy.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:creat.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-sysclose.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-setjmp.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-srand.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strcat.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:lib_a-strstr.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-bzero.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-month_lengths.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strncat.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strftime.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-isupper.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:lib_a-rand_r.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:lib_a-wsetup.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-close.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-islower.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strncpy.*( .literal .literal.* .text .text.*) @@ -271,7 +271,6 @@ SECTIONS *libc-psram-workaround.a:lib_a-refill.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-atoi.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-envlock.*( .literal .literal.* .text .text.*) - *libc-psram-workaround.a:lib_a-sccl.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strnlen.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-isgraph.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-syssbrk.*( .literal .literal.* .text .text.*) @@ -290,6 +289,7 @@ SECTIONS *libc-psram-workaround.a:lib_a-open.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-utoa.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strcpy.*( .literal .literal.* .text .text.*) + *libc-psram-workaround.a:lib_a-stdio.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-fputwc.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-strtok_r.*( .literal .literal.* .text .text.*) *libc-psram-workaround.a:lib_a-memmove.*( .literal .literal.* .text .text.*) @@ -348,21 +348,20 @@ SECTIONS *libphy.a:( .rodata .rodata.*) *libsoc.a:rtc_clk.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-time.*( .rodata .rodata.*) - *libc-psram-workaround.a:creat.*( .rodata .rodata.*) - *libc-psram-workaround.a:isatty.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-makebuf.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strcasestr.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-tzlock.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-memset.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strdup.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-environ.*( .rodata .rodata.*) - *libc-psram-workaround.a:lib_a-stdio.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-tzcalc_limits.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-labs.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strlcat.*( .rodata .rodata.*) - *libc-psram-workaround.a:lib_a-isdigit.*( .rodata .rodata.*) + *libc-psram-workaround.a:lib_a-strstr.*( .rodata .rodata.*) + *libc-psram-workaround.a:lib_a-lcltime_r.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-ungetc.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strlen.*( .rodata .rodata.*) + *libc-psram-workaround.a:isatty.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-tzset_r.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-asctime_r.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-tolower.*( .rodata .rodata.*) @@ -380,7 +379,7 @@ SECTIONS *libc-psram-workaround.a:lib_a-isblank.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-read.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-tzset.*( .rodata .rodata.*) - *libc-psram-workaround.a:lib_a-wsetup.*( .rodata .rodata.*) + *libc-psram-workaround.a:lib_a-rand_r.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-ispunct.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-s_fpclassify.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-quorem.*( .rodata .rodata.*) @@ -397,7 +396,7 @@ SECTIONS *libc-psram-workaround.a:lib_a-strcmp.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-rshift.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-toascii.*( .rodata .rodata.*) - *libc-psram-workaround.a:lib_a-lcltime_r.*( .rodata .rodata.*) + *libc-psram-workaround.a:lib_a-isdigit.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-isalpha.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-wcrtomb.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-tzvars.*( .rodata .rodata.*) @@ -405,22 +404,23 @@ SECTIONS *libc-psram-workaround.a:lib_a-strndup_r.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-gmtime.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-gmtime_r.*( .rodata .rodata.*) + *libc-psram-workaround.a:lib_a-sccl.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-wbuf.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-mktime.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-ctime_r.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-isascii.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-memcpy.*( .rodata .rodata.*) + *libc-psram-workaround.a:creat.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-sysclose.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-setjmp.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-srand.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strcat.*( .rodata .rodata.*) - *libc-psram-workaround.a:lib_a-strstr.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-bzero.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-month_lengths.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strncat.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strftime.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-isupper.*( .rodata .rodata.*) - *libc-psram-workaround.a:lib_a-rand_r.*( .rodata .rodata.*) + *libc-psram-workaround.a:lib_a-wsetup.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-close.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-islower.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strncpy.*( .rodata .rodata.*) @@ -435,7 +435,6 @@ SECTIONS *libc-psram-workaround.a:lib_a-refill.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-atoi.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-envlock.*( .rodata .rodata.*) - *libc-psram-workaround.a:lib_a-sccl.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strnlen.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-isgraph.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-syssbrk.*( .rodata .rodata.*) @@ -454,6 +453,7 @@ SECTIONS *libc-psram-workaround.a:lib_a-open.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-utoa.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strcpy.*( .rodata .rodata.*) + *libc-psram-workaround.a:lib_a-stdio.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-fputwc.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-strtok_r.*( .rodata .rodata.*) *libc-psram-workaround.a:lib_a-memmove.*( .rodata .rodata.*) @@ -539,7 +539,7 @@ SECTIONS *(.rodata_desc .rodata_desc.*) /* Should be the first. App version info. DO NOT PUT ANYTHING BEFORE IT! */ *(.rodata_custom_desc .rodata_custom_desc.*) /* Should be the second. Custom app version info. DO NOT PUT ANYTHING BEFORE IT! */ - *(EXCLUDE_FILE(*libapp_trace.a *libesp32.a:panic.* *libphy.a *libsoc.a:rtc_clk.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-time.* *libgcov.a *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .rodata EXCLUDE_FILE(*libapp_trace.a *libesp32.a:panic.* *libphy.a *libsoc.a:rtc_clk.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-time.* *libgcov.a *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .rodata.*) + *(EXCLUDE_FILE(*libapp_trace.a *libesp32.a:panic.* *libphy.a *libsoc.a:rtc_clk.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:lib_a-time.* *libgcov.a *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .rodata EXCLUDE_FILE(*libapp_trace.a *libesp32.a:panic.* *libphy.a *libsoc.a:rtc_clk.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:lib_a-time.* *libgcov.a *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .rodata.*) *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */ *(.gnu.linkonce.r.*) @@ -599,7 +599,7 @@ SECTIONS _stext = .; _text_start = ABSOLUTE(.); - *(EXCLUDE_FILE(*libspi_flash.a:spi_flash_rom_patch.* *libesp_ringbuf.a *libhal.a *libapp_trace.a *libesp32.a:panic.* *libespcoredump.a:core_dump_common.* *libespcoredump.a:core_dump_uart.* *libespcoredump.a:core_dump_flash.* *libespcoredump.a:core_dump_port.* *librtc.a *libgcc.a:lib2funcs.* *libsoc.a:rtc_periph.* *libsoc.a:rtc_wdt.* *libsoc.a:rtc_pm.* *libsoc.a:rtc_init.* *libsoc.a:rtc_clk.* *libsoc.a:rtc_clk_init.* *libsoc.a:rtc_sleep.* *libsoc.a:cpu_util.* *libsoc.a:rtc_time.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-time.* *libfreertos.a *libgcov.a *libxtensa-debug-module.a:eri.* *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .literal EXCLUDE_FILE(*libspi_flash.a:spi_flash_rom_patch.* *libesp_ringbuf.a *libhal.a *libapp_trace.a *libesp32.a:panic.* *libespcoredump.a:core_dump_common.* *libespcoredump.a:core_dump_uart.* *libespcoredump.a:core_dump_flash.* *libespcoredump.a:core_dump_port.* *librtc.a *libgcc.a:lib2funcs.* *libsoc.a:rtc_periph.* *libsoc.a:rtc_wdt.* *libsoc.a:rtc_pm.* *libsoc.a:rtc_init.* *libsoc.a:rtc_clk.* *libsoc.a:rtc_clk_init.* *libsoc.a:rtc_sleep.* *libsoc.a:cpu_util.* *libsoc.a:rtc_time.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-time.* *libfreertos.a *libgcov.a *libxtensa-debug-module.a:eri.* *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .literal.* EXCLUDE_FILE(*libspi_flash.a:spi_flash_rom_patch.* *libesp_ringbuf.a *libhal.a *libapp_trace.a *libesp32.a:panic.* *libespcoredump.a:core_dump_common.* *libespcoredump.a:core_dump_uart.* *libespcoredump.a:core_dump_flash.* *libespcoredump.a:core_dump_port.* *librtc.a *libgcc.a:lib2funcs.* *libsoc.a:rtc_periph.* *libsoc.a:rtc_wdt.* *libsoc.a:rtc_pm.* *libsoc.a:rtc_init.* *libsoc.a:rtc_clk.* *libsoc.a:rtc_clk_init.* *libsoc.a:rtc_sleep.* *libsoc.a:cpu_util.* *libsoc.a:rtc_time.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-time.* *libfreertos.a *libgcov.a *libxtensa-debug-module.a:eri.* *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .text EXCLUDE_FILE(*libspi_flash.a:spi_flash_rom_patch.* *libesp_ringbuf.a *libhal.a *libapp_trace.a *libesp32.a:panic.* *libespcoredump.a:core_dump_common.* *libespcoredump.a:core_dump_uart.* *libespcoredump.a:core_dump_flash.* *libespcoredump.a:core_dump_port.* *librtc.a *libgcc.a:lib2funcs.* *libsoc.a:rtc_periph.* *libsoc.a:rtc_wdt.* *libsoc.a:rtc_pm.* *libsoc.a:rtc_init.* *libsoc.a:rtc_clk.* *libsoc.a:rtc_clk_init.* *libsoc.a:rtc_sleep.* *libsoc.a:cpu_util.* *libsoc.a:rtc_time.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-time.* *libfreertos.a *libgcov.a *libxtensa-debug-module.a:eri.* *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .text.* .wifi0iram .wifi0iram.*) + *(EXCLUDE_FILE(*libspi_flash.a:spi_flash_rom_patch.* *libesp_ringbuf.a *libhal.a *libapp_trace.a *libesp32.a:panic.* *libespcoredump.a:core_dump_common.* *libespcoredump.a:core_dump_uart.* *libespcoredump.a:core_dump_flash.* *libespcoredump.a:core_dump_port.* *librtc.a *libgcc.a:lib2funcs.* *libsoc.a:rtc_periph.* *libsoc.a:rtc_wdt.* *libsoc.a:rtc_sleep.* *libsoc.a:rtc_pm.* *libsoc.a:rtc_init.* *libsoc.a:rtc_clk.* *libsoc.a:rtc_clk_init.* *libsoc.a:cpu_util.* *libsoc.a:rtc_time.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:lib_a-time.* *libfreertos.a *libgcov.a *libxtensa-debug-module.a:eri.* *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .literal EXCLUDE_FILE(*libspi_flash.a:spi_flash_rom_patch.* *libesp_ringbuf.a *libhal.a *libapp_trace.a *libesp32.a:panic.* *libespcoredump.a:core_dump_common.* *libespcoredump.a:core_dump_uart.* *libespcoredump.a:core_dump_flash.* *libespcoredump.a:core_dump_port.* *librtc.a *libgcc.a:lib2funcs.* *libsoc.a:rtc_periph.* *libsoc.a:rtc_wdt.* *libsoc.a:rtc_sleep.* *libsoc.a:rtc_pm.* *libsoc.a:rtc_init.* *libsoc.a:rtc_clk.* *libsoc.a:rtc_clk_init.* *libsoc.a:cpu_util.* *libsoc.a:rtc_time.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:lib_a-time.* *libfreertos.a *libgcov.a *libxtensa-debug-module.a:eri.* *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .literal.* EXCLUDE_FILE(*libspi_flash.a:spi_flash_rom_patch.* *libesp_ringbuf.a *libhal.a *libapp_trace.a *libesp32.a:panic.* *libespcoredump.a:core_dump_common.* *libespcoredump.a:core_dump_uart.* *libespcoredump.a:core_dump_flash.* *libespcoredump.a:core_dump_port.* *librtc.a *libgcc.a:lib2funcs.* *libsoc.a:rtc_periph.* *libsoc.a:rtc_wdt.* *libsoc.a:rtc_sleep.* *libsoc.a:rtc_pm.* *libsoc.a:rtc_init.* *libsoc.a:rtc_clk.* *libsoc.a:rtc_clk_init.* *libsoc.a:cpu_util.* *libsoc.a:rtc_time.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:lib_a-time.* *libfreertos.a *libgcov.a *libxtensa-debug-module.a:eri.* *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .text EXCLUDE_FILE(*libspi_flash.a:spi_flash_rom_patch.* *libesp_ringbuf.a *libhal.a *libapp_trace.a *libesp32.a:panic.* *libespcoredump.a:core_dump_common.* *libespcoredump.a:core_dump_uart.* *libespcoredump.a:core_dump_flash.* *libespcoredump.a:core_dump_port.* *librtc.a *libgcc.a:lib2funcs.* *libsoc.a:rtc_periph.* *libsoc.a:rtc_wdt.* *libsoc.a:rtc_sleep.* *libsoc.a:rtc_pm.* *libsoc.a:rtc_init.* *libsoc.a:rtc_clk.* *libsoc.a:rtc_clk_init.* *libsoc.a:cpu_util.* *libsoc.a:rtc_time.* *libc-psram-workaround.a:lock.* *libc-psram-workaround.a:lib_a-ctype_.* *libc-psram-workaround.a:lib_a-div.* *libc-psram-workaround.a:lib_a-systimes.* *libc-psram-workaround.a:lib_a-findfp.* *libc-psram-workaround.a:lib_a-strptime.* *libc-psram-workaround.a:lib_a-strlwr.* *libc-psram-workaround.a:lib_a-lcltime.* *libc-psram-workaround.a:lib_a-strupr.* *libc-psram-workaround.a:lib_a-fflush.* *libc-psram-workaround.a:lib_a-ctime.* *libc-psram-workaround.a:lib_a-rand.* *libc-psram-workaround.a:lib_a-impure.* *libc-psram-workaround.a:lib_a-syswrite.* *libc-psram-workaround.a:lib_a-isprint.* *libc-psram-workaround.a:lib_a-memmove.* *libc-psram-workaround.a:lib_a-strtok_r.* *libc-psram-workaround.a:lib_a-fputwc.* *libc-psram-workaround.a:lib_a-stdio.* *libc-psram-workaround.a:lib_a-strcpy.* *libc-psram-workaround.a:lib_a-utoa.* *libc-psram-workaround.a:lib_a-open.* *libc-psram-workaround.a:lib_a-memrchr.* *libc-psram-workaround.a:lib_a-itoa.* *libc-psram-workaround.a:lib_a-strsep.* *libc-psram-workaround.a:lib_a-strtoul.* *libc-psram-workaround.a:lib_a-toupper.* *libc-psram-workaround.a:lib_a-sysopen.* *libc-psram-workaround.a:lib_a-strdup_r.* *libc-psram-workaround.a:lib_a-strlcpy.* *libc-psram-workaround.a:lib_a-timelocal.* *libc-psram-workaround.a:lib_a-sbrk.* *libc-psram-workaround.a:lib_a-longjmp.* *libc-psram-workaround.a:lib_a-sysread.* *libc-psram-workaround.a:lib_a-syssbrk.* *libc-psram-workaround.a:lib_a-isgraph.* *libc-psram-workaround.a:lib_a-strnlen.* *libc-psram-workaround.a:lib_a-envlock.* *libc-psram-workaround.a:lib_a-atoi.* *libc-psram-workaround.a:lib_a-refill.* *libc-psram-workaround.a:lib_a-memchr.* *libc-psram-workaround.a:lib_a-strchr.* *libc-psram-workaround.a:lib_a-system.* *libc-psram-workaround.a:lib_a-isspace.* *libc-psram-workaround.a:lib_a-getenv_r.* *libc-psram-workaround.a:lib_a-ldiv.* *libc-psram-workaround.a:lib_a-atol.* *libc-psram-workaround.a:lib_a-raise.* *libc-psram-workaround.a:lib_a-strncpy.* *libc-psram-workaround.a:lib_a-islower.* *libc-psram-workaround.a:lib_a-close.* *libc-psram-workaround.a:lib_a-wsetup.* *libc-psram-workaround.a:lib_a-isupper.* *libc-psram-workaround.a:lib_a-strftime.* *libc-psram-workaround.a:lib_a-strncat.* *libc-psram-workaround.a:lib_a-month_lengths.* *libc-psram-workaround.a:lib_a-bzero.* *libc-psram-workaround.a:lib_a-strcat.* *libc-psram-workaround.a:lib_a-srand.* *libc-psram-workaround.a:lib_a-setjmp.* *libc-psram-workaround.a:lib_a-sysclose.* *libc-psram-workaround.a:creat.* *libc-psram-workaround.a:lib_a-memcpy.* *libc-psram-workaround.a:lib_a-isascii.* *libc-psram-workaround.a:lib_a-ctime_r.* *libc-psram-workaround.a:lib_a-mktime.* *libc-psram-workaround.a:lib_a-wbuf.* *libc-psram-workaround.a:lib_a-sccl.* *libc-psram-workaround.a:lib_a-gmtime_r.* *libc-psram-workaround.a:lib_a-gmtime.* *libc-psram-workaround.a:lib_a-strndup_r.* *libc-psram-workaround.a:lib_a-strcoll.* *libc-psram-workaround.a:lib_a-tzvars.* *libc-psram-workaround.a:lib_a-wcrtomb.* *libc-psram-workaround.a:lib_a-isalpha.* *libc-psram-workaround.a:lib_a-isdigit.* *libc-psram-workaround.a:lib_a-toascii.* *libc-psram-workaround.a:lib_a-rshift.* *libc-psram-workaround.a:lib_a-strcmp.* *libc-psram-workaround.a:lib_a-memcmp.* *libc-psram-workaround.a:lib_a-fwalk.* *libc-psram-workaround.a:lib_a-creat.* *libc-psram-workaround.a:lib_a-strtol.* *libc-psram-workaround.a:lib_a-isalnum.* *libc-psram-workaround.a:lib_a-fclose.* *libc-psram-workaround.a:lib_a-gettzinfo.* *libc-psram-workaround.a:lib_a-strndup.* *libc-psram-workaround.a:lib_a-strrchr.* *libc-psram-workaround.a:lib_a-strspn.* *libc-psram-workaround.a:lib_a-quorem.* *libc-psram-workaround.a:lib_a-s_fpclassify.* *libc-psram-workaround.a:lib_a-ispunct.* *libc-psram-workaround.a:lib_a-rand_r.* *libc-psram-workaround.a:lib_a-tzset.* *libc-psram-workaround.a:lib_a-read.* *libc-psram-workaround.a:lib_a-isblank.* *libc-psram-workaround.a:lib_a-fvwrite.* *libc-psram-workaround.a:lib_a-strncmp.* *libc-psram-workaround.a:lib_a-asctime.* *libc-psram-workaround.a:lib_a-sf_nan.* *libc-psram-workaround.a:lib_a-abs.* *libc-psram-workaround.a:lib_a-strncasecmp.* *libc-psram-workaround.a:lib_a-iscntrl.* *libc-psram-workaround.a:lib_a-strcasecmp.* *libc-psram-workaround.a:lib_a-strcspn.* *libc-psram-workaround.a:lib_a-wctomb_r.* *libc-psram-workaround.a:lib_a-memccpy.* *libc-psram-workaround.a:lib_a-tolower.* *libc-psram-workaround.a:lib_a-asctime_r.* *libc-psram-workaround.a:lib_a-tzset_r.* *libc-psram-workaround.a:isatty.* *libc-psram-workaround.a:lib_a-strlen.* *libc-psram-workaround.a:lib_a-ungetc.* *libc-psram-workaround.a:lib_a-lcltime_r.* *libc-psram-workaround.a:lib_a-strstr.* *libc-psram-workaround.a:lib_a-strlcat.* *libc-psram-workaround.a:lib_a-labs.* *libc-psram-workaround.a:lib_a-tzcalc_limits.* *libc-psram-workaround.a:lib_a-environ.* *libc-psram-workaround.a:lib_a-strdup.* *libc-psram-workaround.a:lib_a-memset.* *libc-psram-workaround.a:lib_a-tzlock.* *libc-psram-workaround.a:lib_a-strcasestr.* *libc-psram-workaround.a:lib_a-makebuf.* *libc-psram-workaround.a:lib_a-time.* *libfreertos.a *libgcov.a *libxtensa-debug-module.a:eri.* *libheap.a:multi_heap_poisoning.* *libheap.a:multi_heap.*) .text.* .wifi0iram .wifi0iram.*) *(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) *(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */ diff --git a/esp32/frozen/Pybytes/_OTA.py b/esp32/frozen/Pybytes/_OTA.py index 63d20ac3ec..a1391035c3 100644 --- a/esp32/frozen/Pybytes/_OTA.py +++ b/esp32/frozen/Pybytes/_OTA.py @@ -137,7 +137,6 @@ def update(self, customManifest=None, fwtype=None, token=None): def get_file(self, f): new_path = "{}.new".format(f['dst_path']) - # If a .new file exists from a previously failed update delete it try: os.remove(new_path) @@ -184,6 +183,15 @@ def delete_file(self, f): def write_firmware(self, f): # hash = + url = f['URL'].split("//")[1].split("/")[0] + + if url.find(":") > -1: + self.ip = url.split(":")[0] + self.port = int(url.split(":")[1]) + else: + self.ip = url + self.port = 443 + self.get_data( f['URL'].split("/", 3)[-1], hash=True, @@ -222,7 +230,6 @@ def _http_get(self, path, host): def get_data(self, req, dest_path=None, hash=False, firmware=False): h = None - useSSL = int(self.port) == 443 # Connect to server @@ -232,11 +239,9 @@ def get_data(self, req, dest_path=None, hash=False, firmware=False): if (int(self.port) == 443): print("Wrapping socket") s = ssl.wrap_socket(s) - print("Sending request") # Request File s.sendall(self._http_get(req, "{}:{}".format(self.ip, self.port))) - try: content = bytearray() fp = None @@ -247,6 +252,7 @@ def get_data(self, req, dest_path=None, hash=False, firmware=False): fp = open(dest_path, 'wb') if firmware: + print_debug(4, "Starting OTA...") pycom.ota_start() h = uhashlib.sha1() diff --git a/esp32/frozen/Pybytes/_pybytes_constants.py b/esp32/frozen/Pybytes/_pybytes_constants.py index aa1d27cd67..8ae4058530 100644 --- a/esp32/frozen/Pybytes/_pybytes_constants.py +++ b/esp32/frozen/Pybytes/_pybytes_constants.py @@ -69,11 +69,12 @@ class constants: __TYPE_OTA = 0x05 __TYPE_FCOTA = 0x06 __TYPE_PONG = 0x07 - __TYPE_PYMESH = 0x0D - __TYPE_PYBYTES = 0x0E - __TYPE_RELEASE_INFO = 0x0B __TYPE_RELEASE_DEPLOY = 0x0A + __TYPE_RELEASE_INFO = 0x0B __TYPE_DEVICE_NETWORK_DEPLOY = 0x0C + __TYPE_PYMESH = 0x0D + __TYPE_PYBYTES = 0x0E + __TYPE_ML = 0x0F __PYBYTES_PROTOCOL = ">B%ds" __PYBYTES_PROTOCOL_PING = ">B" __PYBYTES_INTERNAL_PROTOCOL = ">BBH" @@ -90,6 +91,8 @@ class constants: __COMMAND_ANALOG_WRITE = 4 __COMMAND_CUSTOM_METHOD = 5 __COMMAND_CUSTOM_LOCATION = 6 + __COMMAND_START_SAMPLE = 7 + __COMMAND_DEPLOY_MODEL = 8 __FCOTA_COMMAND_HIERARCHY_ACQUISITION = 0x00 __FCOTA_COMMAND_FILE_ACQUISITION = 0x01 diff --git a/esp32/frozen/Pybytes/_pybytes_machine_learning.py b/esp32/frozen/Pybytes/_pybytes_machine_learning.py new file mode 100644 index 0000000000..5c1fce6626 --- /dev/null +++ b/esp32/frozen/Pybytes/_pybytes_machine_learning.py @@ -0,0 +1,176 @@ +''' +Copyright (c) 2020, Pycom Limited. +This software is licensed under the GNU GPL version 3 or any +later version, with permitted additional terms. For more information +see the Pycom Licence v1.0 document supplied with this file, or +available at https://www.pycom.io/opensource/licensing +''' + +import math +import json + +try: + from pybytes_debug import print_debug +except: + from _pybytes_debug import print_debug + +try: + import urequest +except: + import _urequest as urequest + +try: + from pybytes_constants import constants +except: + from _pybytes_constants import constants + +import pycom + +try: + from LIS2HH12 import * +except: + print_debug(5, "LIS2HH12 not imported") + +# 20 seconds, max window in time for recording +MAX_LEN_MSEC = const(20000) + +# 350Hz, max frequency +MAX_FREQ_HZ = const(350) + + +class MlFeatures(): + def __init__(self, pybytes_protocol=None, parameters=None): + if parameters is not None: + self.__length = parameters["length"] + self.__label = parameters["label"] + self.__sampleName = parameters["sampleName"] + self.__type = parameters["type"] + self.__device = parameters["device"] + self.__model = parameters["model"] + self.__mlSample = parameters["mlSample"] + self.__frequency = parameters["frequency"] + self.__pybytes_protocol = pybytes_protocol + self.__data = [] + + def _debug_hack(self, pybytes): + self.__pybytes = pybytes + + def start_sampling(self, pin): + # here define the required libraries + try: + from pysense import Pysense + except: + print_debug(5, "pysense not imported") + + try: + from pytrack import Pytrack + except: + print_debug(5, "pytrack not imported") + + lib = False + try: + py = Pysense() + lib = True + except NameError: + print_debug(5, "Pysense not defined") + + if not lib: + try: + py = Pytrack() + except NameError: + print_debug(5, "Check if Pysense/Pytrack libraries are loaded") + return + + try: + li = LIS2HH12(py) + except NameError: + print_debug(5, "LIS2HH12 library are not loaded") + return + li.set_odr(ODR_400_HZ) + + # make the max record length to 20 seconds + self.__length = min(MAX_LEN_MSEC, self.__length) + + # make the max frequency to 350Hz + self.__frequency = min(MAX_FREQ_HZ, self.__frequency) + + # compute time interval between 2 consecutive samples + delta_t_us = int(1000000.0 / self.__frequency) + # compute the number of samples to be acquisition + samples_num = math.ceil(self.__length * self.__frequency / 1000) + 1 + + try: + pycom.heartbeat(False) + pycom.rgbled(0x7f7f00) + except: + pass + time.sleep(0.5) + + self.__data = [] + index = 0 + print("Start acquisition data for %d msec, freq %d Hz" % (self.__length, self.__frequency)) + + next_ts = time.ticks_us() + ts_orig = next_ts + while True: + while time.ticks_diff(next_ts, time.ticks_us()) > 0: + pass + acc = li.acceleration() + ts = next_ts + self.__data.append((ts - ts_orig, acc)) + next_ts = ts + delta_t_us + index += 1 + if index >= samples_num: + break # done + + print("Done acquisition %d samples, real freq %.1f Hz" % (index, index / (self.__length / 1000))) + self._parse_data(pin) + + def _send_data(self, data, pin, acc, ts): + if self.__pybytes_protocol is not None: + if self.__type == 2: + self.__label = self.__sampleName + self.__pybytes_protocol.send_pybytes_custom_method_values(pin, [ + data], + 'sample/{}/{}/{}/{}/{}'.format(self.__label, self.__type, self.__model, self.__device, self.__mlSample)) + else: + self.__pybytes.send_signal(pin & 0xFF, str((int(ts / 1000), acc))) + + def _parse_data(self, pin): + print("_parse_data, %d samples" % len(self.__data)) + try: + pycom.rgbled(0x8d05f5) + except: + pass + data = ['{"data": "ml"}'] + for (ts, acc) in self.__data: + data.append('{' + '"data": [{},{},{}], "ms": {}'.format(acc[0], acc[1], acc[2], int(ts / 1000)) + '}') + if len(data) > 25: + self._send_data(data, pin, acc, ts) + data = ['{"data": "ml"}'] + self._send_data(data, pin, acc, ts) + try: + pycom.heartbeat(True) + except: + pass + + def deploy_model(self, modelId, silent=False): + try: + file = '/flash/model_definition.json' + modelDefinition = {} + url = '{}://{}/ml/{}'.format( + constants.__DEFAULT_PYCONFIG_PROTOCOL, + constants.__DEFAULT_PYCONFIG_DOMAIN, + modelId + ) + print_debug(2, '{}'.format(url)) + result = urequest.get(url, headers={'content-type': 'application/json'}) + modelDefinition = json.loads(result.content.decode()) + print_debug(2, 'modelDefinition: {}'.format(modelDefinition)) + f = open(file, 'w') + f.write(json.dumps(modelDefinition).encode('utf-8')) + f.close() + print_debug(2, "Model definition written to {}".format(file)) + except Exception as e: + if not silent: + print_debug(2, "Exception: {}".format(e)) diff --git a/esp32/frozen/Pybytes/_pybytes_protocol.py b/esp32/frozen/Pybytes/_pybytes_protocol.py index 385d8c6f9c..f7d1ba41ed 100644 --- a/esp32/frozen/Pybytes/_pybytes_protocol.py +++ b/esp32/frozen/Pybytes/_pybytes_protocol.py @@ -31,6 +31,11 @@ except: from _pybytes_pymesh_config import PybytesPymeshConfig +try: + from pybytes_machine_learning import MlFeatures +except: + from _pybytes_machine_learning import MlFeatures + try: from pybytes_config_reader import PybytesConfigReader except: @@ -64,6 +69,7 @@ import struct import machine import ujson +import pycom class PybytesProtocol: @@ -281,10 +287,10 @@ def __process_recv_message(self, message): splittedBody = bodyString.split(',') if (len(splittedBody) >= 2): path = splittedBody[0] - print_debug(2, path[len(path)-7:len(path)]) - if (path[len(path)-7:len(path)] != '.pymakr'): + print_debug(2, path[len(path) - 7:len(path)]) + if (path[len(path) - 7:len(path)] != '.pymakr'): self.send_fcota_ping('updating file...') - newContent = bodyString[len(path)+1:len(body)] + newContent = bodyString[len(path) + 1:len(body)] if (self.__FCOTA.update_file_content(path, newContent) is True): # noqa size = self.__FCOTA.get_file_size(path) self.send_fcota_file(newContent, path, size) @@ -319,7 +325,18 @@ def __process_recv_message(self, message): if (len(body) > 3): value = body[2] << 8 | body[3] - if (command == constants.__COMMAND_PIN_MODE): + if (command == constants.__COMMAND_START_SAMPLE): + parameters = ujson.loads(body[2: len(body)].decode("utf-8")) + sampling = MlFeatures(self, parameters=parameters) + sampling.start_sampling(pin=parameters["pin"]) + self.send_ota_response(result=2, topic='sample') + elif (command == constants.__COMMAND_DEPLOY_MODEL): + parameters = ujson.loads(body[2: len(body)].decode("utf-8")) + sampling = MlFeatures() + sampling.deploy_model(modelId=parameters["modelId"]) + self.send_ota_response(result=2, topic='deploymlmodel') + + elif (command == constants.__COMMAND_PIN_MODE): pass elif (command == constants.__COMMAND_DIGITAL_READ): @@ -633,16 +650,11 @@ def write_firmware(self, customManifest=None): def get_application_details(self, body): application = self.__conf.get('application') if application is not None: - if 'id' in application and application['id']: - applicationID = application['id'] - else: - applicationID = body['applicationId'] if 'release' in application and 'codeFilename' in application['release']: currentReleaseID = application['release']['codeFilename'] else: currentReleaseID = None else: - applicationID = body['applicationId'] currentReleaseID = None self.__conf['application'] = { "id": "", @@ -652,6 +664,7 @@ def get_application_details(self, body): "version": 0 } } + applicationID = body['applicationId'] return (applicationID, currentReleaseID) def get_update_manifest(self, applicationID, newReleaseID, currentReleaseID): @@ -755,21 +768,49 @@ def update_network_config(self, letResp): except Exception as e: print_debug(1, "error while updating network config pybytes_config.json! {}".format(e)) - def update_firmware(self, body): + def update_firmware(self, body, applicationID, fw_type='pybytes'): if "firmware" not in body: print_debug(0, "no firmware to update") return - version = body['firmware']["version"] - print_debug(0, "updating firmware to {}".format(version)) - customManifest = { - "firmware": { - "URL": "https://{}/downloads/appimg/firmware_{}_{}.bin".format( - constants.__DEFAULT_SW_HOST, - os.uname().sysname, - version), + + if "version" in body['firmware']: + version = body['firmware']["version"] + print_debug(0, "updating firmware to {}".format(version)) + + customManifest = { + "firmware": { + "URL": "https://{}/manifest.json?sysname={}&wmac={}&ota_slot={}&fwtype={}&target_ver={}&download=true".format( + constants.__DEFAULT_SW_HOST, + os.uname().sysname, + hexlify(machine.unique_id()).decode('ascii'), + hex(pycom.ota_slot()), + fw_type, + version), + } } - } - self.write_firmware(customManifest) + print_debug(5, "Custom Manifest: {}".format(customManifest)) + self.write_firmware(customManifest) + else: + fileUrl = '{}://{}/firmware?'.format(constants.__DEFAULT_PYCONFIG_PROTOCOL, constants.__DEFAULT_PYCONFIG_DOMAIN) + customFirmwares = body['firmware']["customFirmwares"] + firmwareFilename = '' + for firmware in customFirmwares: + print_debug(1, "firmware['firmwareType']={} and os.uname().sysname.lower()={}".format(firmware['firmwareType'], os.uname().sysname.lower())) + print_debug(1, "firmware={}".format(firmware)) + if (firmware['firmwareType'] == os.uname().sysname.lower()): + firmwareFilename = firmware['firmwareFilename'] + targetFileLocation = '{}application_id={}&target_ver={}&target_path={}'.format( + fileUrl, + applicationID, + firmwareFilename, + '/{}.bin'.format(firmwareFilename) + ) + customManifest = { + "firmware": { + "URL": targetFileLocation, + } + } + self.write_firmware(customManifest) def deploy_new_release(self, body): try: @@ -783,12 +824,15 @@ def deploy_new_release(self, body): applicationID, currentReleaseID = self.get_application_details(body) letResp = self.get_update_manifest(applicationID, newReleaseID, currentReleaseID) + if not letResp: return + fwtype = 'pygate' if hasattr(os.uname(), 'pygate') else 'pybytes' + fwtype = 'pymesh' if hasattr(os.uname(), 'pymesh') else fwtype self.update_files(letResp, applicationID, newReleaseID) self.delete_files(letResp) self.update_application_config(letResp, applicationID) self.update_network_config(letResp) - self.update_firmware(letResp) + self.update_firmware(letResp, applicationID, fw_type=fwtype) machine.reset() diff --git a/esp32/frozen/Pybytes/_pybytes_pymesh_config.py b/esp32/frozen/Pybytes/_pybytes_pymesh_config.py index 116f797925..ff12070d1c 100644 --- a/esp32/frozen/Pybytes/_pybytes_pymesh_config.py +++ b/esp32/frozen/Pybytes/_pybytes_pymesh_config.py @@ -45,7 +45,10 @@ def pymesh_init(self): except: from _pymesh import Pymesh - pycom.heartbeat(False) + try: + pycom.heartbeat(False) + except: + pass # read config file, or set default values self.__pymesh_config = PymeshConfig.read_config() @@ -81,7 +84,7 @@ def unpack_pymesh_message(self, signal_number, value): # send data to the port equal with signal_number self.__pymesh.send_mess_external(pyb_ip, signal_number, pkt_start + value) - + time.sleep(3) # shouldn't send too fast to BR # hardcode monitoring data to be sent on signal #2 @@ -93,11 +96,14 @@ def pymesh_new_message_cb(self, rcv_ip, rcv_port, rcv_data): print_debug(99, 'Received: {} '.format(rcv_data)) # user code to be inserted, to send packet to the designated Mesh-external interface - for _ in range(3): - pycom.rgbled(0x888888) - time.sleep(.2) - pycom.rgbled(0) - time.sleep(.1) + try: + for _ in range(3): + pycom.rgbled(0x888888) + time.sleep(.2) + pycom.rgbled(0) + time.sleep(.1) + except: + pass return def pymesh_new_br_message_cb(self, rcv_ip, rcv_port, rcv_data, dest_ip, dest_port): @@ -106,11 +112,13 @@ def pymesh_new_br_message_cb(self, rcv_ip, rcv_port, rcv_data, dest_ip, dest_por print_debug(99, 'Incoming %d bytes from %s (port %d), to external IPv6 %s (port %d)' % (len(rcv_data), rcv_ip, rcv_port, dest_ip, dest_port)) print_debug(99, 'Received: {} '.format(rcv_data)) - for _ in range(2): - pycom.rgbled(0x0) - time.sleep(.1) - pycom.rgbled(0x663300) - + try: + for _ in range(2): + pycom.rgbled(0x0) + time.sleep(.1) + pycom.rgbled(0x663300) + except: + pass # try to find Pybytes Token if include in rcv_data token = "" if rcv_data.startswith(self.__pack_tocken_prefix): diff --git a/esp32/frozen/Pybytes/_terminal.py b/esp32/frozen/Pybytes/_terminal.py index 9906a1ba2d..35f0b82ec8 100644 --- a/esp32/frozen/Pybytes/_terminal.py +++ b/esp32/frozen/Pybytes/_terminal.py @@ -7,13 +7,14 @@ ''' from machine import UART +import os class Terminal: def __init__(self, pybytes_protocol): self.__pybytes_protocol = pybytes_protocol - self.original_terminal = UART(0, 115200) + self.original_terminal = os.dupterm() self.message_from_pybytes = False self.message_to_send = '' @@ -22,10 +23,16 @@ def write(self, data): self.message_to_send += data # self.__pybytes_protocol.__send_terminal_message(data) else: - self.original_terminal.write(data) + try: + self.original_terminal.write(data) + except: + pass def read(self, size): - return self.original_terminal.read(size) + try: + return self.original_terminal.read(size) + except: + return b'' def message_sent_from_pybytes_start(self): self.message_from_pybytes = True diff --git a/esp32/lib/libapp_update.a b/esp32/lib/libapp_update.a index 0f3a9dd51e..c1276796da 100644 Binary files a/esp32/lib/libapp_update.a and b/esp32/lib/libapp_update.a differ diff --git a/esp32/lib/libbootloader_support.a b/esp32/lib/libbootloader_support.a index affb604ccb..1594abbc85 100644 Binary files a/esp32/lib/libbootloader_support.a and b/esp32/lib/libbootloader_support.a differ diff --git a/esp32/lib/libbt.a b/esp32/lib/libbt.a index 902fda77a3..eac7eba7b3 100644 Binary files a/esp32/lib/libbt.a and b/esp32/lib/libbt.a differ diff --git a/esp32/lib/libcoap.a b/esp32/lib/libcoap.a index 39797bca38..7c995cea40 100644 Binary files a/esp32/lib/libcoap.a and b/esp32/lib/libcoap.a differ diff --git a/esp32/lib/libcxx.a b/esp32/lib/libcxx.a index 387b1b4a5c..d29dc54e0b 100644 Binary files a/esp32/lib/libcxx.a and b/esp32/lib/libcxx.a differ diff --git a/esp32/lib/libdriver.a b/esp32/lib/libdriver.a index 44dfd403ec..d4608c3a39 100644 Binary files a/esp32/lib/libdriver.a and b/esp32/lib/libdriver.a differ diff --git a/esp32/lib/libefuse.a b/esp32/lib/libefuse.a index f0fe41c4e8..90fc08d324 100644 Binary files a/esp32/lib/libefuse.a and b/esp32/lib/libefuse.a differ diff --git a/esp32/lib/libesp32.a b/esp32/lib/libesp32.a index 07ff639a61..fd107af180 100644 Binary files a/esp32/lib/libesp32.a and b/esp32/lib/libesp32.a differ diff --git a/esp32/lib/libesp_adc_cal.a b/esp32/lib/libesp_adc_cal.a index 77747b40cc..d3ceede222 100644 Binary files a/esp32/lib/libesp_adc_cal.a and b/esp32/lib/libesp_adc_cal.a differ diff --git a/esp32/lib/libesp_ringbuf.a b/esp32/lib/libesp_ringbuf.a index 1d5648c6d9..77010891aa 100644 Binary files a/esp32/lib/libesp_ringbuf.a and b/esp32/lib/libesp_ringbuf.a differ diff --git a/esp32/lib/libespcoredump.a b/esp32/lib/libespcoredump.a index eb72849eec..9647c581da 100644 Binary files a/esp32/lib/libespcoredump.a and b/esp32/lib/libespcoredump.a differ diff --git a/esp32/lib/libethernet.a b/esp32/lib/libethernet.a index 633f4e4218..e71f92eb61 100644 Binary files a/esp32/lib/libethernet.a and b/esp32/lib/libethernet.a differ diff --git a/esp32/lib/libexpat.a b/esp32/lib/libexpat.a index dc664cc7ad..0b497bb02e 100644 Binary files a/esp32/lib/libexpat.a and b/esp32/lib/libexpat.a differ diff --git a/esp32/lib/libfreertos.a b/esp32/lib/libfreertos.a index 51e7f0c12b..cd9a3aba4b 100644 Binary files a/esp32/lib/libfreertos.a and b/esp32/lib/libfreertos.a differ diff --git a/esp32/lib/libheap.a b/esp32/lib/libheap.a index a7d9818f04..001383c764 100644 Binary files a/esp32/lib/libheap.a and b/esp32/lib/libheap.a differ diff --git a/esp32/lib/libjsmn.a b/esp32/lib/libjsmn.a index 13b6ac144d..68768c2cf0 100644 Binary files a/esp32/lib/libjsmn.a and b/esp32/lib/libjsmn.a differ diff --git a/esp32/lib/libjson.a b/esp32/lib/libjson.a index 823cb2eeda..37188d324e 100644 Binary files a/esp32/lib/libjson.a and b/esp32/lib/libjson.a differ diff --git a/esp32/lib/liblog.a b/esp32/lib/liblog.a index 94e274e03a..29326a63b5 100644 Binary files a/esp32/lib/liblog.a and b/esp32/lib/liblog.a differ diff --git a/esp32/lib/liblwip.a b/esp32/lib/liblwip.a index 42265a43b4..47f7e1f34f 100644 Binary files a/esp32/lib/liblwip.a and b/esp32/lib/liblwip.a differ diff --git a/esp32/lib/libmbedtls.a b/esp32/lib/libmbedtls.a index e025112bd7..3b21051436 100644 Binary files a/esp32/lib/libmbedtls.a and b/esp32/lib/libmbedtls.a differ diff --git a/esp32/lib/libmdns.a b/esp32/lib/libmdns.a index 5eae7b2f52..0a90dd4cd2 100644 Binary files a/esp32/lib/libmdns.a and b/esp32/lib/libmdns.a differ diff --git a/esp32/lib/libmicro-ecc.a b/esp32/lib/libmicro-ecc.a index 01366afe9b..2e025c3806 100644 Binary files a/esp32/lib/libmicro-ecc.a and b/esp32/lib/libmicro-ecc.a differ diff --git a/esp32/lib/libnewlib.a b/esp32/lib/libnewlib.a index 5bfc45b70f..2d38cb67ff 100644 Binary files a/esp32/lib/libnewlib.a and b/esp32/lib/libnewlib.a differ diff --git a/esp32/lib/libnghttp.a b/esp32/lib/libnghttp.a index 71693b85eb..c6f1c210f6 100644 Binary files a/esp32/lib/libnghttp.a and b/esp32/lib/libnghttp.a differ diff --git a/esp32/lib/libnvs_flash.a b/esp32/lib/libnvs_flash.a index 27fecd791e..85d5b40816 100644 Binary files a/esp32/lib/libnvs_flash.a and b/esp32/lib/libnvs_flash.a differ diff --git a/esp32/lib/libopenssl.a b/esp32/lib/libopenssl.a index 4d179e3fca..940b07af9d 100644 Binary files a/esp32/lib/libopenssl.a and b/esp32/lib/libopenssl.a differ diff --git a/esp32/lib/libpthread.a b/esp32/lib/libpthread.a index 3e4296cf41..c03c03d409 100644 Binary files a/esp32/lib/libpthread.a and b/esp32/lib/libpthread.a differ diff --git a/esp32/lib/libsdmmc.a b/esp32/lib/libsdmmc.a index 72f6fa0e63..182f124efb 100644 Binary files a/esp32/lib/libsdmmc.a and b/esp32/lib/libsdmmc.a differ diff --git a/esp32/lib/libsmartconfig_ack.a b/esp32/lib/libsmartconfig_ack.a index 3cdd913d8b..e1741be7dc 100644 Binary files a/esp32/lib/libsmartconfig_ack.a and b/esp32/lib/libsmartconfig_ack.a differ diff --git a/esp32/lib/libsoc.a b/esp32/lib/libsoc.a index f8b9343c08..6aec8764b3 100644 Binary files a/esp32/lib/libsoc.a and b/esp32/lib/libsoc.a differ diff --git a/esp32/lib/libspi_flash.a b/esp32/lib/libspi_flash.a index e4a40ee989..11847b3b8b 100644 Binary files a/esp32/lib/libspi_flash.a and b/esp32/lib/libspi_flash.a differ diff --git a/esp32/lib/libtcpip_adapter.a b/esp32/lib/libtcpip_adapter.a index cc61eeb67b..763f3f2741 100644 Binary files a/esp32/lib/libtcpip_adapter.a and b/esp32/lib/libtcpip_adapter.a differ diff --git a/esp32/lib/libvfs.a b/esp32/lib/libvfs.a index f5031c088f..3e49b40f6f 100644 Binary files a/esp32/lib/libvfs.a and b/esp32/lib/libvfs.a differ diff --git a/esp32/lib/libwpa_supplicant.a b/esp32/lib/libwpa_supplicant.a index 7814027f87..5539f6c461 100644 Binary files a/esp32/lib/libwpa_supplicant.a and b/esp32/lib/libwpa_supplicant.a differ diff --git a/esp32/lib/libxtensa-debug-module.a b/esp32/lib/libxtensa-debug-module.a index 72fe8719b7..74fde6323f 100644 Binary files a/esp32/lib/libxtensa-debug-module.a and b/esp32/lib/libxtensa-debug-module.a differ diff --git a/esp32/lte/lteppp.c b/esp32/lte/lteppp.c index 60b0844436..ad7f70c28b 100644 --- a/esp32/lte/lteppp.c +++ b/esp32/lte/lteppp.c @@ -29,6 +29,7 @@ #include "esp32_mphal.h" #include "lwip/dns.h" #include "modlte.h" +#include "str_utils.h" /****************************************************************************** DEFINE CONSTANTS @@ -60,10 +61,21 @@ static char lteppp_trx_buffer[LTE_UART_BUFFER_SIZE + 1]; #ifdef LTE_DEBUG_BUFF static lte_log_t lteppp_log; #endif +//#define LTEPPP_DEBUG +#ifdef LTEPPP_DEBUG +// #define MSG(fmt, ...) printf("[%u] LTEPPP %s: " fmt, mp_hal_ticks_ms(), __func__, ##__VA_ARGS__) +#define MSG(fmt, ...) do { \ + printf("[%u] LTEPPP %s: " fmt, mp_hal_ticks_ms(), __func__, ##__VA_ARGS__); \ + lteppp_print_states(); \ + } while (0) +#else +#define MSG(fmt, ...) (void)0 +#endif + static char lteppp_queue_buffer[LTE_UART_BUFFER_SIZE]; static uart_dev_t* lteppp_uart_reg; -static QueueHandle_t xCmdQueue; -static QueueHandle_t xRxQueue; +static QueueHandle_t xCmdQueue = NULL; +static QueueHandle_t xRxQueue = NULL; static lte_state_t lteppp_lte_state; static lte_legacy_t lteppp_lte_legacy; static SemaphoreHandle_t xLTESem; @@ -83,7 +95,7 @@ static ltepppconnstatus_t lteppp_connstatus = LTE_PPP_IDLE; static ip_addr_t ltepp_dns_info[2]={0}; -static QueueHandle_t uart0_queue; +static QueueHandle_t uart0_queue = NULL; static bool lte_uart_break_evt = false; @@ -97,12 +109,16 @@ static bool lteppp_send_at_cmd(const char *cmd, uint32_t timeout); static bool lteppp_check_sim_present(void); static void lteppp_status_cb (ppp_pcb *pcb, int err_code, void *ctx); static uint32_t lteppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx); +#ifdef LTEPPP_DEBUG +static void lteppp_print_states(); +#endif /****************************************************************************** DEFINE PUBLIC FUNCTIONS ******************************************************************************/ void connect_lte_uart (void) { + MSG("\n"); // initialize the UART interface uart_config_t config; @@ -116,10 +132,10 @@ void connect_lte_uart (void) { uart_param_config(LTE_UART_ID, &config); // configure the UART pins - pin_config(MICROPY_LTE_TX_PIN, -1, U2TXD_OUT_IDX, GPIO_MODE_OUTPUT, MACHPIN_PULL_NONE, 1); - pin_config(MICROPY_LTE_RX_PIN, U2RXD_IN_IDX, -1, GPIO_MODE_INPUT, MACHPIN_PULL_NONE, 1); - pin_config(MICROPY_LTE_RTS_PIN, -1, U2RTS_OUT_IDX, GPIO_MODE_OUTPUT, MACHPIN_PULL_NONE, 1); - pin_config(MICROPY_LTE_CTS_PIN, U2CTS_IN_IDX, -1, GPIO_MODE_INPUT, MACHPIN_PULL_NONE, 1); + pin_config(MICROPY_LTE_TX_PIN, -1, U2TXD_OUT_IDX, GPIO_MODE_OUTPUT, MACHPIN_PULL_NONE, 1); + pin_config(MICROPY_LTE_RX_PIN, U2RXD_IN_IDX, -1, GPIO_MODE_INPUT, MACHPIN_PULL_NONE, 1); + pin_config(MICROPY_LTE_RTS_PIN, -1, U2RTS_OUT_IDX, GPIO_MODE_OUTPUT, MACHPIN_PULL_NONE, 1); + pin_config(MICROPY_LTE_CTS_PIN, U2CTS_IN_IDX, -1, GPIO_MODE_INPUT, MACHPIN_PULL_NONE, 1); vTaskDelay(5 / portTICK_RATE_MS); @@ -138,10 +154,13 @@ void connect_lte_uart (void) { uart_set_rts(LTE_UART_ID, false); xTaskCreatePinnedToCore(TASK_UART_EVT, "LTE_UART_EVT", 2048 / sizeof(StackType_t), NULL, 12, &xLTEUartEvtTaskHndl, 1); + + MSG("done\n"); } void lteppp_init(void) { + MSG("\n"); if (!xLTETaskHndl) { lteppp_lte_state = E_LTE_INIT; @@ -164,12 +183,14 @@ void lteppp_init(void) { lteppp_log.log = malloc(LTE_LOG_BUFF_SIZE); #endif } + MSG("done\n"); } void lteppp_start (void) { uart_set_hw_flow_ctrl(LTE_UART_ID, UART_HW_FLOWCTRL_CTS_RTS, 64); vTaskDelay(5); } + #ifdef LTE_DEBUG_BUFF char* lteppp_get_log_buff(void) { @@ -189,6 +210,7 @@ char* lteppp_get_log_buff(void) return lteppp_log.log; } #endif + lte_modem_conn_state_t lteppp_modem_state(void) { lte_modem_conn_state_t state; @@ -219,6 +241,7 @@ void lteppp_set_legacy(lte_legacy_t legacy) { } void lteppp_connect (void) { + MSG("\n"); uart_flush(LTE_UART_ID); vTaskDelay(25); pppapi_set_default(lteppp_pcb); @@ -226,12 +249,15 @@ void lteppp_connect (void) { pppapi_set_auth(lteppp_pcb, PPPAUTHTYPE_PAP, "", ""); pppapi_connect(lteppp_pcb, 0); lteppp_connstatus = LTE_PPP_IDLE; + MSG("done\n"); } void lteppp_disconnect(void) { + MSG("\n"); pppapi_close(lteppp_pcb, 0); vTaskDelay(150); lteppp_connstatus = LTE_PPP_IDLE; + MSG("done\n"); } void lteppp_send_at_command (lte_task_cmd_data_t *cmd, lte_task_rsp_data_t *rsp) { @@ -258,7 +284,7 @@ bool lteppp_wait_at_rsp (const char *expected_rsp, uint32_t timeout, bool from_m if (timeout_cnt > 0) { timeout_cnt--; } - } while (timeout_cnt > 0 && 0 == rx_len); + } while ((timeout_cnt > 0 || timeout == 0) && 0 == rx_len); memset(lteppp_trx_buffer, 0, LTE_UART_BUFFER_SIZE); uint16_t len_count = 0; @@ -371,37 +397,40 @@ lte_legacy_t lteppp_get_legacy(void) { } void lteppp_deinit (void) { - + MSG("\n"); uart_set_hw_flow_ctrl(LTE_UART_ID, UART_HW_FLOWCTRL_DISABLE, 0); uart_set_rts(LTE_UART_ID, false); xSemaphoreTake(xLTESem, portMAX_DELAY); lteppp_lte_state = E_LTE_INIT; lteppp_modem_conn_state = E_LTE_MODEM_DISCONNECTED; xSemaphoreGive(xLTESem); + MSG("done\n"); } uint32_t lteppp_ipv4(void) { return lte_ipv4addr; } -bool ltepp_is_ppp_conn_up(void) -{ +bool ltepp_is_ppp_conn_up(void) { + MSG("\n"); return ltepp_ppp_conn_up; } -void lteppp_suspend(void) -{ +void lteppp_suspend(void) { + MSG("\n"); lteppp_connstatus = LTE_PPP_SUSPENDED; } -void lteppp_resume(void) -{ +void lteppp_resume(void) { + MSG("\n"); lteppp_connstatus = LTE_PPP_RESUMED; } + /****************************************************************************** DEFINE PRIVATE FUNCTIONS ******************************************************************************/ static void TASK_LTE (void *pvParameters) { + MSG("\n"); bool sim_present; lte_task_cmd_data_t *lte_task_cmd = (lte_task_cmd_data_t *)lteppp_trx_buffer; lte_task_rsp_data_t *lte_task_rsp = (lte_task_rsp_data_t *)lteppp_trx_buffer; @@ -411,11 +440,12 @@ static void TASK_LTE (void *pvParameters) { connect_lte_uart(); modem_init: - + MSG("modem_init\n"); thread_notification = ulTaskNotifyTake(pdTRUE, portMAX_DELAY); if (thread_notification) { + MSG("notif\n"); xSemaphoreTake(xLTE_modem_Conn_Sem, portMAX_DELAY); xSemaphoreTake(xLTESem, portMAX_DELAY); lteppp_modem_conn_state = E_LTE_MODEM_CONNECTING; @@ -426,6 +456,7 @@ static void TASK_LTE (void *pvParameters) { // exit PPP session if applicable if(lteppp_send_at_cmd("+++", LTE_PPP_BACK_OFF_TIME_MS)) { + MSG("+++\n"); vTaskDelay(LTE_PPP_BACK_OFF_TIME_MS / portTICK_RATE_MS); while(!lteppp_send_at_cmd("AT", LTE_RX_TIMEOUT_MIN_MS)) { @@ -449,6 +480,7 @@ static void TASK_LTE (void *pvParameters) { vTaskDelay(LTE_PPP_BACK_OFF_TIME_MS / portTICK_RATE_MS); if (lteppp_send_at_cmd("+++", LTE_PPP_BACK_OFF_TIME_MS)) { + MSG("+++ after AT\n"); while(!lteppp_send_at_cmd("AT", LTE_RX_TIMEOUT_MIN_MS)) { if (at_trials >= LTE_AT_CMD_TRIALS) { @@ -488,7 +520,8 @@ static void TASK_LTE (void *pvParameters) { lteppp_send_at_cmd("ATE0", LTE_RX_TIMEOUT_MIN_MS); // disable PSM if enabled by default lteppp_send_at_cmd("AT+CPSMS=0", LTE_RX_TIMEOUT_MIN_MS); - + // set registration URC to 1, ie for status changes + lteppp_send_at_cmd("AT+CEREG=1", LTE_RX_TIMEOUT_MIN_MS); // at least enable access to the SIM lteppp_send_at_cmd("AT+CFUN?", LTE_RX_TIMEOUT_MAX_MS); char *pos = strstr(lteppp_trx_buffer, "+CFUN: "); @@ -518,6 +551,7 @@ static void TASK_LTE (void *pvParameters) { lteppp_modem_conn_state = E_LTE_MODEM_CONNECTED; xSemaphoreGive(xLTESem); xSemaphoreGive(xLTE_modem_Conn_Sem); + MSG("forever\n"); lte_state_t state; for (;;) { vTaskDelay(LTE_TASK_PERIOD_MS); @@ -531,16 +565,17 @@ static void TASK_LTE (void *pvParameters) { xSemaphoreGive(xLTESem); state = lteppp_get_state(); if (xQueueReceive(xCmdQueue, lteppp_trx_buffer, 0)) { + MSG("cmd\n"); bool expect_continuation = lte_task_cmd->expect_continuation; lteppp_send_at_cmd_exp(lte_task_cmd->data, lte_task_cmd->timeout, NULL, &(lte_task_rsp->data_remaining), lte_task_cmd->dataLen, lte_task_cmd->expect_continuation); if(!expect_continuation) xQueueSend(xRxQueue, (void *)lte_task_rsp, (TickType_t)portMAX_DELAY); } - else if(state == E_LTE_PPP && lte_uart_break_evt) - { - lteppp_send_at_cmd("+++", LTE_PPP_BACK_OFF_TIME_MS); - lteppp_suspend(); - } + //else if(state == E_LTE_PPP && lte_uart_break_evt) + //{ + // lteppp_send_at_cmd("+++", LTE_PPP_BACK_OFF_TIME_MS); + // lteppp_suspend(); + //} else { if (state == E_LTE_PPP) { @@ -548,15 +583,19 @@ static void TASK_LTE (void *pvParameters) { // check for IP connection if(lteppp_ipv4() > 0) { + if ( ! ltepp_ppp_conn_up) + MSG("set ltepp_ppp_conn_up\n"); ltepp_ppp_conn_up = true; } else { + MSG("else, ppp, no ipv4\n"); if(ltepp_ppp_conn_up == true) { ltepp_ppp_conn_up = false; lteppp_set_state(E_LTE_ATTACHED); } + MSG("else, ppp, no ipv4 done\n"); } // wait for characters received uart_get_buffered_data_len(LTE_UART_ID, &rx_len); @@ -571,6 +610,9 @@ static void TASK_LTE (void *pvParameters) { } else { + if ( ltepp_ppp_conn_up) + MSG("set ltepp_ppp_conn_up to false\n"); + ltepp_ppp_conn_up = false; } } @@ -579,39 +621,46 @@ static void TASK_LTE (void *pvParameters) { goto modem_init; } -static void TASK_UART_EVT (void *pvParameters) -{ +static void TASK_UART_EVT (void *pvParameters) { uart_event_t event; - uint8_t buff[50] = {0}; + //uint8_t buff[50] = {0}; for(;;) { //Waiting for UART event. if(xQueueReceive(uart0_queue, (void * )&event, (portTickType)portMAX_DELAY)) { - switch(event.type) - { + switch(event.type) { case UART_DATA: - if (lte_uart_break_evt) { - - uint32_t rx_len = uart_read_bytes(LTE_UART_ID, buff, LTE_UART_BUFFER_SIZE, - LTE_TRX_WAIT_MS(LTE_UART_BUFFER_SIZE) / portTICK_RATE_MS); - - if ((rx_len) && (strstr((const char *)buff, "OK") != NULL)) - { - if(strstr((const char *)buff, "+CEREG: 4") != NULL) - { - modlte_urc_events(LTE_EVENT_COVERAGE_LOST); - } - - lte_uart_break_evt = false; - } - } + // if (lte_uart_break_evt) { + + // uint32_t rx_len = uart_read_bytes(LTE_UART_ID, buff, LTE_UART_BUFFER_SIZE, + // LTE_TRX_WAIT_MS(LTE_UART_BUFFER_SIZE) / portTICK_RATE_MS); + + // MSG("uart_data evt + break (%u)\n", rx_len); + // hexdump(buff, rx_len); + // if ((rx_len) && (strstr((const char *)buff, "OK") != NULL)) { + // MSG("OK\n"); + // if(strstr((const char *)buff, "+CEREG: 4") != NULL) { + // MSG("CEREG 4, trigger callback\n"); + // modlte_urc_events(LTE_EVENT_COVERAGE_LOST); + // } + // lte_uart_break_evt = false; + // MSG("break=false\n"); + // } + // } break; case UART_BREAK: + // MSG("LTE_UART: uart_break evt, ppp=%u (4=ppp)\n", lteppp_get_state()); if (E_LTE_PPP == lteppp_get_state()) { lte_uart_break_evt = true; + MSG("uart_break evt and ppp, so break=true\n"); + modlte_urc_events(LTE_EVENT_BREAK); + } else { + // this should not happen, because the sequans modem only issues a break event when in ppp + MSG("uart_break evt, but no ppp, so do nothing\n"); } break; default: + MSG("evt %u %u\n", event.type, event.size); break; } } @@ -739,8 +788,8 @@ static void lteppp_status_cb (ppp_pcb *pcb, int err_code, void *ctx) { switch (err_code) { case PPPERR_NONE: -// printf("status_cb: Connected\n"); - #if PPP_IPV4_SUPPORT + MSG("Connected\n"); +#if PPP_IPV4_SUPPORT lte_gw = pppif->gw.u_addr.ip4.addr; lte_netmask = pppif->netmask.u_addr.ip4.addr; lte_ipv4addr = pppif->ip_addr.u_addr.ip4.addr; @@ -749,59 +798,168 @@ static void lteppp_status_cb (ppp_pcb *pcb, int err_code, void *ctx) { ltepp_dns_info[0] = dns_getserver(0); ltepp_dns_info[1] = dns_getserver(1); } -// printf("ipaddr = %s\n", ipaddr_ntoa(&pppif->ip_addr)); -// printf("gateway = %s\n", ipaddr_ntoa(&pppif->gw)); -// printf("netmask = %s\n", ipaddr_ntoa(&pppif->netmask)); - #endif - #if PPP_IPV6_SUPPORT + MSG("ipaddr = %s\n", ipaddr_ntoa(&pppif->ip_addr)); + MSG("gateway = %s\n", ipaddr_ntoa(&pppif->gw)); + MSG("netmask = %s\n", ipaddr_ntoa(&pppif->netmask)); +#endif +#if PPP_IPV6_SUPPORT memcpy(lte_ipv6addr.addr, netif_ip6_addr(pppif, 0), sizeof(lte_ipv4addr)); -// printf("ip6addr = %s\n", ip6addr_ntoa(netif_ip6_addr(pppif, 0))); - #endif + MSG("ip6addr = %s\n", ip6addr_ntoa(netif_ip6_addr(pppif, 0))); +#endif break; case PPPERR_PARAM: -// printf("status_cb: Invalid parameter\n"); + MSG("Invalid parameter\n"); break; case PPPERR_OPEN: -// printf("status_cb: Unable to open PPP session\n"); + MSG("Unable to open PPP session\n"); break; case PPPERR_DEVICE: -// printf("status_cb: Invalid I/O device for PPP\n"); + MSG("Invalid I/O device for PPP\n"); break; case PPPERR_ALLOC: -// printf("status_cb: Unable to allocate resources\n"); + MSG("Unable to allocate resources\n"); break; case PPPERR_USER: -// printf("status_cb: User interrupt (disconnected)\n"); + MSG("User interrupt (disconnected)\n"); lte_ipv4addr = 0; memset(lte_ipv6addr.addr, 0, sizeof(lte_ipv4addr)); break; case PPPERR_CONNECT: -// printf("status_cb: Connection lost\n"); + MSG("\n\n\nConnection lost\n"); lte_ipv4addr = 0; memset(lte_ipv6addr.addr, 0, sizeof(lte_ipv4addr)); break; case PPPERR_AUTHFAIL: -// printf("status_cb: Failed authentication challenge\n"); + MSG("Failed authentication challenge\n"); break; case PPPERR_PROTOCOL: -// printf("status_cb: Failed to meet protocol\n"); + MSG("Failed to meet protocol\n"); break; case PPPERR_PEERDEAD: -// printf("status_cb: Connection timeout\n"); + MSG("Connection timeout\n"); break; case PPPERR_IDLETIMEOUT: -// printf("status_cb: Idle Timeout\n"); + MSG("Idle Timeout\n"); break; case PPPERR_CONNECTTIME: -// printf("status_cb: Max connect time reached\n"); + MSG("Max connect time reached\n"); break; case PPPERR_LOOPBACK: -// printf("status_cb: Loopback detected\n"); + MSG("Loopback detected\n"); break; default: -// printf("status_cb: Unknown error code %d\n", err_code); + MSG("Unknown error code %d\n", err_code); lte_ipv4addr = 0; memset(lte_ipv6addr.addr, 0, sizeof(lte_ipv4addr)); break; } } + +#ifdef LTEPPP_DEBUG +static void lteppp_print_states(){ + if (!xLTESem) + return; + static lte_modem_conn_state_t last_c = 0xff; + lte_modem_conn_state_t c = lteppp_modem_state(); + static lte_state_t last_s = 0xff; + lte_state_t s = lteppp_get_state(); + static bool last_u = false; + bool u = ltepp_ppp_conn_up; + static ltepppconnstatus_t last_C = 0xff; + ltepppconnstatus_t C = lteppp_connstatus; + static bool last_b = false; + bool b = lte_uart_break_evt; + static size_t last_cmd = 0; + size_t cmd = 0; + if (xCmdQueue) + cmd = uxQueueMessagesWaiting(xCmdQueue); + static size_t last_rx = 0; + size_t rx = 0; + if (xRxQueue) + rx = uxQueueMessagesWaiting(xRxQueue); + static size_t last_uart = 0; + size_t uart = 0; + if (uart0_queue) + uart = uxQueueMessagesWaiting(uart0_queue); + + + if ( last_c != c + || last_s != s + || last_u != u + || last_C != C + || last_b != b + || last_cmd != cmd + || last_rx != rx + || last_uart != uart + ) { + + + printf("c=%u", c); // lteppp_modem_conn_state + switch(c){ + case E_LTE_MODEM_CONNECTED: + printf("=CTED "); + break; + case E_LTE_MODEM_CONNECTING: + printf("=CING "); + break; + case E_LTE_MODEM_DISCONNECTED: + printf("=DISC "); + break; + } + + printf("s=%u", s); // lteppp_lte_state + switch (s){ + case E_LTE_INIT: + printf("=INIT "); + break; + case E_LTE_IDLE: + printf("=IDLE "); + break; + case E_LTE_ATTACHING: + printf("=AING "); + break; + case E_LTE_ATTACHED: + printf("=ATTA "); + break; + case E_LTE_PPP: + printf("=PPP "); + break; + case E_LTE_SUSPENDED: + printf("=SUSP "); + } + + printf("u=%u ", u); + + printf("C=%u", C); + switch(C){ + case LTE_PPP_IDLE: + printf("=IDLE "); + break; + case LTE_PPP_RESUMED: + printf("=RESU "); + break; + case LTE_PPP_SUSPENDED: + printf("=SUSP "); + break; + } + printf("b=%u ", b); + + if (xCmdQueue) + printf("cmd[%u] ", uxQueueMessagesWaiting(xCmdQueue)); + if (xRxQueue) + printf("rx[%u] ", uxQueueMessagesWaiting(xRxQueue)); + if (uart0_queue) + printf("u0[%u] ", uxQueueMessagesWaiting(uart0_queue)); + printf("\n"); + + last_c = c; + last_s = s; + last_u = u; + last_C = C; + last_b = b; + last_cmd = cmd; + last_rx = rx; + last_uart = uart; + } +} +#endif diff --git a/esp32/lte/lteppp.h b/esp32/lte/lteppp.h index c8e608dee3..8ca52c5d7b 100644 --- a/esp32/lte/lteppp.h +++ b/esp32/lte/lteppp.h @@ -63,6 +63,7 @@ typedef enum { E_LTE_MODEM_CONNECTING, E_LTE_MODEM_DISCONNECTED } lte_modem_conn_state_t; + #ifdef LTE_DEBUG_BUFF typedef struct { char* log; @@ -70,12 +71,14 @@ typedef struct { bool truncated; } lte_log_t; #endif + typedef struct { uint32_t timeout; char data[LTE_AT_CMD_DATA_SIZE_MAX]; size_t dataLen; bool expect_continuation; } lte_task_cmd_data_t; + #pragma pack(1) typedef struct { char data[LTE_UART_BUFFER_SIZE]; @@ -127,6 +130,7 @@ extern void lteppp_suspend(void); extern void lteppp_resume(void); extern void lteppp_set_default_inf(void); + #ifdef LTE_DEBUG_BUFF extern char* lteppp_get_log_buff(void); #endif diff --git a/esp32/mods/modbt.c b/esp32/mods/modbt.c index a800f80c35..99a79a6570 100644 --- a/esp32/mods/modbt.c +++ b/esp32/mods/modbt.c @@ -113,6 +113,7 @@ typedef struct { int32_t conn_id; uint16_t mtu; esp_gatt_if_t gatt_if; + esp_ble_addr_type_t addr_type; } bt_connection_obj_t; typedef struct { @@ -265,7 +266,6 @@ static esp_ble_adv_params_t bt_adv_params = { static bool mod_bt_allow_resume_deinit; static uint16_t mod_bt_gatts_mtu_restore = 0; -static bool mod_bt_is_conn_restore_available; static nvs_handle modbt_nvs_handle; static uint8_t tx_pwr_level_to_dbm[] = {-12, -9, -6, -3, 0, 3, 6, 9}; @@ -285,7 +285,7 @@ STATIC void gattc_char_callback_handler(void *arg); STATIC void gatts_char_callback_handler(void *arg); static mp_obj_t modbt_start_scan(mp_obj_t timeout); static mp_obj_t modbt_conn_disconnect(mp_obj_t self_in); -static mp_obj_t modbt_connect(mp_obj_t addr); +static mp_obj_t modbt_connect(mp_obj_t addr, esp_ble_addr_type_t addr_type); /****************************************************************************** DEFINE PUBLIC FUNCTIONS @@ -324,7 +324,6 @@ void modbt_init0(void) { esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT); mod_bt_allow_resume_deinit = false; - mod_bt_is_conn_restore_available = false; } void modbt_deinit(bool allow_reconnect) @@ -363,11 +362,14 @@ void modbt_deinit(bool allow_reconnect) xEventGroupWaitBits(bt_event_group, MOD_BT_GATTS_DISCONN_EVT | MOD_BT_GATTS_CLOSE_EVT, true, true, 1000/portTICK_PERIOD_MS); } + esp_ble_gattc_app_unregister(MOD_BT_CLIENT_APP_ID); + esp_ble_gatts_app_unregister(MOD_BT_SERVER_APP_ID); + esp_bluedroid_disable(); esp_bluedroid_deinit(); esp_bt_controller_disable(); + esp_bt_controller_deinit(); bt_obj.init = false; - mod_bt_is_conn_restore_available = false; xEventGroupClearBits(bt_event_group, MOD_BT_GATTC_MTU_EVT | MOD_BT_GATTS_MTU_EVT | MOD_BT_GATTS_DISCONN_EVT | MOD_BT_GATTS_CLOSE_EVT); } } @@ -388,39 +390,52 @@ void bt_resume(bool reconnect) nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Bluetooth enable failed")); } + esp_ble_gap_register_callback(gap_events_handler); + esp_ble_gattc_register_callback(gattc_events_handler); + esp_ble_gatts_register_callback(gatts_event_handler); + esp_ble_gattc_app_register(MOD_BT_CLIENT_APP_ID); esp_ble_gatts_app_register(MOD_BT_SERVER_APP_ID); esp_ble_gatt_set_local_mtu(mod_bt_gatts_mtu_restore); - bt_connection_obj_t *connection_obj = NULL; - - if(MP_STATE_PORT(btc_conn_list).len > 0) + // If this list has 0 elements it means there were no active connections + if(MP_STATE_PORT(btc_conn_list).len > 0 && reconnect) { - /* Get the Last gattc connection obj before sleep */ - connection_obj = ((bt_connection_obj_t *)(MP_STATE_PORT(btc_conn_list).items[MP_STATE_PORT(btc_conn_list).len - 1])); - } + /* Enable Scan */ + modbt_start_scan(MP_OBJ_NEW_SMALL_INT(-1)); + mp_hal_delay_ms(50); + while(!bt_obj.scanning){ + /* Wait for scanning to start */ + } - if (reconnect) - { - /* Check if there was a gattc connection Active before sleep */ - if (connection_obj != NULL) { - if (connection_obj->conn_id >= 0) { - /* Enable Scan */ - modbt_start_scan(MP_OBJ_NEW_SMALL_INT(-1)); - mp_hal_delay_ms(50); - while(!bt_obj.scanning){ - /* Wait for scanning to start */ - } - /* re-connect to Last Connection */ - mp_obj_list_remove((void *)&MP_STATE_PORT(btc_conn_list), connection_obj); - mp_obj_list_append((void *)&MP_STATE_PORT(btc_conn_list), modbt_connect(mp_obj_new_bytes((const byte *)connection_obj->srv_bda, 6))); + /* Re-connect to all previously existing connections */ + // Need to save the old connections into a temporary list because during connect the original list is manipulated (items added) + mp_obj_list_t btc_conn_list_tmp; + mp_obj_list_init(&btc_conn_list_tmp, 0); + for (mp_uint_t i = 0; i < MP_STATE_PORT(btc_conn_list).len; i++) { + bt_connection_obj_t *connection_obj = ((bt_connection_obj_t *)(MP_STATE_PORT(btc_conn_list).items[i])); + mp_obj_list_append(&btc_conn_list_tmp, connection_obj); + } - mod_bt_is_conn_restore_available = true; + // Connect to the old connections + for (mp_uint_t i = 0; i < btc_conn_list_tmp.len; i++) { + bt_connection_obj_t *connection_obj = ((bt_connection_obj_t *)(btc_conn_list_tmp.items[i])); + // Initiates re-connection + bt_connection_obj_t *new_connection_obj = modbt_connect(mp_obj_new_bytes((const byte *)connection_obj->srv_bda, 6), connection_obj->addr_type); + // If new connection object has been created then overwrite the original one so from the MicroPython code the same reference can be used + if(new_connection_obj != mp_const_none) { + memcpy(connection_obj, new_connection_obj, sizeof(bt_connection_obj_t)); + // As modbt_connect appends the new connection to the original list, it needs to be removed because it is not needed + mp_obj_list_remove((void *)&MP_STATE_PORT(btc_conn_list), new_connection_obj); + } + else { + // Remove the old connection from the original list because connection could not be established with it + mp_obj_list_remove((void *)&MP_STATE_PORT(btc_conn_list), connection_obj); } } - /* See if there was an averstisment active before Sleep */ + /* See if there was an advertisement active before Sleep */ if(bt_obj.advertising) { esp_ble_gap_start_advertising(&bt_adv_params); } @@ -463,19 +478,19 @@ static void create_hash(uint32_t pin, uint8_t *h_value) { bt_hash_obj_t pin_hash; mbedtls_sha1_context sha1_context; - + mbedtls_sha1_init(&sha1_context); mbedtls_sha1_starts_ret(&sha1_context); - + pin_hash.pin = pin; mbedtls_sha1_update_ret(&sha1_context, pin_hash.value, 4); - + mbedtls_sha1_finish_ret(&sha1_context, h_value); mbedtls_sha1_free(&sha1_context); } -static bool pin_changed(uint32_t new_pin) -{ +static bool pin_changed(uint32_t new_pin) +{ bool ret = false; uint32_t h_size = MOD_BT_HASH_SIZE; uint8_t h_stored[MOD_BT_HASH_SIZE] = {0}; @@ -487,9 +502,9 @@ static bool pin_changed(uint32_t new_pin) mp_printf(&mp_plat_print, "Error opening secure BLE NVS namespace!\n"); } nvs_get_blob(modbt_nvs_handle, key, h_stored, &h_size); - + create_hash(new_pin, h_created); - + if (memcmp(h_stored, h_created, MOD_BT_HASH_SIZE) != 0) { esp_err = nvs_set_blob(modbt_nvs_handle, key, h_created, h_size); if (esp_err == ESP_OK) { @@ -497,7 +512,7 @@ static bool pin_changed(uint32_t new_pin) ret = true; } } - + nvs_close(modbt_nvs_handle); return ret; @@ -554,8 +569,7 @@ static void set_pin(uint32_t new_pin) static void close_connection (int32_t conn_id) { for (mp_uint_t i = 0; i < MP_STATE_PORT(btc_conn_list).len; i++) { bt_connection_obj_t *connection_obj = ((bt_connection_obj_t *)(MP_STATE_PORT(btc_conn_list).items[i])); - /* Only reset Conn Id if it is a normal disconnect not module de-init to mark conn obj to be restored */ - if (connection_obj->conn_id == conn_id && (!mod_bt_allow_resume_deinit)) { + if (connection_obj->conn_id == conn_id) { connection_obj->conn_id = -1; mp_obj_list_remove((void *)&MP_STATE_PORT(btc_conn_list), connection_obj); } @@ -1402,13 +1416,19 @@ STATIC mp_obj_t bt_events(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bt_events_obj, bt_events); -static mp_obj_t bt_connect_helper(mp_obj_t addr, TickType_t timeout){ +static mp_obj_t bt_connect_helper(mp_obj_t addr, TickType_t timeout, esp_ble_addr_type_t addr_type){ bt_event_result_t bt_event; EventBits_t uxBits; if (bt_obj.busy) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "operation already in progress")); + // Only drop exception if not called from bt_resume() API, otherwise return with mp_const_none on error + if(mod_bt_allow_resume_deinit == false) { + nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "operation already in progress")); + } + else { + return mp_const_none; + } } if (bt_obj.scanning) { @@ -1424,16 +1444,29 @@ static mp_obj_t bt_connect_helper(mp_obj_t addr, TickType_t timeout){ bt_obj.busy = true; /* Initiate a background connection, esp_ble_gattc_open returns immediately */ - if (ESP_OK != esp_ble_gattc_open(bt_obj.gattc_if, bufinfo.buf, BLE_ADDR_TYPE_PUBLIC, true)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed)); + if (ESP_OK != esp_ble_gattc_open(bt_obj.gattc_if, bufinfo.buf, addr_type, true)) { + // Only drop exception if not called from bt_resume() API, otherwise return with mp_const_none on error + if(mod_bt_allow_resume_deinit == false) { + nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed)); + } + else { + return mp_const_none; + } } + MP_THREAD_GIL_EXIT(); if (xQueueReceive(xScanQueue, &bt_event, timeout) == pdTRUE) { MP_THREAD_GIL_ENTER(); if (bt_event.connection.conn_id < 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "connection refused")); + // Only drop exception if not called from bt_resume() API, otherwise return with mp_const_none on error + if(mod_bt_allow_resume_deinit == false) { + nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "connection refused")); + } + else { + return mp_const_none; + } } // setup the object @@ -1441,6 +1474,7 @@ static mp_obj_t bt_connect_helper(mp_obj_t addr, TickType_t timeout){ conn->base.type = (mp_obj_t)&mod_bt_connection_type; conn->conn_id = bt_event.connection.conn_id; conn->gatt_if = bt_event.connection.gatt_if; + conn->addr_type = addr_type; MP_THREAD_GIL_EXIT(); uxBits = xEventGroupWaitBits(bt_event_group, MOD_BT_GATTC_MTU_EVT, true, true, 1000/portTICK_PERIOD_MS); @@ -1452,6 +1486,7 @@ static mp_obj_t bt_connect_helper(mp_obj_t addr, TickType_t timeout){ } memcpy(conn->srv_bda, bt_event.connection.srv_bda, 6); mp_obj_list_append((void *)&MP_STATE_PORT(btc_conn_list), conn); + return conn; } else @@ -1459,7 +1494,14 @@ static mp_obj_t bt_connect_helper(mp_obj_t addr, TickType_t timeout){ MP_THREAD_GIL_ENTER(); (void)esp_ble_gap_disconnect(bufinfo.buf); - nlr_raise(mp_obj_new_exception_msg(&mp_type_TimeoutError, "timed out")); + + // Only drop exception if not called from bt_resume() API, otherwise return with mp_const_none on error + if(mod_bt_allow_resume_deinit == false) { + nlr_raise(mp_obj_new_exception_msg(&mp_type_TimeoutError, "timed out")); + } + else { + return mp_const_none; + } } return mp_const_none; } @@ -1470,6 +1512,7 @@ STATIC mp_obj_t bt_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t STATIC const mp_arg_t allowed_args[] = { { MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_OBJ, }, { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_addr_type, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL}}, }; // parse arguments @@ -1478,7 +1521,7 @@ STATIC mp_obj_t bt_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t mp_obj_t addr = args[0].u_obj; - /* Timeout parameter is in miliseconds */ + /* Timeout parameter is in milliseconds */ TickType_t timeout; if(args[1].u_obj == MP_OBJ_NULL){ timeout = portMAX_DELAY; @@ -1494,13 +1537,30 @@ STATIC mp_obj_t bt_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t } } - return bt_connect_helper(addr, timeout); + /* addr_type parameter */ + uint32_t addr_type; + if(args[2].u_obj == MP_OBJ_NULL){ + addr_type = BLE_ADDR_TYPE_PUBLIC; + } + else + { + if(MP_OBJ_IS_SMALL_INT(args[2].u_obj) == true) { + addr_type = mp_obj_get_int(args[2].u_obj); + } + else + { + nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "If addr_type is specified it must be a valid integer number")); + } + } + + + return bt_connect_helper(addr, timeout, addr_type); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bt_connect_obj, 1, bt_connect); -static mp_obj_t modbt_connect(mp_obj_t addr) +static mp_obj_t modbt_connect(mp_obj_t addr, esp_ble_addr_type_t addr_type) { - return bt_connect_helper(addr, portMAX_DELAY); + return bt_connect_helper(addr, portMAX_DELAY, addr_type); } @@ -1513,7 +1573,7 @@ STATIC mp_obj_t bt_set_advertisement_params (mp_uint_t n_args, const mp_obj_t *p { MP_QSTR_channel_map, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_adv_filter_policy, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, }; - + // parse args mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(args), allowed_args, args); @@ -1666,14 +1726,14 @@ STATIC mp_obj_t bt_set_advertisement_raw(mp_obj_t self_in, mp_obj_t raw_data) { memcpy(data, (uint8_t *)bufinfo.buf, sizeof(data)); data_len = sizeof(data); } - + esp_ble_gap_config_adv_data_raw(data, data_len); - + // wait for the advertisement data to be configured bt_gatts_event_result_t gatts_event; xQueueReceive(xGattsQueue, &gatts_event, portMAX_DELAY); } - + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bt_set_advertisement_raw_obj, bt_set_advertisement_raw); @@ -2272,8 +2332,9 @@ STATIC mp_obj_t bt_conn_disconnect(mp_obj_t self_in) { if (self->conn_id >= 0) { esp_ble_gattc_close(bt_obj.gattc_if, self->conn_id); esp_ble_gap_disconnect(self->srv_bda); - /* Only reset Conn Id if it is a normal disconnect not module de-init to mark conn obj to be restored */ - if(!mod_bt_allow_resume_deinit) + /* Only reset Conn Id if it is needed that the connection should be established again after wakeup + * otherwise this connection will be completely removed in close_connection() call triggered by ESP_GATTC_DISCONNECT_EVT event */ + if(mod_bt_allow_resume_deinit) { self->conn_id = -1; } diff --git a/esp32/mods/modlte.c b/esp32/mods/modlte.c index bff3751127..1372c679c8 100644 --- a/esp32/mods/modlte.c +++ b/esp32/mods/modlte.c @@ -105,7 +105,7 @@ /****************************************************************************** DECLARE PRIVATE DATA ******************************************************************************/ -static lte_obj_t lte_obj = {.init = false, .trigger = LTE_TRIGGER_NONE, .events = 0, .handler = NULL, .handler_arg = NULL}; +static lte_obj_t lte_obj = {.init = false, .trigger = LTE_EVENT_NONE, .events = 0, .handler = NULL, .handler_arg = NULL}; static lte_task_rsp_data_t modlte_rsp; uart_dev_t* uart_driver_0 = &UART0; uart_dev_t* uart_driver_lte = &UART2; @@ -151,6 +151,10 @@ STATIC mp_obj_t lte_deinit(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t STATIC mp_obj_t lte_disconnect(mp_obj_t self_in); static void lte_set_default_inf(void); static void lte_callback_handler(void* arg); + +//#define MSG(fmt, ...) printf("[%u] modlte: " fmt, mp_hal_ticks_ms(), ##__VA_ARGS__) +#define MSG(fmt, ...) (void)0 + /****************************************************************************** DEFINE PUBLIC FUNCTIONS ******************************************************************************/ @@ -167,18 +171,22 @@ void modlte_start_modem(void) void modlte_urc_events(lte_events_t events) { - switch(events) + // set the events to report to the user, the clearing is done upon reading via lte_events() + if ( (events & LTE_EVENT_COVERAGE_LOST) + && (lte_obj.trigger & LTE_EVENT_COVERAGE_LOST) ) { - case LTE_EVENT_COVERAGE_LOST: - if ((lte_obj.trigger & LTE_TRIGGER_SIG_LOST)) { - lte_obj.events |= (uint32_t)LTE_TRIGGER_SIG_LOST; - } - mp_irq_queue_interrupt(lte_callback_handler, <e_obj); - break; - default: - break; + lte_obj.events |= (uint32_t)LTE_EVENT_COVERAGE_LOST; + } + if ( (events & LTE_EVENT_BREAK) + && (lte_obj.trigger & LTE_EVENT_BREAK) ) + { + lte_obj.events |= (uint32_t)LTE_EVENT_BREAK; } + + //MSG("urc(%u) l.trig=%u l.eve=%d\n", events, lte_obj.trigger, lte_obj.events); + mp_irq_queue_interrupt(lte_callback_handler, <e_obj); } + //***************************************************************************** // DEFINE STATIC FUNCTIONS //***************************************************************************** @@ -188,9 +196,12 @@ static void lte_callback_handler(void* arg) lte_obj_t *self = arg; if (self->handler && self->handler != mp_const_none) { - + //MSG("call callback(handler=%p, arg=%p)\n", self->handler_arg, self->handler); mp_call_function_1(self->handler, self->handler_arg); + }else{ + //MSG("no callback\n"); } + } static bool lte_push_at_command_ext_cont (char *cmd_str, uint32_t timeout, const char *expected_rsp, size_t len, bool continuation) @@ -232,7 +243,7 @@ static void lte_pause_ppp(void) { if (!lte_push_at_command("AT", LTE_RX_TIMEOUT_MIN_MS)) { mp_hal_delay_ms(LTE_PPP_BACK_OFF_TIME_MS); if (!lte_push_at_command("AT", LTE_RX_TIMEOUT_MIN_MS)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed)); + nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Pause PPP failed")); } } } @@ -269,15 +280,15 @@ static bool lte_check_attached(bool legacy) { mp_hal_delay_ms(LTE_RX_TIMEOUT_MIN_MS); lte_push_at_command("AT+CEREG?", LTE_RX_TIMEOUT_MIN_MS); } - if (((pos = strstr(modlte_rsp.data, "+CEREG: 2,1,")) || (pos = strstr(modlte_rsp.data, "+CEREG: 2,5,"))) + if (((pos = strstr(modlte_rsp.data, "+CEREG: 1,1")) || (pos = strstr(modlte_rsp.data, "+CEREG: 1,5"))) && (strlen(pos) >= 31) && (pos[30] == '7' || pos[30] == '9')) { attached = true; } } else { - if ((pos = strstr(modlte_rsp.data, "+CEREG: 2,1,")) || (pos = strstr(modlte_rsp.data, "+CEREG: 2,5,"))) { + if ((pos = strstr(modlte_rsp.data, "+CEREG: 1,1")) || (pos = strstr(modlte_rsp.data, "+CEREG: 1,5"))) { attached = true; } else { - if((pos = strstr(modlte_rsp.data, "+CEREG: 2,4"))) + if((pos = strstr(modlte_rsp.data, "+CEREG: 1,4"))) { lte_ue_is_out_of_coverage = true; } @@ -860,6 +871,11 @@ STATIC mp_obj_t lte_attach(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t lte_check_attached(lte_legacyattach_flag); if (lteppp_get_state() < E_LTE_ATTACHING) { + + if ( ! lte_check_sim_present() ) { + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_RuntimeError, "Sim card not present")); + } + const char *carrier = "standard"; if (!lte_push_at_command("AT+SQNCTM?", LTE_RX_TIMEOUT_MAX_MS)) { if (!lte_push_at_command("AT+SQNCTM?", LTE_RX_TIMEOUT_MAX_MS)) { @@ -913,13 +929,13 @@ STATIC mp_obj_t lte_attach(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t } else { + // argument 'band' if (args[0].u_obj != mp_const_none) { - // argument 'band' lte_add_band(mp_obj_get_int(args[0].u_obj), is_hw_new_band_support, is_sw_new_band_support, version); } + // argument 'bands' if (args[6].u_obj != mp_const_none){ - // argument 'bands' mp_obj_t *bands; size_t n_bands=0; mp_obj_get_array(args[6].u_obj, &n_bands, &bands); @@ -933,12 +949,14 @@ STATIC mp_obj_t lte_attach(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t } else { lte_obj.carrier = true; } + + // argument 'cid' if (args[3].u_obj != mp_const_none) { lte_obj.cid = args[3].u_int; } + // argument 'apn' if (args[1].u_obj != mp_const_none || args[4].u_obj != mp_const_none) { - const char* strapn; const char* strtype; @@ -964,11 +982,14 @@ STATIC mp_obj_t lte_attach(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed)); } } + + // argument 'log' if (args[2].u_obj == mp_const_false) { lte_push_at_command("AT!=\"disablelog 1\"", LTE_RX_TIMEOUT_MAX_MS); } else { lte_push_at_command("AT!=\"disablelog 0\"", LTE_RX_TIMEOUT_MAX_MS); } + lteppp_set_state(E_LTE_ATTACHING); if (!lte_push_at_command("AT+CFUN=1", LTE_RX_TIMEOUT_MAX_MS)) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed)); @@ -1054,15 +1075,15 @@ STATIC mp_obj_t lte_suspend(mp_obj_t self_in) { lte_check_init(); if (lteppp_get_state() == E_LTE_PPP) { lteppp_suspend(); - //printf("Pausing ppp...\n"); + MSG("Pausing ppp...\n"); lte_pause_ppp(); - //printf("Pausing ppp done...\n"); + MSG("Pausing ppp done...\n"); lteppp_set_state(E_LTE_SUSPENDED); while (true) { mp_hal_delay_ms(LTE_RX_TIMEOUT_MIN_MS); - //printf("Sending AT...\n"); + MSG("Sending AT...\n"); if (lte_push_at_command("AT", LTE_RX_TIMEOUT_MAX_MS)) { - //printf("OK\n"); + MSG("OK\n"); break; } } @@ -1153,13 +1174,13 @@ STATIC mp_obj_t lte_resume(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); if (lteppp_get_state() == E_LTE_PPP) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_request_not_possible)); + nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Modem is already connected")); } lte_check_attached(lte_legacyattach_flag); if (lteppp_get_state() == E_LTE_SUSPENDED || lteppp_get_state() == E_LTE_ATTACHED) { if (lteppp_get_state() == E_LTE_ATTACHED && lteppp_get_legacy() == E_LTE_LEGACY) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_request_not_possible)); + nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Operation failed (attached and legacy)")); } // char at_cmd[LTE_AT_CMD_SIZE_MAX - 4]; if (args[0].u_obj != mp_const_none) { @@ -1167,11 +1188,13 @@ STATIC mp_obj_t lte_resume(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t } if (lte_push_at_command_ext("ATO", LTE_RX_TIMEOUT_MAX_MS, LTE_CONNECT_RSP, strlen("ATO") )) { + MSG("resume ATO OK\n"); lteppp_connect(); lteppp_resume(); lteppp_set_state(E_LTE_PPP); vTaskDelay(1500); } else { + MSG("resume ATO failed -> reconnect\n"); lteppp_disconnect(); lteppp_set_state(E_LTE_ATTACHED); lte_check_attached(lte_legacyattach_flag); @@ -1180,6 +1203,7 @@ STATIC mp_obj_t lte_resume(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t } else if (lteppp_get_state() == E_LTE_PPP) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "modem already connected")); } else { + MSG("resume do nothing\n"); //Do Nothing } return mp_const_none; @@ -1236,8 +1260,8 @@ STATIC mp_obj_t lte_send_at_cmd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m lte_check_init(); lte_check_inppp(); STATIC const mp_arg_t allowed_args[] = { - { MP_QSTR_cmd, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = mp_const_none} }, - { MP_QSTR_delay, MP_ARG_INT, {.u_int = LTE_RX_TIMEOUT_MAX_MS} } + { MP_QSTR_cmd, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = LTE_RX_TIMEOUT_MAX_MS} }, }; // parse args uint32_t argLength = MP_ARRAY_SIZE(allowed_args); @@ -1246,34 +1270,10 @@ STATIC mp_obj_t lte_send_at_cmd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m if (args[0].u_obj == mp_const_none) { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "the command must be specified!")); } - uint32_t timeout = LTE_RX_TIMEOUT_MAX_MS; if (MP_OBJ_IS_STR_OR_BYTES(args[0].u_obj)) { size_t len; - char* command = (char *)(mp_obj_str_get_data(args[0].u_obj, &len)); - - if(argLength > 1) { - timeout = args[1].u_int; - } - - if(len <= LTE_AT_CMD_DATA_SIZE_MAX) { - lte_push_at_command_ext_cont(command, timeout, NULL, len, false); - } else { - size_t chunk_count = len / LTE_AT_CMD_DATA_SIZE_MAX; - size_t remaining_bytes = len % LTE_AT_CMD_DATA_SIZE_MAX; - - bool expect_continuation = false; - char* chunk_start = command; - for(size_t i = 0; i < chunk_count; ++i) { - expect_continuation = (i < (chunk_count - 1)) || remaining_bytes; - lte_push_at_command_ext_cont(chunk_start, timeout, NULL, LTE_AT_CMD_DATA_SIZE_MAX, expect_continuation); - chunk_start += LTE_AT_CMD_DATA_SIZE_MAX; - } - - if(remaining_bytes) { - lte_push_at_command_ext_cont(chunk_start, timeout, NULL, remaining_bytes, false); - } - } + lte_push_at_command_ext((char *)(mp_obj_str_get_data(args[0].u_obj, &len)), args[1].u_int, NULL, len); } else { @@ -1285,7 +1285,7 @@ STATIC mp_obj_t lte_send_at_cmd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m vstr_add_str(&vstr, modlte_rsp.data); while(modlte_rsp.data_remaining) { - lte_push_at_command_ext("Pycom_Dummy", LTE_RX_TIMEOUT_MAX_MS, NULL, strlen("Pycom_Dummy") ); + lte_push_at_command_ext("Pycom_Dummy", args[1].u_int, NULL, strlen("Pycom_Dummy") ); vstr_add_str(&vstr, modlte_rsp.data); } return mp_obj_new_str_from_vstr(&mp_type_str, &vstr); @@ -1602,7 +1602,8 @@ STATIC const mp_map_elem_t lte_locals_dict_table[] = { // class constants { MP_OBJ_NEW_QSTR(MP_QSTR_IP), MP_OBJ_NEW_QSTR(MP_QSTR_IP) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IPV4V6), MP_OBJ_NEW_QSTR(MP_QSTR_IPV4V6) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_EVENT_COVERAGE_LOSS), MP_OBJ_NEW_SMALL_INT(LTE_TRIGGER_SIG_LOST) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_EVENT_COVERAGE_LOSS), MP_OBJ_NEW_SMALL_INT(LTE_EVENT_COVERAGE_LOST) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_EVENT_BREAK), MP_OBJ_NEW_SMALL_INT(LTE_EVENT_BREAK) }, // PSM Power Saving Mode { MP_OBJ_NEW_QSTR(MP_QSTR_PSM_PERIOD_2S), MP_OBJ_NEW_SMALL_INT(PSM_PERIOD_2S) }, { MP_OBJ_NEW_QSTR(MP_QSTR_PSM_PERIOD_30S), MP_OBJ_NEW_SMALL_INT(PSM_PERIOD_30S) }, diff --git a/esp32/mods/modlte.h b/esp32/mods/modlte.h index f38439babe..10880877d4 100644 --- a/esp32/mods/modlte.h +++ b/esp32/mods/modlte.h @@ -16,8 +16,19 @@ #define LTE_MAX_RX_SIZE 1024 -#define LTE_TRIGGER_NONE 0x00000000 -#define LTE_TRIGGER_SIG_LOST 0x00000001 +// // trigger and event definitions used in Micropython API +// #define LTE_EVENT_NONE 0x00000000 +// #define LTE_EVENT_COVERAGE_LOST 0x00000001 +// #define LTE_EVENT_BREAK 0x00000002 + + +typedef enum +{ + LTE_EVENT_NONE = 0x00000000, + LTE_EVENT_COVERAGE_LOST = 0x00000001, + LTE_EVENT_BREAK = 0x00000002, +}lte_events_t; + typedef struct _lte_obj_t { mp_obj_base_t base; @@ -26,18 +37,12 @@ typedef struct _lte_obj_t { uint8_t cid; bool init; bool carrier; - uint32_t trigger; - int32_t events; + lte_events_t trigger; + lte_events_t events; mp_obj_t handler; mp_obj_t handler_arg; } lte_obj_t; -typedef enum -{ - LTE_EVENT_COVERAGE_LOST = 0, - LTE_EVENT_MAX -}lte_events_t; - /****************************************************************************** DECLARE PUBLIC FUNCTIONS diff --git a/esp32/mods/modmachine.c b/esp32/mods/modmachine.c index fc9e2e8b26..b5d07bfd3c 100644 --- a/esp32/mods/modmachine.c +++ b/esp32/mods/modmachine.c @@ -287,6 +287,13 @@ STATIC mp_obj_t machine_pygate_deinit (void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_pygate_deinit_obj, machine_pygate_deinit); + +STATIC mp_obj_t machine_pygate_reset (void) { + pygate_reset(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_pygate_reset_obj, machine_pygate_reset); + STATIC mp_obj_t machine_pygate_debug_level (mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { STATIC const mp_arg_t allowed_args[] = { { MP_QSTR_level, MP_ARG_INT, }, @@ -435,7 +442,8 @@ STATIC mp_obj_t machine_sleep (uint n_args, const mp_obj_t *arg) { } modbt_deinit(reconnect); - wlan_deinit(NULL); + // TRUE means wlan_deinit is called from machine_sleep + wlan_deinit(mp_const_true); if(ESP_OK != esp_light_sleep_start()) { @@ -621,6 +629,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = { #ifdef PYGATE_ENABLED { MP_OBJ_NEW_QSTR(MP_QSTR_pygate_init), (mp_obj_t)&machine_pygate_init_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_pygate_deinit), (mp_obj_t)&machine_pygate_deinit_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_pygate_reset), (mp_obj_t)&machine_pygate_reset_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_pygate_debug_level), (mp_obj_t)&machine_pygate_debug_level_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_pygate_cmd_decode), (mp_obj_t)&machine_pygate_cmd_decode_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_pygate_cmd_get), (mp_obj_t)&machine_pygate_cmd_get_obj }, diff --git a/esp32/mods/modwlan.c b/esp32/mods/modwlan.c index 9b222b64c4..81efbd1818 100644 --- a/esp32/mods/modwlan.c +++ b/esp32/mods/modwlan.c @@ -96,14 +96,14 @@ wlan_obj_t wlan_obj = { .irq_enabled = false, .pwrsave = false, .is_promiscuous = false, - .sta_conn_timeout = false + .sta_conn_timeout = false, + .country = NULL }; /* TODO: Maybe we can add possibility to create IRQs for wifi events */ static EventGroupHandle_t wifi_event_group; -static bool mod_wlan_is_deinit = false; static uint16_t mod_wlan_ap_number_of_connections = 0; /* Variables holding wlan conn params for wakeup recovery of connections */ @@ -135,6 +135,7 @@ SemaphoreHandle_t smartConfigTimeout_mutex; static const int ESPTOUCH_DONE_BIT = BIT1; static const int ESPTOUCH_STOP_BIT = BIT2; +static const int ESPTOUCH_SLEEP_STOP_BIT = BIT3; static bool wlan_smart_config_enabled = false; /****************************************************************************** @@ -202,24 +203,36 @@ void wlan_pre_init (void) { wlan_obj.mutex = xSemaphoreCreateMutex(); timeout_mutex = xSemaphoreCreateMutex(); smartConfigTimeout_mutex = xSemaphoreCreateMutex(); - memcpy(wlan_obj.country.cc, (const char*)"NA", sizeof(wlan_obj.country.cc)); // create Smart Config Task xTaskCreatePinnedToCore(TASK_SMART_CONFIG, "SmartConfig", SMART_CONF_TASK_STACK_SIZE / sizeof(StackType_t), NULL, SMART_CONF_TASK_PRIORITY, &SmartConfTaskHandle, 1); } void wlan_resume (bool reconnect) { - if (!wlan_obj.started && mod_wlan_is_deinit) { - - mod_wlan_is_deinit = false; - - if(reconnect) - { - wifi_country_t* country = NULL; - - if(strcmp((const char*)wlan_obj.country.cc, "NA")) - { - country = &(wlan_obj.country); + // Configure back WLAN as it was before if reconnect is TRUE + if(reconnect) { + // If SmartConfig enabled then re-start it + if(wlan_smart_config_enabled) { + // Do initial configuration as at this point the Wifi Driver is not initialized + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM)); + wlan_set_antenna(wlan_obj.antenna); + wlan_set_mode(wlan_obj.mode); + wlan_set_bandwidth(wlan_obj.bandwidth); + if(wlan_obj.country != NULL) { + esp_wifi_set_country(wlan_obj.country); + } + xTaskNotifyGive(SmartConfTaskHandle); + } + // Otherwise set up WLAN with the same parameters as it was before + else { + // In wlan_setup the wlan_obj.country is overwritten with the value coming from setup_config, need to save it out + wifi_country_t country; + wifi_country_t* country_ptr = NULL; + if(wlan_obj.country != NULL) { + memcpy(&country, wlan_obj.country, sizeof(wifi_country_t)); + country_ptr = &country; } wlan_internal_setup_t setup_config = { @@ -234,11 +247,11 @@ void wlan_resume (bool reconnect) false, wlan_conn_recover_hidden, wlan_obj.bandwidth, - country, + country_ptr, &(wlan_obj.max_tx_pwr) }; - // initialize the wlan subsystem + // Initialize & reconnect to the previous connection wlan_setup(&setup_config); } } @@ -258,12 +271,15 @@ void wlan_setup (wlan_internal_setup_t *config) { wlan_set_bandwidth(config->bandwidth); if (config->country != NULL) { - - if(ESP_OK != esp_wifi_set_country(config->country)) + esp_err_t ret = esp_wifi_set_country(config->country); + if(ESP_OK != ret) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed)); } - memcpy(&(wlan_obj.country), config->country, sizeof(wlan_obj.country)); + if(wlan_obj.country == NULL) { + wlan_obj.country = (wifi_country_t*)malloc(sizeof(wifi_country_t)); + } + memcpy(wlan_obj.country, config->country, sizeof(wifi_country_t)); } if(config->max_tx_pr != NULL) @@ -950,9 +966,8 @@ static void TASK_SMART_CONFIG (void *pvParameters) { static uint32_t thread_notification; smartConf_init: - wlan_smart_config_enabled = false; connected = false; - // Block task till notification is recieved + // Block task till notification is received thread_notification = ulTaskNotifyTake(pdTRUE, portMAX_DELAY); if (thread_notification) { @@ -967,30 +982,36 @@ static void TASK_SMART_CONFIG (void *pvParameters) { } CHECK_ESP_ERR(esp_smartconfig_set_type(SC_TYPE_ESPTOUCH), smartConf_init) CHECK_ESP_ERR(esp_smartconfig_start(smart_config_callback), smartConf_init) - wlan_smart_config_enabled = true; goto smartConf_start; } goto smartConf_init; smartConf_start: - //mp_printf(&mp_plat_print, "\n-------SmartConfig Started-------\n"); + wlan_smart_config_enabled = true; /*create Timer */ wlan_smartConfig_timeout = xTimerCreate("smartConfig_Timer", 60000 / portTICK_PERIOD_MS, 0, 0, wlan_timer_callback); /*start Timer */ xTimerStart(wlan_smartConfig_timeout, 0); while (1) { - uxBits = xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT | ESPTOUCH_DONE_BIT | ESPTOUCH_STOP_BIT, true, false, portMAX_DELAY); + uxBits = xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT | ESPTOUCH_DONE_BIT | ESPTOUCH_STOP_BIT | ESPTOUCH_SLEEP_STOP_BIT, true, false, portMAX_DELAY); if(uxBits & ESPTOUCH_STOP_BIT) { + wlan_smart_config_enabled = false; esp_smartconfig_stop(); //mp_printf(&mp_plat_print, "\nSmart Config Aborted or Timed-out\n"); goto smartConf_init; } + if(uxBits & ESPTOUCH_SLEEP_STOP_BIT) { + esp_smartconfig_stop(); + //mp_printf(&mp_plat_print, "\nSmart Config Aborted because sleep operation has been requested\n"); + goto smartConf_init; + } if(uxBits & CONNECTED_BIT) { //mp_printf(&mp_plat_print, "WiFi Connected to ap\n"); connected = true; } if(uxBits & ESPTOUCH_DONE_BIT) { //mp_printf(&mp_plat_print, "smartconfig over\n"); + wlan_smart_config_enabled = false; esp_smartconfig_stop(); wlan_stop_smartConfig_timer(); //set event flag @@ -1244,11 +1265,25 @@ mp_obj_t wlan_deinit(mp_obj_t self_in) { if (wlan_obj.started) { + bool called_from_sleep = false; + // stop smart config if enabled - if(wlan_smart_config_enabled) - { - xEventGroupSetBits(wifi_event_group, ESPTOUCH_STOP_BIT); - vTaskDelay(100/portTICK_PERIOD_MS); + if(wlan_smart_config_enabled) { + // If the input parameter is not the object itself but a simple boolean, it is interpreted that + // wlan_deinit is called from machine_sleep() + if(mp_obj_get_type(self_in) == &mp_type_bool) { + called_from_sleep = (bool)mp_obj_get_int(self_in); + if(called_from_sleep == true) { + // stop smart config with special event + xEventGroupSetBits(wifi_event_group, ESPTOUCH_SLEEP_STOP_BIT); + vTaskDelay(100/portTICK_PERIOD_MS); + } + } + else { + // stop smart config with original STOP event + xEventGroupSetBits(wifi_event_group, ESPTOUCH_STOP_BIT); + vTaskDelay(100/portTICK_PERIOD_MS); + } } mod_network_deregister_nic(&wlan_obj); @@ -1262,7 +1297,11 @@ mp_obj_t wlan_deinit(mp_obj_t self_in) { /* stop and free wifi resource */ esp_wifi_deinit(); - mod_wlan_is_deinit = true; + // Only free up memory area of country information if this deinit is not called from machine.sleep() + if(called_from_sleep == false) { + free(wlan_obj.country); + wlan_obj.country = NULL; + } wlan_obj.started = false; mod_network_deregister_nic(&wlan_obj); } @@ -2446,7 +2485,10 @@ STATIC mp_obj_t wlan_country(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed)); } - memcpy(&(wlan_obj.country), &country_config, sizeof(wlan_obj.country)); + if(wlan_obj.country == NULL) { + wlan_obj.country = (wifi_country_t*)malloc(sizeof(wifi_country_t)); + } + memcpy(wlan_obj.country, &country_config, sizeof(wifi_country_t)); return mp_const_none; } diff --git a/esp32/mods/modwlan.h b/esp32/mods/modwlan.h index 1dcdc6e51a..97f572b15f 100644 --- a/esp32/mods/modwlan.h +++ b/esp32/mods/modwlan.h @@ -73,7 +73,7 @@ typedef struct _wlan_obj_t { uint8_t channel; uint8_t antenna; int8_t max_tx_pwr; - wifi_country_t country; + wifi_country_t* country; // my own ssid, key and mac uint8_t ssid[(MODWLAN_SSID_LEN_MAX + 1)]; diff --git a/esp32/mpconfigport.h b/esp32/mpconfigport.h index 9870415bd2..e6d2228138 100644 --- a/esp32/mpconfigport.h +++ b/esp32/mpconfigport.h @@ -101,7 +101,9 @@ #define MICROPY_PY_UTIMEQ (1) #define MICROPY_CPYTHON_COMPAT (1) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) +#ifndef MICROPY_FLOAT_IMPL // can be configured by make option #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) +#endif #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL) #define MICROPY_OPT_COMPUTED_GOTO (1) #define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0) diff --git a/esp32/pycom_version.h b/esp32/pycom_version.h index dfa8be4d40..55b3ed1ca3 100644 --- a/esp32/pycom_version.h +++ b/esp32/pycom_version.h @@ -10,14 +10,14 @@ #ifndef VERSION_H_ #define VERSION_H_ -#define SW_VERSION_NUMBER "1.20.2.rc11" +#define SW_VERSION_NUMBER "1.20.2.r2" #define LORAWAN_VERSION_NUMBER "1.0.2" #define SIGFOX_VERSION_NUMBER "1.0.1" #if (VARIANT == PYBYTES) -#define PYBYTES_VERSION_NUMBER "1.5.2" +#define PYBYTES_VERSION_NUMBER "1.6.1" #endif #ifdef PYGATE_ENABLED diff --git a/esp32/pygate/lora_pkt_fwd/jitqueue.c b/esp32/pygate/lora_pkt_fwd/jitqueue.c index 7241627032..c078e2f39b 100644 --- a/esp32/pygate/lora_pkt_fwd/jitqueue.c +++ b/esp32/pygate/lora_pkt_fwd/jitqueue.c @@ -42,7 +42,7 @@ Maintainer: Michael Coracin /* --- PRIVATE CONSTANTS & TYPES -------------------------------------------- */ #define TX_START_DELAY 1500 /* microseconds */ /* TODO: get this value from HAL? */ -#define TX_MARGIN_DELAY 1000000 /* Packet overlap margin in microseconds */ +#define TX_MARGIN_DELAY 1000 /* Packet overlap margin in microseconds */ /* TODO: How much margin should we take? */ #define TX_JIT_DELAY 50000 /* Pre-delay to program packet for TX in microseconds */ #define TX_MAX_ADVANCE_DELAY ((JIT_NUM_BEACON_IN_QUEUE + 1) * 128 * 1E6) /* Maximum advance delay accepted for a TX packet, compared to current time */ diff --git a/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.c b/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.c index 238a75fd01..0938dab46b 100644 --- a/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.c +++ b/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.c @@ -71,6 +71,9 @@ License: Revised BSD License, see LICENSE.TXT file include in the project #include "py/obj.h" #include "py/mpprint.h" #include "modmachine.h" +#include "machpin.h" +#include "pins.h" +#include "sx1308-config.h" /* -------------------------------------------------------------------------- */ /* --- PRIVATE MACROS ------------------------------------------------------- */ @@ -227,7 +230,7 @@ static struct lgw_tx_gain_lut_s txlut; /* TX gain table */ static uint32_t tx_freq_min[LGW_RF_CHAIN_NB]; /* lowest frequency supported by TX chain */ static uint32_t tx_freq_max[LGW_RF_CHAIN_NB]; /* highest frequency supported by TX chain */ -int debug_level = INFO_; +int debug_level = LORAPF_INFO_; /* -------------------------------------------------------------------------- */ /* --- PRIVATE FUNCTIONS DECLARATION ---------------------------------------- */ @@ -903,6 +906,38 @@ void lora_gw_init(const char* global_conf) { MSG_INFO("lora_gw_init() done fh=%u high=%u\n", xPortGetFreeHeapSize(), uxTaskGetStackHighWaterMark(NULL)); } +void pygate_reset() { + MSG_INFO("pygate_reset\n"); + + // pull sx1257 and sx1308 reset high, the PIC FW should power cycle the ESP32 as a result + pin_obj_t* sx1308_rst = SX1308_RST_PIN; + pin_config(sx1308_rst, -1, -1, GPIO_MODE_OUTPUT, MACHPIN_PULL_NONE, 0); + pin_obj_t* sx1257_rst = (&PIN_MODULE_P8); + pin_config(sx1257_rst, -1, -1, GPIO_MODE_OUTPUT, MACHPIN_PULL_NONE, 0); + + sx1308_rst->value = 1; + sx1257_rst->value = 1; + + pin_set_value(sx1308_rst); + pin_set_value(sx1257_rst); + + vTaskDelay(5000 / portTICK_PERIOD_MS); + + // if this is still being executed, then it seems the ESP32 reset did not take place + // set the two reset lines low again and stop the lora gw task, to make sure we return to a defined state + MSG_ERROR("pygate_reset failed to reset\n"); + sx1308_rst->value = 0; + sx1257_rst->value = 0; + pin_set_value(sx1308_rst); + pin_set_value(sx1257_rst); + + if (xLoraGwTaskHndl){ + vTaskDelete(xLoraGwTaskHndl); + xLoraGwTaskHndl = NULL; + } + +} + int lora_gw_get_debug_level(){ return debug_level; } @@ -1323,8 +1358,8 @@ void TASK_lora_gw(void *pvParameters) { } /* display a report */ -#if DEBUG_LEVEL >= INFO_ - if ( debug_level >= INFO_){ +#if LORAPF_DEBUG_LEVEL >= LORAPF_INFO_ + if ( debug_level >= LORAPF_INFO_){ MSG_INFO("[main] report\n##### %s #####\n", stat_timestamp); mp_printf(&mp_plat_print, "### [UPSTREAM] ###\n"); mp_printf(&mp_plat_print, "# RF packets received by concentrator: %u\n", cp_nb_rx_rcv); diff --git a/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.h b/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.h index 160d025856..3b2bbf83d2 100644 --- a/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.h +++ b/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.h @@ -28,6 +28,7 @@ Maintainer: Michael Coracin #include "py/mpprint.h" int lora_gw_init(char *); +void pygate_reset(); int lora_gw_get_debug_level(); void lora_gw_set_debug_level(int level); diff --git a/esp32/pygate/lora_pkt_fwd/trace.h b/esp32/pygate/lora_pkt_fwd/trace.h index 3fbe77ac78..fdc399abdb 100644 --- a/esp32/pygate/lora_pkt_fwd/trace.h +++ b/esp32/pygate/lora_pkt_fwd/trace.h @@ -32,42 +32,42 @@ Maintainer: Michael Coracin #include "py/mpprint.h" // debug levels -#define DEBUG 4 -#define INFO_ 3 -#define WARN_ 2 -#define ERROR 1 +#define LORAPF_DEBUG 4 +#define LORAPF_INFO_ 3 +#define LORAPF_WARN_ 2 +#define LORAPF_ERROR 1 // run time debug level extern int debug_level; // compile time debug level -#define DEBUG_LEVEL INFO_ +#define LORAPF_DEBUG_LEVEL LORAPF_INFO_ #define MSG_DX(LEVEL, fmt, ...) \ do { \ if (debug_level >= LEVEL) \ - mp_printf(&mp_plat_print, "[%u] lorapf: " #LEVEL " " fmt, mp_hal_ticks_ms(), ##__VA_ARGS__); \ + mp_printf(&mp_plat_print, "[%u] " #LEVEL ":" fmt, mp_hal_ticks_ms(), ##__VA_ARGS__); \ } while (0) -#if DEBUG_LEVEL >= DEBUG -#define MSG_DEBUG(...) MSG_DX(DEBUG, __VA_ARGS__) +#if LORAPF_DEBUG_LEVEL >= LORAPF_DEBUG +#define MSG_DEBUG(...) MSG_DX(LORAPF_DEBUG, __VA_ARGS__) #else #define MSG_DEBUG(...) (void)0 #endif -#if DEBUG_LEVEL >= INFO_ -#define MSG_INFO(...) MSG_DX(INFO_, __VA_ARGS__) +#if LORAPF_DEBUG_LEVEL >= LORAPF_INFO_ +#define MSG_INFO(...) MSG_DX(LORAPF_INFO_, __VA_ARGS__) #else #define MSG_INFO(...) (void)0 #endif -#if DEBUG_LEVEL >= WARN_ -#define MSG_WARN(...) MSG_DX(WARN_, __VA_ARGS__) +#if LORAPF_DEBUG_LEVEL >= LORAPF_WARN_ +#define MSG_WARN(...) MSG_DX(LORAPF_WARN_, __VA_ARGS__) #else #define MSG_WARN(...) (void)0 #endif -#if DEBUG_LEVEL >= ERROR -#define MSG_ERROR(...) MSG_DX(ERROR, __VA_ARGS__) +#if LORAPF_DEBUG_LEVEL >= LORAPF_ERROR +#define MSG_ERROR(...) MSG_DX(LORAPF_ERROR, __VA_ARGS__) #else #define MSG_ERROR(...) (void)0 #endif diff --git a/esp32/util/str_utils.c b/esp32/util/str_utils.c index 8702e75610..beb94908f9 100644 --- a/esp32/util/str_utils.c +++ b/esp32/util/str_utils.c @@ -1,5 +1,6 @@ #include "str_utils.h" #include +#include /** * Create a string representation of a uint8 @@ -18,3 +19,43 @@ void sprint_binary_u8(char* s, uint8_t v){ ); } +/* hexdump a buffer +*/ +void hexdump(const uint8_t* buf, size_t len){ + const size_t line_len = 16; + uint8_t line[line_len+1]; + memset(line, ' ', line_len); + line[line_len] = '\0'; + + for ( size_t i = 0; i < len; ++i) { + uint8_t c = buf[i]; + printf("%02x ", c); + if ( (c >= (uint8_t)'a' && c <= (uint8_t)'z') + || (c >= (uint8_t)'A' && c <= (uint8_t)'Z') + || (c >= (uint8_t)'0' && c <= (uint8_t)'9') ) + { + line[i%line_len] = c; + } else { + line[i%line_len] = '.'; + } + + // space after 8 bytes + if (i%16 == 7) + printf(" "); + // end of line after 16 bytes + if (i%16==15){ + printf(" |%s|\n", line); + memset(line, ' ', line_len); + } + } + if ( len % line_len ){ + // space after 8 bytes + if ( len % line_len < 7) + printf(" "); + // spaces for bytes we didn't have to print + for ( size_t j = line_len; j > len % line_len; j-- ){ + printf(" "); + } + printf(" |%s|\n", line); + } +} diff --git a/esp32/util/str_utils.h b/esp32/util/str_utils.h index 258b6d1dc0..298ed561b7 100644 --- a/esp32/util/str_utils.h +++ b/esp32/util/str_utils.h @@ -14,4 +14,6 @@ void sprint_binary_u8(char* s, uint8_t v); +void hexdump(const uint8_t* buf, size_t len); + #endif pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy