Skip to content

Commit

Permalink
bump Zephyr to 3.7.0 and NCS to 2.7.0
Browse files Browse the repository at this point in the history
All 39 patches were upstreamed, so drop them.

Maintain default values for old (NCS, POSIX_MAX_FDS and EVENTFD_*) as well
as new (Zephyr upstream, ZVFS_OPEN_MAX and ZVFS_EVENTFD_*) Kconfig options.

Update platform names to be HWMv2 compliant:
 * esp32_devkitc_wrover -> esp32_devkitc_wrover/esp32/procpu
 * native_sim_64 -> native_sim/native/64
 * nrf52840dk_nrf52840 -> nrf52840dk/nrf52840
 * nrf9160dk_nrf9160_ns -> nrf9160dk/nrf9160/ns
 * rak5010_nrf52840 -> rak5010/nrf52840

Update overlay configurations for platforms using ESP-AT WiFi driver. New
DNS resolver uses recvfrom() API with non-NULL remote address. This API
requires remote address to be set, which is only possible if ESP-AT driver
already assigned remote address for incoming packet. Such behavior is
implemented only with CONFIG_WIFI_ESP_AT_CIPDINFO_USE=y, which requires
CONFIG_WIFI_ESP_AT_PASSIVE_MODE=y to be functional. Set also
CONFIG_WIFI_ESP_AT_DNS_USE=y, so that DNS resolver gets reinitialized
automatically after connection to WiFi Access Point was established.

Replace CONFIG_LTE_CONNECTIVITY with CONFIG_NRF_MODEM_LIB_NET_IF. Enable
"auto start" and "auto connect" in all samples which are now disabled by
default.

Make use of 'configdefault' Kconfig keyword, which allows to safely
configure default values without replicating all dependencies. This
requires to provide type of the configuration option (e.g. 'int') when
option is not provided by included Zephyr Kconfig subsystem (either hidden
under 'if' or not provided due to differences between upstream and NCS'
variants of Zephyr).

Use matrix.hil_board in artifacts names, as '/' is treated as special
character and fobidden.

Flash only Zephyr "application" image for Espressif targets, since that is
the default behavior of 'west flash' with 'esp32' runner after introduction
of CONFIG_ESP_SIMPLE_BOOT [1] in Zephyr upstream. Put the 0x1000
application offset in pytest-hil class instantiation.

Enable SHA256 and SHA384 hashes explicitly. So far those were enabled by
default in old Zephyr versions, but that is no longer the case.

Override default value for new CONFIG_NET_SOCKETS_DTLS_MAX_FRAGMENT_LENGTH
option, so that DTLS outgoing packet lenght is not limited further to 1024,
but instead matches MBEDTLS_SSL_IN_CONTENT_LEN and
MBEDTLS_SSL_OUT_CONTENT_LEN settings.

For all nrf9160dk/nrf9160/ns board files, remove the
CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC symbol which conflicts
with the CONFIG_NRF_MODEM_LIB_NET_IF symbol that is also being set in those
file. The accounts for a change in sdk-nrf that automatically selects
CONFIG_NRF_MODEM_LIB_ON_FAULT_LTE_NET_IF instead.

