Skip to content

Commit

Permalink
samples: Add 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 29, 2024
1 parent ba92fa3 commit 6a146dc
Show file tree
Hide file tree
Showing 186 changed files with 4,685 additions and 2,063 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
44 changes: 37 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SWSD006 - LR11xx Multi-stack Software Development Kit for nRF52840
# SWSD006 - LR11xx Multi-stack Software Development Kit for nRF52840 & nRF54L15

SWSD006 is a collection of driver, protocol stack and utility software that facilitates development of Sidewalk
applications. The software includes numerous examples of how to leverage the unique capabilities of Semtech's LR11xx silicon.
While the software targets the Nordic nRF52840 MCU, it is designed and distributed as a "full-source" offering, it enables users to modify
While the software targets the Nordic SoC, it is designed and distributed as a "full-source" offering, it enables users to modify
the contents across multiple layers of software stack. Potential modifications include re-targeting of host MCU and LR11xx silicon,
changes to the platform abstraction layer and enhancement of the packet fragmentation scheme.
Please note that while software enhancement is enabled and encouraged, validation of described functionality was exclusively performed on the specified silicon variants and software component versions.
Expand All @@ -11,7 +11,7 @@ This repository implements the following functionality:
- LR11xx transceiver silicon support for Sidewalk MAC v1.16 CSS and FSK modulation
- Drivers and examples demonstrating WIFI/GNSS NAV3 geolocation features of LR11xx silicon
- LoRaWAN Class A multi-stack operation using SWL2001 - LoRa Basics Modem 4.5.0; programmatic control over both LoRaWAN and Sidewalk stacks in one firmware image
- LR11xx transceiver firmware upgrade via SWTL001 port to nRF52840
- LR11xx transceiver firmware upgrade via SWTL001 port to nRF52840 (or nRF54L15)
- LoRaWAN Class A + WIFI/GNSS NAV3 operation example
- An example of packet fragmentation and re-assembly (overcomes CSS packet size limitations in Sidewalk)
- AWS lambda example code demonstrating End-to-End handling of LoRa EDGE application data: from transceiver to cloud service
Expand Down 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 All @@ -55,26 +56,55 @@ LR1121 device would typically be used with an XTAL, since it doesnt have GNSS fu
All radio other configuration is declared in ``app_subGHz_config_lr11xx.c``, For example if you wanted to use the radio's LDO instead of it's DC-DC, you can modify the ``.regulator_mode = `` to ``LR11XX_SYSTEM_REG_MODE_LDO``
### Available example applications:
all example apps are built using ``west build -b <board> -- -DOVERLAY_CONFIG=foobar.conf``. The app to build is selected by adding ``-- -DOVERLAY_CONFIG=foobar.conf``
* the full build command, for example: ``west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-nav3sid.conf``
#### apps provided by Nordic:
* the full build command, for example:
| Hardware platforms | Board name | Build command |
| -------------- | ---------- | -------------- |
| nRF52840 DK | nrf52840dk | ``west build -p -b nrf52840dk/nrf52840 -- -DOVERLAY_CONFIG=overlay-nav3sid.conf`` |
| nRF54L15 PDK | nrf54l15pdk | ``west build -p -b nrf54l15pdk/nrf54l15/cpuapp -- -DOVERLAY_CONFIG=overlay-nav3sid.conf`` |

#### nRF54L15 PDK pinout:
For nRF54L15 PDK revision v0.3.0/0.7.0 use the following GPIO configuration:

| nRF54L15 PDK | LR1110MB1LCKS |
| -------------- | ---------- |
| P2.06 | SCK |
| P1.11 | MISO |
| P2.08 | MOSI |
| P2.10 | CS |
| P0.02 | LR_NRESET |
| P0.00 | BUSY |
| P0.01 | ACC_INT1 |
| P0.03 | DIO9 |
| P1.12 | LNA_CTRL_MCU |

> **NOTE**
>
> To use the suggested pins, disable ``VCOM0`` (not used by samples) through the [Board Configurator](https://docs.nordicsemi.com/bundle/nrf-connect-board-configurator/page/index.html) tool in the nRF Connect for Desktop.
> This step is required for the shield to work as some pins are connected to ``VCOM0`` by default.
>
> See the picture below for ``VCOM0`` suggested configuration:
> ![VCOM0 configuration](./pics/board_configurator_nrf54l15_0_3_0.png)
#### Apps provided by Nordic:
from the directory ``samples/sid_end_device`` enables LR11xx in ``prj.conf`` -->
* hello
* ``-DOVERLAY_CONFIG=overlay-hello.conf``
* sensor_monitoring
* ``-DOVERLAY_CONFIG=overlay-demo.conf``
* dut, aka ``sid_dut``
* ``-DOVERLAY_CONFIG=overlay-dut.conf``
#### apps added by Semtech:
#### Apps added by Semtech:
from the directory ``samples/lbm_sid_end_device`` -->
* lora basics modem (lorawan end device), running in sidewalk environment
* ``-DOVERLAY_CONFIG=overlay-lbm.conf``
* 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


## GNSS Performance Evaluation Notice

The included GNSS example source code is provided solely to demonstrate the GNSS scan functionality under ideal conditions. The source code and GNSS scan results are not representative of the optimal configuration or performance characteristics of the silicon. The LR11xx product family is flexible and can be embodied and configured in a multitude of ways to realize various trade-offs regarding performance, battery life, PCB size, cost, etc. The GNSS example included in this release and the corresponding evaluation kits are designed & configured by the included source code in a default capacity which is sufficient to demonstrate functional GNSS scan capability only. Care must be taken if/when attempting to assess performance characteristics of GNSS scan functionality and we strongly encourage those conducting such analysis to contact Semtech via the provided support channels so that we can ensure appropriate configuration settings are employed for a given performance evaluation use-case.
Expand Down
Binary file added pics/board_configurator_nrf54l15_0_3_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading

0 comments on commit 6a146dc

Please sign in to comment.