Skip to content

Commit 4499196

Browse files
committed
subsys: ctr_lte_v2: Add LTE v2 + shield + sample + FOTA
1 parent 908fcb2 commit 4499196

File tree

114 files changed

+13429
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+13429
-679
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
.DS_Store?
33
build/
4-
scripts/west_commands/__pycache__/*.pyc
54
doc/html
65
doc/latex
6+
scripts/west_commands/__pycache__/*.pyc
7+
twister-out*

.gitlab-ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ build:
1616
- west init -l --mf west.yml chester
1717
- west update
1818
- west config build.board chester_nrf52840
19+
- ./zephyr/scripts/twister --testsuite-root chester/tests -c -i
1920
- |
2021
for sample in chester/samples/*/
2122
do

applications/demo/CMakeLists.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Copyright (c) 2023 HARDWARIO a.s.
3+
#
4+
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
set(SHIELD ctr_lte_v2)
10+
set(ENV{FW_BUNDLE} "com.hardwario.chester.app.demo")
11+
set(ENV{FW_NAME} "CHESTER Demo")
12+
13+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
14+
15+
project(app)
16+
17+
target_sources(app PRIVATE src/app_cbor.c)
18+
target_sources(app PRIVATE src/app_config.c)
19+
target_sources(app PRIVATE src/app_data.c)
20+
target_sources(app PRIVATE src/app_handler.c)
21+
target_sources(app PRIVATE src/app_init.c)
22+
target_sources(app PRIVATE src/app_power.c)
23+
target_sources(app PRIVATE src/app_sensor.c)
24+
target_sources(app PRIVATE src/app_shell.c)
25+
target_sources(app PRIVATE src/app_work.c)
26+
27+
target_sources(app PRIVATE src/main.c)

applications/demo/Kconfig

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (c) 2023 HARDWARIO a.s.
3+
#
4+
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
5+
#
6+
7+
menu "Application"
8+
9+
config APP_REPORT_JITTER
10+
bool "Add random time jitter to report transfers"
11+
default y
12+
select ENTROPY_GENERATOR
13+
14+
config APP_TAMPER
15+
bool "Enable tamper functionality"
16+
default y
17+
select CTR_EDGE
18+
19+
endmenu
20+
21+
menu "Zephyr Kernel"
22+
source "Kconfig.zephyr"
23+
endmenu

applications/demo/VERSION

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
VERSION_MAJOR = 1
2+
VERSION_MINOR = 0
3+
PATCHLEVEL = 0
4+
VERSION_TWEAK = 0
5+
EXTRAVERSION = dev
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
};
12+
13+
&spi_flash0 {
14+
partitions {
15+
compatible = "fixed-partitions";
16+
#address-cells = <1>;
17+
#size-cells = <1>;
18+
19+
littlefs_storage: partition@0 {
20+
label = "littlefs_storage";
21+
22+
/*
23+
* This size doesn't matter due to Nordic's partition
24+
* manager; For the sake of consistency this should
25+
* match the configured size
26+
*/
27+
reg = <0x00000000 0x730000>;
28+
};
29+
};
30+
};
31+
32+
/ {
33+
fstab {
34+
compatible = "zephyr,fstab";
35+
lfs1: lfs1 {
36+
compatible = "zephyr,fstab,littlefs";
37+
mount-point = "/lfs1";
38+
partition = <&littlefs_storage>;
39+
automount;
40+
read-size = <16>;
41+
prog-size = <16>;
42+
cache-size = <64>;
43+
lookahead-size = <32>;
44+
block-cycles = <512>;
45+
};
46+
};
47+
};
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2023 HARDWARIO a.s.
3+
#
4+
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
5+
#
6+
7+
CONFIG_BOOT_MAX_IMG_SECTORS=4096
8+
CONFIG_BOOT_SWAP_USING_SCRATCH=y
9+
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+
};
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 2
2+
type: decoder
3+
name: com.hardwario.chester.app.demo
4+
schema:
5+
- message:
6+
- sequence:
7+
- timestamp:
8+
- system:
9+
- uptime:
10+
- voltage_rest:
11+
- $div: 1000
12+
- $fpp: 2
13+
- voltage_load:
14+
- $div: 1000
15+
- $fpp: 2
16+
- current_load:
17+
- thermometer:
18+
- temperature:
19+
- $div: 100
20+
- $fpp: 2
21+
- accelerometer:
22+
- acceleration_x:
23+
- $div: 1000
24+
- $fpp: 2
25+
- acceleration_y:
26+
- $div: 1000
27+
- $fpp: 2
28+
- acceleration_z:
29+
- $div: 1000
30+
- $fpp: 2
31+
- orientation:
32+
- buffer:
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
type: encoder
3+
name: com.hardwario.chester.app.demo
4+
schema:
5+
- led_r:
6+
- $type: int
7+
- led_g:
8+
- $type: int
9+
- led_y:
10+
- $type: int
11+
- led_load:
12+
- $type: int

