Skip to content

Commit

Permalink
Merge pull request #11 from IRNAS/release/v1.2.0
Browse files Browse the repository at this point in the history
Release v1.2.0
  • Loading branch information
TjazVracko authored May 31, 2023
2 parents 63d0a83 + 3c521f3 commit 180bbc0
Show file tree
Hide file tree
Showing 18 changed files with 41,777 additions and 4 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [1.2.0] - 2023-05-31

### Added

- Firmware update sample

## [1.1.0] - 2023-02-07

### Changed
Expand Down Expand Up @@ -33,7 +39,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- WiFi scan sample.
- Modified ping-pong sample with signal reporting for LR 868 MHz, LR 2.4 GHz and BT signal strength.

[Unreleased]: https://github.com/IRNAS/SWDR001-Zephyr/compare/v1.1.0...HEAD
[Unreleased]: https://github.com/IRNAS/SWDR001-Zephyr/compare/v1.2.0...HEAD

[1.2.0]: https://github.com/IRNAS/SWDR001-Zephyr/compare/v1.1.0...v1.2.0

[1.1.0]: https://github.com/IRNAS/SWDR001-Zephyr/compare/v1.0.0...v1.1.0

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The `samples` folder contains functional samples compatible with SWSD003 Semtech

## Installation

This driver was written and tested for nrf-sdk v2.0.1
This driver was written and tested for nrf-sdk v2.2.0

To install, modify your project's `west.yml` and add the following sections:

Expand All @@ -29,12 +29,12 @@ To install, modify your project's `west.yml` and add the following sections:
2. In the `projects` section add at the bottom (select revision you need):

```
```yaml
- name: SWDR001-Zephyr
repo-path: SWDR001-Zephyr
path: irnas/SWDR001-Zephyr
remote: irnas
revision: dev
revision: v1.1.0
```

Then run `west update` in your freshly created bash/command prompt session.
Expand Down
14 changes: 14 additions & 0 deletions samples/firmware_update/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)

find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
project(almanac_update)

zephyr_compile_options(-fdiagnostics-color=always)

target_sources(app PRIVATE src/main.c)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common src/common)

add_subdirectory(src/firmware_update)
add_subdirectory(src/firmware_images)
16 changes: 16 additions & 0 deletions samples/firmware_update/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

choice
prompt "Choose LR11XX update type"
optional

config UPDATE_LR1110
bool "Update lr1110 to latest transciever firmware"

config UPDATE_LR1120
bool "Update lr1120 to latest transciever firmware"

endchoice

menu "Zephyr Kernel"
source "$ZEPHYR_BASE/Kconfig.zephyr"
endmenu
12 changes: 12 additions & 0 deletions samples/firmware_update/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# LR11xx Firmware update example

Based on [SWTL001](https://github.com/Lora-net/SWTL001).

## Description

In `prj.conf`, select either `CONFIG_UPDATE_LR1110` or `CONFIG_UPDATE_LR1120`.

The sample will update the connected lr11xx to the latest transceiver firmware available for the selected chip type. See `src/firmware_images`
and the top of `main.c` to see which firmware will be flashed.

The sample will print a success or error message at the end.
51 changes: 51 additions & 0 deletions samples/firmware_update/boards/nrf52840dk_nrf52840.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include <lr11xx_bindings_def.h>
&spi1 {
status = "disabled";
};

&spi2 {
compatible = "nordic,nrf-spi";
status = "okay";
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";

cs-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
lr1120: lr1120@0 {
compatible = "irnas,lr11xx";
reg = <0>;
spi-max-frequency = <4000000>;
label = "LR1120";

reset-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
gps-lna-en-gpios = <&gpio0 29 0>;
busy-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
event-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN) >;

rf-sw-enable = <(LR11XX_DIO5 | LR11XX_DIO6 | LR11XX_DIO7)>;
rf-sw-rx-mode = <LR11XX_DIO5>;
rf-sw-tx-mode = <(LR11XX_DIO5 | LR11XX_DIO6)>;
rf-sw-tx-hp-mode = <LR11XX_DIO6>;
rf-sw-gnss-mode = <LR11XX_DIO7>;
};
};

&pinctrl {
spi2_default: spi2_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>;
};
};

spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>;
low-power-enable;
};
};
};

25 changes: 25 additions & 0 deletions samples/firmware_update/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Enable logging (it need to be disabled for low power)
CONFIG_PRINTK=y
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_LOG_BACKEND_UART=y

CONFIG_SPI=y
CONFIG_LR11XX_LIB=y
CONFIG_LR11XX_LOG_LEVEL_INF=y

CONFIG_PINCTRL=y

CONFIG_ASSERT=y
CONFIG_DEBUG=y

CONFIG_MAIN_STACK_SIZE=4096

# Configure weather you are updating lr1110 or lr1120
# This will automatically include the latest transciever firmware for that chip
# in main.c
CONFIG_UPDATE_LR1110=y
1 change: 1 addition & 0 deletions samples/firmware_update/src/firmware_images/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zephyr_include_directories(.)
Loading

0 comments on commit 180bbc0

Please sign in to comment.