[1] Zephyr upstream 2395f08d489c ("soc: espressif: esp32: simple boot
  support")

Co-authored-by: Mike Szczys <[email protected]>
Signed-off-by: Mike Szczys <[email protected]>
Signed-off-by: Marcin Niestroj <[email protected]>
  • Loading branch information
mniestroj and szczys committed Sep 4, 2024
1 parent 2e2ed92 commit 414aa5a
Show file tree
Hide file tree
Showing 146 changed files with 389 additions and 7,442 deletions.
1 change: 1 addition & 0 deletions .ci-west-ncs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ manifest:
- net-tools
- nrf
- nrfxlib
- oberon-psa-crypto
- qcbor
- segger
- tinycrypt
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/hil_sample_zephyr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ jobs:
--platform ${{ inputs.west_board }} \
-T modules/lib/golioth-firmware-sdk/examples/zephyr \
--prep-artifacts-for-testing \
--package-artifacts test_artifacts_${{ inputs.west_board }}.tar \
--package-artifacts test_artifacts_${{ inputs.hil_board }}.tar \
$EXTRA_BUILD_ARGS
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: test_artifacts_${{ inputs.west_board }}
path: test_artifacts_${{ inputs.west_board }}.tar
name: test_artifacts_${{ inputs.hil_board }}
path: test_artifacts_${{ inputs.hil_board }}.tar

test:
name: zephyr-${{ inputs.hil_board }}-twister-run
Expand Down Expand Up @@ -170,10 +170,10 @@ jobs:
- name: Download build
uses: actions/download-artifact@v4
with:
name: test_artifacts_${{ inputs.west_board }}
name: test_artifacts_${{ inputs.hil_board }}
path: .
- name: Extract artifacts
run: tar -xvf test_artifacts_${{ inputs.west_board }}.tar
run: tar -xvf test_artifacts_${{ inputs.hil_board }}.tar
- name: Run test
shell: bash
env:
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/hil_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ jobs:
matrix:
include:
- hil_board: esp32_devkitc_wrover
west_board: esp32_devkitc_wrover
west_board: esp32_devkitc_wrover/esp32/procpu
manifest: .ci-west-zephyr.yml
binary_name: merged.bin
binary_name: zephyr.bin
binary_blob: hal_espressif
- hil_board: mimxrt1024_evk
west_board: mimxrt1024_evk
manifest: .ci-west-zephyr.yml
binary_name: zephyr.hex
- hil_board: nrf52840dk
west_board: nrf52840dk_nrf52840
west_board: nrf52840dk/nrf52840
manifest: .ci-west-zephyr.yml
binary_name: zephyr.hex
- hil_board: nrf9160dk
west_board: nrf9160dk_nrf9160_ns
west_board: nrf9160dk/nrf9160/ns
manifest: .ci-west-ncs.yml
binary_name: merged.hex
uses: ./.github/workflows/hil_test_zephyr.yml
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
matrix:
include:
- hil_board: esp32_devkitc_wrover
west_board: esp32_devkitc_wrover
west_board: esp32_devkitc_wrover/esp32/procpu
manifest: .ci-west-zephyr.yml
binary_blob: hal_espressif
run_tests: false
Expand All @@ -136,19 +136,19 @@ jobs:
run_tests: true

- hil_board: nrf52840dk
west_board: nrf52840dk_nrf52840
west_board: nrf52840dk/nrf52840
manifest: .ci-west-zephyr.yml
extra_twister_args: '--west-flash="--dev-id=${!SNR_VAR}"'
run_tests: true

- hil_board: nrf9160dk
west_board: nrf9160dk_nrf9160_ns
west_board: nrf9160dk/nrf9160/ns
manifest: .ci-west-ncs.yml
extra_twister_args: '--west-flash="--dev-id=${!SNR_VAR}"'
run_tests: true

- hil_board: rak5010
west_board: rak5010_nrf52840
west_board: rak5010/nrf52840
manifest: .ci-west-zephyr.yml
extra_twister_args: '--flash-before --west-flash=--gdb=/usr/bin/gdb --west-runner blackmagicprobe'
run_tests: true
Expand Down Expand Up @@ -183,7 +183,9 @@ jobs:
matrix:
include:
- west_board: native_sim
- west_board: native_sim_64
artifact_suffix: native_sim_32
- west_board: native_sim/native/64
artifact_suffix: native_sim_64
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
Expand Down Expand Up @@ -225,7 +227,7 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: twister-run-artifacts-${{ matrix.west_board }}
name: twister-run-artifacts-${{ matrix.artifact_suffix }}
path: |
reports/*
twister-out/**/*.log
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ each of the samples is also continously verified on target.
| ESP32-S3-DevKitC-1 | ESP-IDF (v5.3.0) |
| ESP32-C3-DevKitM-1 | ESP-IDF (v5.3.0) |
| ESP32-DevKitC-WROVER | ESP-IDF (v5.3.0) |
| ESP32-DevKitC-WROVER | Zephyr (v3.6.0) |
| nRF52840 DK + ESP32 | Zephyr (v3.6.0) |
| MIMXRT1024-EVK | Zephyr (v3.6.0) |
| RAK5010 | Zephyr (v3.6.0) |
| nRF9160 DK | nRF Connect SDK (v2.5.2) |
| ESP32-DevKitC-WROVER | Zephyr (v3.7.0) |
| nRF52840 DK + ESP32 | Zephyr (v3.7.0) |
| MIMXRT1024-EVK | Zephyr (v3.7.0) |
| RAK5010 | Zephyr (v3.7.0) |
| nRF9160 DK | nRF Connect SDK (v2.7.0) |
| CY8CPROTO-062-4343W | ModusToolbox (3.0.0) |
5 changes: 2 additions & 3 deletions docs/Migration_Guide_Zephyr.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@ should be increased in tandem to meet your application's needs:

```config
# Default FD settings
CONFIG_EVENTFD_MAX=6
CONFIG_POSIX_MAX_FDS=16
CONFIG_ZVFS_EVENTFD_MAX=6
CONFIG_ZVFS_OPEN_MAX=16
```

6 changes: 3 additions & 3 deletions examples/zephyr/certificate_provisioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ On your host computer open a terminal window, locate the source code of
this sample application (i.e., `examples/zephyr/certificate_provisioning`) and type:

```console
$ west build -b nrf52840dk_nrf52840 examples/zephyr/certificate_provisioning
$ west build -b nrf52840dk/nrf52840 examples/zephyr/certificate_provisioning
$ west flash
```

Expand All @@ -70,7 +70,7 @@ On your host computer open a terminal window, locate the source code of
this sample application (i.e., `examples/zephyr/certificate_provisioning`) and type:

```console
$ west build -b nrf9160dk_nrf9160_ns examples/zephyr/certificate_provisioning
$ west build -b nrf9160dk/nrf9160/ns examples/zephyr/certificate_provisioning
$ west flash
```

Expand All @@ -80,7 +80,7 @@ On your host computer open a terminal window. From the
`golioth-firmware-sdk` folder, type:

```console
$ west build -b rak5010_nrf52840 examples/zephyr/certificate_provisioning
$ west build -b rak5010/nrf52840 examples/zephyr/certificate_provisioning
$ west flash
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ CONFIG_NEWLIB_LIBC=y

CONFIG_NET_DHCPV4=y

CONFIG_MBEDTLS_ENTROPY_ENABLED=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED=y
CONFIG_MBEDTLS_ECP_ALL_ENABLED=y

CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y

CONFIG_NET_L2_WIFI_SHELL=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
CONFIG_WIFI=y
CONFIG_WIFI_ESP_AT=y
CONFIG_WIFI_ESP_AT_MDM_RX_BUF_COUNT=40
CONFIG_WIFI_ESP_AT_PASSIVE_MODE=y
CONFIG_WIFI_ESP_AT_CIPDINFO_USE=y
CONFIG_WIFI_ESP_AT_DNS_USE=y

CONFIG_NET_L2_WIFI_SHELL=y
CONFIG_GOLIOTH_SAMPLE_WIFI=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ CONFIG_NET_SOCKETS_TLS_PRIORITY=35

# Modem library
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y

# LTE connectivity with network connection manager
CONFIG_LTE_CONNECTIVITY=y
CONFIG_NRF_MODEM_LIB_NET_IF=y
CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=y
CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=y
CONFIG_NET_CONNECTION_MANAGER=y
CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024

Expand Down
8 changes: 4 additions & 4 deletions examples/zephyr/certificate_provisioning/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ tests:
extra_configs:
- CONFIG_GOLIOTH_SAMPLE_NRF91_RESET_LOOP_OVERRIDE=y
platform_allow: >
esp32_devkitc_wrover
esp32_devkitc_wrover/esp32/procpu
mimxrt1024_evk
nrf52840dk_nrf52840
nrf9160dk_nrf9160_ns
rak5010_nrf52840
nrf52840dk/nrf52840
nrf9160dk/nrf9160/ns
rak5010/nrf52840
22 changes: 17 additions & 5 deletions examples/zephyr/common/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ config DNS_SERVER1

endif # DNS_RESOLVER

if EVENTFD

config EVENTFD_MAX
configdefault ZVFS_EVENTFD_MAX
int
default 14 if GOLIOTH_FW_UPDATE
default 7

endif # EVENTFD
configdefault EVENTFD_MAX
int
default 14 if GOLIOTH_FW_UPDATE
default 7

if LOG_BACKEND_GOLIOTH

Expand All @@ -44,6 +46,10 @@ config MBEDTLS_HEAP_SIZE

endif # MBEDTLS_ENABLE_HEAP

configdefault NET_SOCKETS_DTLS_MAX_FRAGMENT_LENGTH
default 4096 if GOLIOTH_AUTH_METHOD_CERT
default 2048

if MBEDTLS_BUILTIN

config MBEDTLS_SSL_MAX_CONTENT_LEN
Expand Down Expand Up @@ -104,7 +110,13 @@ config NET_BUF_TX_COUNT
config MAIN_STACK_SIZE
default 4096

config POSIX_MAX_FDS
configdefault ZVFS_OPEN_MAX
int
default 23 if GOLIOTH_FW_UPDATE
default 16

configdefault POSIX_MAX_FDS
int
default 23 if GOLIOTH_FW_UPDATE
default 16

Expand Down
16 changes: 8 additions & 8 deletions examples/zephyr/fw_update/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ On your host computer open a terminal window, locate the source code of
this sample application (i.e., `examples/zephyr/fw_update`) and type:

```console
$ west build -b esp32_devkitc_wrover --sysbuild examples/zephyr/fw_update
$ west build -b esp32_devkitc_wrover/esp32/procpu --sysbuild examples/zephyr/fw_update
$ west flash
```

Expand Down Expand Up @@ -161,7 +161,7 @@ On your host computer open a terminal window, locate the source code of
this sample application (i.e., `examples/zephyr/fw_update`) and type:

```console
$ west build -b nrf52840dk_nrf52840 --sysbuild examples/zephyr/fw_update
$ west build -b nrf52840dk/nrf52840 --sysbuild examples/zephyr/fw_update
$ west flash
```

Expand All @@ -171,7 +171,7 @@ On your host computer open a terminal window, locate the source code of
this sample application (i.e., `examples/zephyr/hello`) and type:

```console
$ west build -b nrf9160dk_nrf9160_ns examples/zephyr/fw_update
$ west build -b nrf9160dk/nrf9160/ns examples/zephyr/fw_update
$ west flash
```

Expand All @@ -181,7 +181,7 @@ On your host computer open a terminal window. From the
`golioth-firmware-sdk` folder, type:

```console
$ west build -b rak5010_nrf52840 --sysbuild examples/zephyr/fw_update
$ west build -b rak5010/nrf52840 --sysbuild examples/zephyr/fw_update
$ west flash
```

Expand Down Expand Up @@ -217,14 +217,14 @@ Build the firmware update but do not flash it to the device. The binary
update file will be uploaded to Golioth for the OTA update.

```console
# For esp32_devkitc_wrover
$ west build -b esp32_devkitc_wrover --sysbuild examples/zephyr/fw_update
# For esp32_devkitc_wrover/esp32/procpu
$ west build -b esp32_devkitc_wrover/esp32/procpu --sysbuild examples/zephyr/fw_update

# For nRF52840dk (Zephyr):
$ west build -b nrf52840dk_nrf52840 --sysbuild examples/zephyr/fw_update
$ west build -b nrf52840dk/nrf52840 --sysbuild examples/zephyr/fw_update

# For nRF9160dk (NCS):
$ west build -b nrf9160dk_nrf9160_ns examples/zephyr/fw_update
$ west build -b nrf9160dk/nrf9160/ns examples/zephyr/fw_update
```

### Start FW Update using `goliothctl`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ CONFIG_NEWLIB_LIBC=y

CONFIG_NET_DHCPV4=y

CONFIG_MBEDTLS_ENTROPY_ENABLED=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED=y
CONFIG_MBEDTLS_ECP_ALL_ENABLED=y

CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y

CONFIG_NET_L2_WIFI_SHELL=y
Expand Down
3 changes: 3 additions & 0 deletions examples/zephyr/fw_update/boards/nrf52840dk_nrf52840.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CONFIG_WIFI=y
CONFIG_WIFI_ESP_AT=y
CONFIG_WIFI_ESP_AT_MDM_RX_BUF_COUNT=40
CONFIG_WIFI_ESP_AT_PASSIVE_MODE=y
CONFIG_WIFI_ESP_AT_CIPDINFO_USE=y
CONFIG_WIFI_ESP_AT_DNS_USE=y

CONFIG_NET_L2_WIFI_SHELL=y
CONFIG_GOLIOTH_SAMPLE_WIFI=y
Expand Down
5 changes: 3 additions & 2 deletions examples/zephyr/fw_update/boards/nrf9160dk_nrf9160_ns.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ CONFIG_NET_SOCKETS_TLS_PRIORITY=35

# Modem library
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y

# LTE connectivity with network connection manager
CONFIG_LTE_CONNECTIVITY=y
CONFIG_NRF_MODEM_LIB_NET_IF=y
CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=y
CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=y
CONFIG_NET_CONNECTION_MANAGER=y
CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024

Expand Down
6 changes: 3 additions & 3 deletions examples/zephyr/fw_update/pytest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Firmware SDK.
Build firmware for each supported device:

```
$ west build -b esp32_devkitc_wrover --sysbuild examples/zephyr/fw_update
$ west build -b nrf52840dk_nrf52840 --sysbuild examples/zephyr/fw_update
$ west build -b nrf9160dk_nrf9160_ns examples/zephyr/fw_update
$ west build -b esp32_devkitc_wrover/esp32/procpu --sysbuild examples/zephyr/fw_update
$ west build -b nrf52840dk/nrf52840 --sysbuild examples/zephyr/fw_update
$ west build -b nrf9160dk/nrf9160/ns examples/zephyr/fw_update
$ west build -b mimxrt1024_evk --sysbuild examples/zephyr/fw_update
```

Expand Down
6 changes: 3 additions & 3 deletions examples/zephyr/fw_update/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ tests:
timeout: 600
extra_args: EXTRA_CONF_FILE="../common/runtime_settings.conf"
platform_allow: >
esp32_devkitc_wrover
esp32_devkitc_wrover/esp32/procpu
mimxrt1024_evk
nrf52840dk_nrf52840
nrf52840dk/nrf52840
sample.golioth.fw_update:
harness: pytest
timeout: 720
Expand All @@ -22,7 +22,7 @@ tests:
- CONFIG_SHELL_DEFAULT_TERMINAL_WIDTH=100
- CONFIG_GOLIOTH_SAMPLE_NRF91_RESET_LOOP_OVERRIDE=y
platform_allow: >
nrf9160dk_nrf9160_ns
nrf9160dk/nrf9160/ns
sample.golioth.fw_update.buildonly:
build_only: true
sysbuild: true
Expand Down
Loading

0 comments on commit 414aa5a

Please sign in to comment.