Skip to content

Commit 41ddb87

Browse files
authored
chore(zephyr): upgrade to Zephyr v3.7.0 (#10)
### Summary There are several fixes for this app to build with Zephyr 3.7.0 and the latest Memfault SDK: - Updated s3 board overlay & board argument to match hardware model v2 - Updated heap pool size to eliminate warning compile message -- they increased it - Removed enabling of `CONFIG_MEMFAULT_TLS_CERTS_USE_DER` since it is now the default - Updated readme with new args for `wifi connect` shell command - Enabled `CONFIG_MBEDTLS_AES_ROM_TABLES` explicitly -- this used to be enabled by default. It saves ~8kB in RAM space. With the jump to 3.7.0, the build for the esp32c3 overflowed by 70kb: ``` /Users/gminnehan/.local/zephyr-sdk-0.16.1-rc1/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/zephyr_pre0.elf section `.dram0.bss' will not fit in region `dram0_0_seg' /Users/gminnehan/.local/zephyr-sdk-0.16.1-rc1/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: DRAM segment data does not fit. /Users/gminnehan/.local/zephyr-sdk-0.16.1-rc1/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: region `dram0_0_seg' overflowed by 71104 bytes ``` After investigating, there appears to be a few culprits, including a drop in the DRAM segment by 20kB in 3.7.0. To unblock build testing with Memfault for both the RISC-V and Xtensa arch on Zephyr 3.7.0, the MBEDTLS heap has been shrunk for the c3 build for now. Users can still test out Memfault shell commands but will have to post chunks via the chunks debug log. Since this support has been removed, the default board is now the s3. ### Test Plan CI, also flashed a esp32s3 locally & uploaded chunks successfully ---- Related: MCU-569
1 parent 4f5e136 commit 41ddb87

File tree

8 files changed

+22
-10
lines changed

8 files changed

+22
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
5151
west build --sysbuild \
5252
--pristine=always \
53-
--board=esp32s3_devkitm zephyr-esp32-example \
53+
--board=esp32s3_devkitm/esp32s3/procpu zephyr-esp32-example \
5454
-- \
5555
-DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\"
5656

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
# Default board
4-
set(BOARD esp32c3_devkitm)
4+
set(BOARD esp32s3_devkitm/esp32s3/procpu)
55

66
cmake_minimum_required(VERSION 3.20.0)
77

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ This sample app is based on the Zephyr `samples/net/wifi` example. It
44
demonstrates a Zephyr + ESP32 integration with the Memfault SDK. It has been
55
tested on the following boards:
66

7-
- `esp32c3_devkitm` (default board)
8-
- `esp32s3_devkitm`
7+
- `esp32s3_devkitm/esp32s3/procpu` (default board)
8+
- `esp32c3_devkitm`*
9+
10+
\* _NOTE: Currently does not have support for data upload. Export chunks to memfault with `mflt export` and upload via the [chunks debug log](https://mflt.io/chunks-debug).
911

1012
## Getting Started
1113

@@ -56,7 +58,7 @@ To try out this example app:
5658
[00:09:21.911,000] <inf> mflt: HW version: esp32c3_devkitm
5759

5860
# connect wifi
59-
uart:~$ wifi connect <ssid> <pw>
61+
uart:~$ wifi connect -s "<ssid>" -k <key type> -p "<pw>"
6062

6163
# test memfault export over uart
6264
uart:~$ mflt export

boards/esp32c3_devkitm.conf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@ CONFIG_NET_IPV4=y
1111
CONFIG_NET_DHCPV4=y
1212
CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y
1313

14-
CONFIG_NET_LOG=y
14+
# Override selections from prj.conf to save space on this chip
15+
CONFIG_LOG=y
16+
CONFIG_NET_LOG=n
17+
CONFIG_MEMFAULT_LOGGING_ENABLE=n
18+
CONFIG_NET_SHELL=n
19+
20+
# TODO: Add support for TLS on this chip
21+
# Removed to free up RAM and allow build check to succeed.
22+
CONFIG_MBEDTLS_HEAP_SIZE=0

prj.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,26 @@ CONFIG_NET_L2_WIFI_SHELL=y
4141
CONFIG_MEMFAULT=y
4242
CONFIG_MEMFAULT_LOGGING_ENABLE=y
4343
CONFIG_MEMFAULT_HTTP_ENABLE=y
44-
CONFIG_MEMFAULT_TLS_CERTS_USE_DER=y
4544
CONFIG_MEMFAULT_HTTP_PERIODIC_UPLOAD=y
4645

4746
# Additional network configuration for Memfault features
4847
CONFIG_DNS_RESOLVER=y
48+
CONFIG_POSIX_API=y
4949
CONFIG_NET_SOCKETS=y
5050
CONFIG_TLS_CREDENTIALS=y
5151
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
5252
CONFIG_NET_STATISTICS=y
5353
CONFIG_NET_STATISTICS_USER_API=y
5454

5555
# MbedTLS config
56+
CONFIG_MBEDTLS_SHA1=y
5657
CONFIG_MBEDTLS_SERVER_NAME_INDICATION=y
5758
CONFIG_MBEDTLS_ENABLE_HEAP=y
5859
CONFIG_MBEDTLS_HEAP_SIZE=30000
5960
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096
6061
CONFIG_MBEDTLS_MEMORY_DEBUG=y
6162
CONFIG_MBEDTLS_SHELL=y
63+
CONFIG_MBEDTLS_AES_ROM_TABLES=y
6264

6365
# More verbose Memfault component logs
6466
CONFIG_MEMFAULT_LOG_LEVEL_DBG=y
@@ -76,7 +78,7 @@ CONFIG_MEMFAULT_COREDUMP_COLLECT_TASKS_REGIONS=n
7678
# Memfault's http client needs a small amount of heap. Zephyr requires a minimum
7779
# heap size for the applied configuration, so select that here to prevent a
7880
# build time message
79-
CONFIG_HEAP_MEM_POOL_SIZE=51200
81+
CONFIG_HEAP_MEM_POOL_SIZE=52224
8082
CONFIG_SYS_HEAP_RUNTIME_STATS=y
8183
CONFIG_SHELL_STACK_SIZE=4096
8284
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

west.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ manifest:
22
projects:
33
- name: zephyr
44
url: https://github.com/zephyrproject-rtos/zephyr
5-
revision: v3.6.0
5+
revision: v3.7.0
66
import:
77
# Limit the Zephyr modules to the required set
88
name-allowlist:
@@ -13,4 +13,4 @@ manifest:
1313
- name: memfault-firmware-sdk
1414
url: https://github.com/memfault/memfault-firmware-sdk
1515
path: modules/lib/memfault-firmware-sdk
16-
revision: 1.10.1
16+
revision: 1.11.4

0 commit comments

Comments
 (0)