applications/demo/pm_static.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
app:
2+
address: 0xc200
3+
end_address: 0xdc000
4+
region: flash_primary
5+
size: 0xcfe00
6+
external_flash:
7+
address: 0x730000
8+
end_address: 0x800000
9+
region: external_flash
10+
size: 0x0
11+
littlefs_storage:
12+
address: 0xd0000
13+
device: DT_CHOSEN(nordic_pm_ext_flash)
14+
end_address: 0x800000
15+
placement:
16+
before:
17+
- tfm_storage
18+
- end
19+
region: external_flash
20+
size: 0x730000
21+
mcuboot:
22+
address: 0x0
23+
end_address: 0xc000
24+
placement:
25+
before:
26+
- mcuboot_primary
27+
region: flash_primary
28+
size: 0xc000
29+
mcuboot_pad:
30+
address: 0xc000
31+
end_address: 0xc200
32+
placement:
33+
align:
34+
start: 0x1000
35+
before:
36+
- mcuboot_primary_app
37+
region: flash_primary
38+
size: 0x200
39+
mcuboot_primary:
40+
address: 0xc000
41+
end_address: 0xdc000
42+
orig_span: &id001
43+
- app
44+
- mcuboot_pad
45+
region: flash_primary
46+
size: 0xd0000
47+
span: *id001
48+
mcuboot_primary_app:
49+
address: 0xc200
50+
end_address: 0xdc000
51+
orig_span: &id002
52+
- app
53+
region: flash_primary
54+
size: 0xcfe00
55+
span: *id002
56+
mcuboot_scratch:
57+
address: 0xdc000
58+
end_address: 0xfa000
59+
placement:
60+
after:
61+
- app
62+
align:
63+
start: 0x1000
64+
region: flash_primary
65+
size: 0x1e000
66+
mcuboot_secondary:
67+
address: 0x0
68+
device: DT_CHOSEN(nordic_pm_ext_flash)
69+
end_address: 0xd0000
70+
placement:
71+
align:
72+
start: 0x4
73+
region: external_flash
74+
share_size:
75+
- mcuboot_primary
76+
size: 0xd0000
77+
nvs_storage:
78+
address: 0xfa000
79+
end_address: 0x100000
80+
placement:
81+
before:
82+
- end
83+
region: flash_primary
84+
size: 0x6000

applications/demo/prj.conf

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#
2+
# Copyright (c) 2023 HARDWARIO a.s.
3+
#
4+
# SPDX-License-Identifier: LicenseRef-HARDWARIO-5-Clause
5+
#
6+
7+
CONFIG_ADC_NRFX_SAADC=n
8+
CONFIG_ADC_SHELL=n
9+
CONFIG_APP_TAMPER=n
10+
CONFIG_CTR_ACCEL=y
11+
CONFIG_CTR_BATT=y
12+
CONFIG_CTR_BUTTON=y
13+
CONFIG_CTR_BLE=n
14+
CONFIG_CTR_BUF=y
15+
CONFIG_CTR_CLOUD=y
16+
CONFIG_CTR_DEFAULTS=y
17+
CONFIG_CTR_INFO=y
18+
CONFIG_CTR_LED=y
19+
CONFIG_CTR_LOG=y
20+
CONFIG_CTR_LTE_V2_CLKSYNC=n
21+
CONFIG_CTR_RTC=y
22+
CONFIG_CTR_SHELL=y
23+
CONFIG_CTR_THERM=y
24+
CONFIG_CTR_WDOG=y
25+
CONFIG_NEWLIB_LIBC_NANO=n
26+
CONFIG_TINYCRYPT=y
27+
CONFIG_TINYCRYPT_SHA256=y
28+
CONFIG_ZCBOR=y
29+
CONFIG_ZCBOR_STOP_ON_ERROR=y
30+
CONFIG_ENTROPY_GENERATOR=y
31+
32+
CONFIG_SETTINGS_SHELL=y
33+
34+
CONFIG_IMG_MANAGER=y
35+
CONFIG_BOOTLOADER_MCUBOOT=y
36+
37+
# CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS="--custom-tlv 0xff00 tralala"
38+
39+
CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000
40+
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
41+
CONFIG_SPI=y
42+
43+
CONFIG_DFU_TARGET=y
44+
CONFIG_DFU_TARGET_STREAM=y
45+
CONFIG_DFU_TARGET_MCUBOOT=y
46+
CONFIG_DFU_TARGET_LOG_LEVEL_DBG=y
47+
CONFIG_STREAM_FLASH_ERASE=y
48+
CONFIG_STREAM_FLASH=y
49+
50+
# CONFIG_CTR_LTE_LINK_LOG_LEVEL_ERR=y
51+
CONFIG_CTR_LTE_LINK_LOG_LEVEL_DBG=y
52+
# CONFIG_CTR_LTE_V2_LOG_LEVEL_ERR=y
53+
CONFIG_CTR_LTE_V2_LOG_LEVEL_DBG=y
54+
55+
CONFIG_ADC_TLA2021_INIT_PRIORITY=60
56+
57+
58+
# Enable file system support
59+
CONFIG_FILE_SYSTEM=y
60+
CONFIG_FILE_SYSTEM_LITTLEFS=y
61+
CONFIG_FILE_SYSTEM_MKFS=y
62+
CONFIG_FILE_SYSTEM_SHELL=y
63+
CONFIG_SETTINGS_FILE=y
64+
CONFIG_SETTINGS_FILE_PATH="/lfs1/settings/run"
65+
66+
# Use external flash for littlefs file system
67+
CONFIG_PM_PARTITION_REGION_LITTLEFS_EXTERNAL=y

0 commit comments

Comments
 (0)