Skip to content

Commit

Permalink
samples: Adde support for nRF54L
Browse files Browse the repository at this point in the history
Update NCS version and add nRF54L support.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
  • Loading branch information
MarGasiorek committed Aug 28, 2024
1 parent ba92fa3 commit 7a7478d
Show file tree
Hide file tree
Showing 185 changed files with 4,650 additions and 2,057 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(CONFIG_RADIO_LR11XX)
message( STATUS "patch needs to be applied? ret=" ${ret})
Set(script_name ${CMAKE_CURRENT_SOURCE_DIR}/scripts/patch_ng.py)
Set(args "-p 1")
Set(pfile ${CMAKE_CURRENT_SOURCE_DIR}/v261_nRF52840_sidewalk_lr11xx.diff)
Set(pfile ${CMAKE_CURRENT_SOURCE_DIR}/v270_sidewalk_lr11xx.diff)
execute_process(
COMMAND ${Python3_EXECUTABLE} ${script_name} ${args} ${pfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sidewalk
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ west init -m https://github.com/Lora-net/SWSD006 --mr v2.6.1 my-workspace
# update nRF Connect SDK modules
cd my-workspace
west update
west config build.sysbuild True
```
If you intend to build a LoRa Basics Modem project on the windows platform, decide on a workspace location as near the root directory as possible in order to prevent path lengths that exceed the capability of the zephyr build system on windows. This is not a concern on other platforms such as linux.
### configuring project for LR11xx
Expand Down Expand Up @@ -71,7 +72,7 @@ from the directory ``samples/lbm_sid_end_device`` -->
* NAV3 running simultanously with sidewalk (aka NAV3 in bypass mode):
* ``-DOVERLAY_CONFIG=overlay-nav3sid.conf``
* NAV3 running in lora basics modem:
* `-DOVERLAY_CONFIG=overlay-nav3lbm.conf``
* ``-DOVERLAY_CONFIG=overlay-nav3lbm.conf``
* LR11xx firmware update, and almanac erase:
* build in ``samples/SWTL001``directory

Expand Down
34 changes: 11 additions & 23 deletions samples/SWTL001/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@

cmake_minimum_required(VERSION 3.20.0)

# Sidewalk version
include(bootloader_version.cmake)

# Child images
set(hci_ipc_KCONFIG_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/child_image/hci_ipc/Kconfig.root)
set(mcuboot_KCONFIG_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/child_image/mcuboot/Kconfig.root)

# Configurations
if(CONF_FILE)
get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME)
endif()

if("${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf")
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/pm_static_no_dfu.yml)
else()
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml)
endif()

# Zephyr CMake project
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(sidewalk_sid_end_device)
Expand All @@ -34,25 +16,31 @@ target_sources(app PRIVATE
src/main.c
)

target_sources_ifdef(CONFIG_SIDEWALK_FILE_TRANSFER app PRIVATE
src/sbdt/file_transfer.c
src/sbdt/scratch_buffer.c
)

if(CONFIG_SID_END_DEVICE_SWTL001)
target_sources(app PRIVATE
src/swtl001/app.c
src/swtl001/lr11xx_firmware_update.c
src/swtl001/lr11xx_firmware_update.c
)
else()
message(SEND_ERROR "only swtl001")
message(SEND_ERROR "only swtl001")
endif()

if(CONFIG_SID_END_DEVICE_CLI)
target_sources(app PRIVATE
src/cli/app_dut.c
src/cli/app_shell.c
)
target_sources_ifdef(CONFIG_SIDEWALK_ON_DEV_CERT app PRIVATE src/cli/sid_on_dev_cert_cli.c)
endif()

if(CONFIG_SMTC_CLI)
target_sources(app PRIVATE
src/cli/smtc_shell.c
)
target_compile_definitions(app PRIVATE CONFIG_SMTC_CLI)
src/cli/smtc_shell.c
)
target_compile_definitions(app PRIVATE CONFIG_SMTC_CLI)
endif()
57 changes: 53 additions & 4 deletions samples/SWTL001/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ config SID_END_DEVICE_SWTL001
bool "LR11xx firmware update application"
endchoice #SID_END_DEVICE

if SID_END_DEVICE_HELLO

config SID_END_DEVICE_ECHO_MSGS
bool "Eable message echo feature"
default y
help
Echo received messages back to Sidewlak cloud.
Works with GET and SET messages types.

endif #SID_END_DEVICE_HELLO

if SID_END_DEVICE_SENSOR_MONITORING

rsource "Kconfig.sensor_monitoring"

endif #SID_END_DEVICE_SENSOR_MONITORING

config SID_END_DEVICE_CLI
bool "Enable Sidewalk CLI (DUT)"
imply SHELL
Expand All @@ -21,10 +38,10 @@ config SID_END_DEVICE_CLI
The interface commands are compatilbe with former dut sample.

config SMTC_CLI
bool "enable semtech CLI"
imply SHELL
help
Enables semtech radio command line interface.
bool "enable semtech CLI"
imply SHELL
help
Enables semtech radio command line interface.

config SID_END_DEVICE_AUTO_START
default y
Expand All @@ -45,6 +62,38 @@ config SID_END_DEVICE_EVENT_HEAP_SIZE
int "Heap for Sidewalk event contexts"
default 2048

config SIDEWALK_FILE_TRANSFER
select EXPERIMENTAL
bool "Enable Sidewalk file transfer"
help
Add support for Sidewalk Bulk Data Transfer (SBDT)
in application.

if SIDEWALK_FILE_TRANSFER

