Skip to content

Commit 3ac3a53

Browse files
José Mendeshubmartin
José Mendes
authored andcommitted
applications: clime: Port to Cloud V2
1 parent 12023bc commit 3ac3a53

20 files changed

+1029
-701
lines changed

applications/clime/CMakeLists.txt

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
cmake_minimum_required(VERSION 3.20.0)
88

99
# Supported shields: ctr_ds18b20 ctr_lrw ctr_lte ctr_rtd_a ctr_rtd_b ctr_s1 ctr_s2 ctr_soil_sensor ctr_x4_a ctr_x4_b ctr_x10 ctr_z
10-
set(SHIELD ctr_lrw ctr_lte ctr_s2)
10+
set(SHIELD ctr_lrw ctr_lte_v2 ctr_s2)
11+
set(ENV{FW_BUNDLE} "com.hardwario.chester.app.clime")
12+
set(ENV{FW_NAME} "CHESTER Clime")
1113

1214
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
1315
project(clime)
1416

1517
add_custom_command(
16-
COMMAND ../../../scripts/gen-msg-key.py ../codec/cbor-decoder.yaml ../src/msg_key.h
17-
OUTPUT ../src/msg_key.h
18-
MAIN_DEPENDENCY ../codec/cbor-decoder.yaml
18+
COMMAND west gen-codec -d ../codec/cbor-decoder.yaml -e ../codec/cbor-encoder.yaml -o ../src/app_codec.h
19+
OUTPUT ../src/app_codec.h
20+
DEPENDS ../codec/cbor-decoder.yaml
1921
)
2022

2123
target_sources(app PRIVATE src/app_tamper.c)
@@ -33,4 +35,4 @@ target_sources(app PRIVATE src/app_work.c)
3335

3436
target_sources(app PRIVATE src/main.c)
3537

36-
target_sources(app PRIVATE src/msg_key.h)
38+
target_sources(app PRIVATE src/app_codec.h)

applications/clime/VERSION

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
VERSION_MAJOR = 3
2+
VERSION_MINOR = 0
3+
PATCHLEVEL = 0
4+
VERSION_TWEAK = 0
5+
EXTRAVERSION = dev

applications/clime/app.overlay

+40
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,44 @@
88
zephyr,user {
99
tamper-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
1010
};
11+
12+
chosen {
13+
nordic,pm-ext-flash = &spi_flash0;
14+
};
15+
};
16+
17+
&spi_flash0 {
18+
partitions {
19+
compatible = "fixed-partitions";
20+
#address-cells = <1>;
21+
#size-cells = <1>;
22+
23+
littlefs_storage: partition@0 {
24+
label = "littlefs_storage";
25+
26+
/*
27+
* This size doesn't matter due to Nordic's partition
28+
* manager; For the sake of consistency this should
29+
* match the configured size
30+
*/
31+
reg = <0x00000000 0x730000>;
32+
};
33+
};
34+
};
35+
36+
/ {
37+
fstab {
38+
compatible = "zephyr,fstab";
39+
lfs1: lfs1 {
40+
compatible = "zephyr,fstab,littlefs";
41+
mount-point = "/lfs1";
42+
partition = <&littlefs_storage>;
43+
automount;
44+
read-size = <16>;
45+
prog-size = <16>;
46+
cache-size = <64>;
47+
lookahead-size = <32>;
48+
block-cycles = <512>;
49+
};
50+
};
1151
};

applications/clime/child_image/mcuboot.conf

+5
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
55
#
66

7+
CONFIG_BOOT_MAX_IMG_SECTORS=4096
8+
CONFIG_BOOT_SWAP_USING_SCRATCH=y
79
CONFIG_MULTITHREADING=y
10+
CONFIG_SPI=y
11+
12+
CONFIG_MCUBOOT_ACTION_HOOKS=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2023 HARDWARIO a.s.
3+
*
4+
* SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
nordic,pm-ext-flash = &spi_flash0;
10+
};
11+
};

0 commit comments

Comments
 (0)