Skip to content

Commit c8bc264

Browse files
DematteisGiacomorlubos
authored andcommitted
applications: asset_tracker_v2: add 9151 support
Add nRF9151 support in asset_tracker_v2. Signed-off-by: Giacomo Dematteis <[email protected]>
1 parent 8f54acd commit c8bc264

File tree

5 files changed

+189
-0
lines changed

5 files changed

+189
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# This file is merged with prj.conf in the application folder, and options
8+
# set here will take precedence if they are present in both files.
9+
10+
# CAF - Common Application Framework
11+
CONFIG_GPIO=y
12+
CONFIG_LED_GPIO=y
13+
14+
# Enable external flash
15+
CONFIG_SPI=y
16+
CONFIG_SPI_NOR=y
17+
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
18+
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
/delete-node/ leds;
9+
10+
leds0 {
11+
compatible = "gpio-leds";
12+
status = "okay";
13+
label = "LED0";
14+
led0: led_0 {
15+
status = "okay";
16+
gpios = <&gpio0 0 0>;
17+
label = "Green LED 1";
18+
};
19+
};
20+
21+
leds1 {
22+
compatible = "gpio-leds";
23+
status = "okay";
24+
label = "LED1";
25+
led1: led_1 {
26+
gpios = <&gpio0 1 0>;
27+
label = "Green LED 2";
28+
};
29+
};
30+
31+
leds2 {
32+
compatible = "gpio-leds";
33+
status = "okay";
34+
label = "LED2";
35+
led2: led_2 {
36+
gpios = <&gpio0 4 0>;
37+
label = "Green LED 3";
38+
};
39+
};
40+
41+
leds3 {
42+
compatible = "gpio-leds";
43+
status = "okay";
44+
label = "LED3";
45+
led3: led_3 {
46+
gpios = <&gpio0 5 0>;
47+
label = "Green LED 4";
48+
};
49+
};
50+
51+
/* Configure partition manager to use gd25wb256 as the external flash */
52+
chosen {
53+
nordic,pm-ext-flash = &gd25wb256;
54+
};
55+
56+
aliases {
57+
ext-flash = &gd25wb256;
58+
};
59+
};
60+
61+
&gd25wb256 {
62+
status = "okay";
63+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# MCUboot config to enable secondary slot on the external flash
8+
9+
CONFIG_FLASH=y
10+
CONFIG_SPI=y
11+
CONFIG_SPI_NOR=y
12+
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
13+
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
14+
15+
CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x13E00
16+
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
17+
18+
CONFIG_MULTITHREADING=y
19+
CONFIG_MAIN_STACK_SIZE=2048
20+
CONFIG_BOOT_MAX_IMG_SECTORS=256
21+
22+
# Use minimal C library instead of the Picolib
23+
CONFIG_MINIMAL_LIBC=y
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
&gd25wb256 {
8+
status = "okay";
9+
};
10+
11+
/ {
12+
/* Configure partition manager to use gd25wb256 as the external flash */
13+
chosen {
14+
nordic,pm-ext-flash = &gd25wb256;
15+
};
16+
};
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include <caf/led_effect.h>
8+
#include "events/led_state_event.h"
9+
10+
/* This configuration file is included only once from led_state module and holds
11+
* information about LED effects associated with Asset Tracker v2 states.
12+
*/
13+
14+
/* This structure enforces the header file to be included only once in the build.
15+
* Violating this requirement triggers a multiple definition error at link time.
16+
*/
17+
const struct {} led_state_def_include_once;
18+
19+
enum led_id {
20+
LED_ID_1,
21+
LED_ID_2,
22+
LED_ID_3,
23+
LED_ID_4,
24+
25+
LED_ID_COUNT,
26+
27+
LED_ID_CONNECTING = LED_ID_1,
28+
LED_ID_CLOUD_CONNECTING = LED_ID_3,
29+
LED_ID_SEARCHING = LED_ID_2,
30+
LED_ID_PUBLISHING = LED_ID_3,
31+
LED_ID_ASSOCIATING = LED_ID_3,
32+
LED_ID_ASSOCIATED = LED_ID_3,
33+
LED_ID_FOTA_1 = LED_ID_1,
34+
LED_ID_FOTA_2 = LED_ID_2,
35+
LED_ID_PASSIVE_MODE_1 = LED_ID_3,
36+
LED_ID_PASSIVE_MODE_2 = LED_ID_4,
37+
LED_ID_ACTIVE_MODE = LED_ID_4,
38+
};
39+
40+
#define LED_PERIOD_NORMAL 350
41+
#define LED_PERIOD_RAPID 100
42+
#define LED_TICKS_DOUBLE 2
43+
#define LED_TICKS_TRIPLE 3
44+
45+
static const struct led_effect asset_tracker_led_effect[] = {
46+
[LED_STATE_LTE_CONNECTING] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL,
47+
LED_COLOR(100, 100, 100)),
48+
[LED_STATE_LOCATION_SEARCHING] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL,
49+
LED_COLOR(100, 100, 100)),
50+
[LED_STATE_CLOUD_PUBLISHING] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL,
51+
LED_COLOR(100, 100, 100)),
52+
[LED_STATE_CLOUD_CONNECTING] = LED_EFFECT_LED_CLOCK(LED_TICKS_TRIPLE,
53+
LED_COLOR(100, 100, 100)),
54+
[LED_STATE_CLOUD_ASSOCIATING] = LED_EFFECT_LED_CLOCK(LED_TICKS_DOUBLE,
55+
LED_COLOR(100, 100, 100)),
56+
[LED_STATE_CLOUD_ASSOCIATED] = LED_EFFECT_LED_ON_GO_OFF(LED_COLOR(100, 100, 100),
57+
LED_PERIOD_NORMAL,
58+
LED_PERIOD_RAPID),
59+
[LED_STATE_ACTIVE_MODE] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL,
60+
LED_COLOR(100, 100, 100)),
61+
[LED_STATE_PASSIVE_MODE] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL,
62+
LED_COLOR(100, 100, 100)),
63+
[LED_STATE_ERROR_SYSTEM_FAULT] = LED_EFFECT_LED_BLINK(LED_PERIOD_NORMAL,
64+
LED_COLOR(100, 100, 100)),
65+
[LED_STATE_FOTA_UPDATING] = LED_EFFECT_LED_BLINK(LED_PERIOD_RAPID,
66+
LED_COLOR(100, 100, 100)),
67+
[LED_STATE_FOTA_UPDATE_REBOOT] = LED_EFFECT_LED_ON(LED_COLOR(100, 100, 100)),
68+
[LED_STATE_TURN_OFF] = LED_EFFECT_LED_OFF(),
69+
};

0 commit comments

Comments
 (0)