config SIDEWALK_FILE_TRANSFER_HEAP_SIZE
int "Sidewalk file transfer heap size"
default 10240
help
Heap size in bytes to be allocated
for Sidewalk Bulk Data Transfer (SBDT).

config SIDEWALK_FILE_TRANSFER_DFU
bool "Sildewak file transfer and dfu"
default SIDEWALK_FILE_TRANSFER
imply SIDEWALK_DFU_IMG_UTILS
imply DFU_MULTI_IMAGE
imply DFU_TARGET
imply DFU_TARGET_MCUBOOT
imply STREAM_FLASH
imply STREAM_FLASH_ERASE
imply SIDEWALK_THREAD_QUEUE_TIMEOUT
help
Save recived data to flash. Expect CBOR manifest.
Autoatically reset device after file transfer.

endif

rsource "Kconfig.defconfig"

source "Kconfig.zephyr"
36 changes: 36 additions & 0 deletions samples/SWTL001/Kconfig.sensor_monitoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config SID_END_DEVICE_NOTIFY_DATA_PERIOD_MS
int "Notify period of sensor monitoring demo app"
default 10000

config SIDEWALK_THREAD_PRIORITY
default 12

config SID_END_DEVICE_TX_THREAD_PRIORITY
int
default 13

config SID_END_DEVICE_RX_THREAD_PRIORITY
int
default 14

config SID_END_DEVICE_TX_THREAD_STACK_SIZE
int
default 4096

config SID_END_DEVICE_RX_THREAD_STACK_SIZE
int
default 4096

config SID_END_DEVICE_TX_THREAD_QUEUE_SIZE
int
default 10

config SID_END_DEVICE_RX_THREAD_QUEUE_SIZE
int
default 4
54 changes: 54 additions & 0 deletions samples/SWTL001/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config NRF_DEFAULT_IPC_RADIO
default y if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP

choice BOOTLOADER
default BOOTLOADER_MCUBOOT
endchoice

if BOOTLOADER_MCUBOOT

config DFU_MULTI_IMAGE_PACKAGE_BUILD
default y

config DFU_MULTI_IMAGE_PACKAGE_APP
default y

if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP)

config MCUBOOT_UPDATEABLE_IMAGES
default 2

choice MCUBOOT_MODE
default MCUBOOT_MODE_OVERWRITE_ONLY
endchoice

choice BOOT_SIGNATURE_TYPE
default BOOT_SIGNATURE_TYPE_RSA
endchoice

config SECURE_BOOT
default y

config SECURE_BOOT_NETCORE
default y

config NETCORE_APP_UPDATE
default y

config DFU_MULTI_IMAGE_PACKAGE_NET
default y

endif # BOOTLOADER_MCUBOOT

endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP)

config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
31 changes: 31 additions & 0 deletions samples/SWTL001/boards/nrf52840dk_nrf52840.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,37 @@ sid_semtech: &spi2 {
};

/{
state_notifier_gpios{
compatible = "gpio-keys";
state_notifier_error: error {
gpios = <&gpio1 0x7 0x0>;
label = "Application state error";
};
state_notifier_dfu: dfu {
gpios = <&gpio1 0x1 0x0>;
label = "Application state dfu";
};
state_notifier_sending: sending {
gpios = <&gpio1 0x3 0x0>;
label = "Application state sending";
};
state_notifier_receiving: receiving {
gpios = <&gpio1 0x2 0x0>;
label = "Application state receiving";
};
};

aliases {
state-notifier-connected = &led0;
state-notifier-time-sync = &led1;
state-notifier-registered = &led2;
state-notifier-working = &led3;
state-notifier-error = &state_notifier_error;
state-notifier-dfu = &state_notifier_dfu;
state-notifier-sending = &state_notifier_sending;
state-notifier-receiving = &state_notifier_receiving;
};

semtech_sx1262_gpios{
compatible = "gpio-keys";
semtech_sx1262_cs: cs {
Expand Down
31 changes: 31 additions & 0 deletions samples/SWTL001/boards/nrf5340dk_nrf5340_cpuapp.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,37 @@
};

/{
state_notifier_gpios{
compatible = "gpio-keys";
state_notifier_error: error {
gpios = <&gpio1 0x8 0x0>;
label = "Application state error";
};
state_notifier_dfu: dfu {
gpios = <&gpio1 0x2 0x0>;
label = "Application state dfu";
};
state_notifier_sending: sending {
gpios = <&gpio1 0x4 0x0>;
label = "Application state sending";
};
state_notifier_receiving: receiving {
gpios = <&gpio1 0x3 0x0>;
label = "Application state receiving";
};
};

aliases {
state-notifier-connected = &led0;
state-notifier-time-sync = &led1;
state-notifier-registered = &led2;
state-notifier-working = &led3;
state-notifier-error = &state_notifier_error;
state-notifier-dfu = &state_notifier_dfu;
state-notifier-sending = &state_notifier_sending;
state-notifier-receiving = &state_notifier_receiving;
};

semtech_sx1262_gpios{
compatible = "gpio-keys";
semtech_sx1262_cs: cs {
Expand Down
13 changes: 13 additions & 0 deletions samples/SWTL001/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Workaround:
# The nRF54L15 PDK (PCA10156) revisions v0.2.0 AA0-ES2, v0.2.0 AA0-ES3,
# and v0.2.1 AB0-ES5 have Buttons 3 and 4 connected to the GPIO port
# which does not support interrupts.
CONFIG_DK_LIBRARY_BUTTON_NO_ISR=y

CONFIG_SOC_FLASH_NRF_TIMEOUT_MULTIPLIER=100
Loading

0 comments on commit 7a7478d

Please sign in to comment.