-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
applications: machine_learning: Adapt to nRF54H20 with sysbuild
Adapts the application to the nRF54H20 SoC and sysbuild. The `sensor_hub.zdebug` configuration has simulated sensor data. The `sensor_hub.zdebug.singlecore` configuration works with the ADXL362 acceleration sensor Ref: NCSDK-27407 Signed-off-by: Marcin Jelinski <[email protected]>
- Loading branch information
Showing
54 changed files
with
1,668 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
menu "Common" | ||
|
||
rsource "src/Kconfig.ml_app" | ||
rsource "src/modules/Kconfig" | ||
|
||
endmenu |
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
applications/machine_learning/common/src/modules/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
target_sources_ifdef(CONFIG_ML_APP_EVENT_PROXY | ||
app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/event_proxy.c) | ||
|
||
target_sources_ifdef(CONFIG_ML_APP_SENSOR_STUB_GEN | ||
app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/sensor_stub_gen.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
menu "Common modules" | ||
|
||
rsource "Kconfig.event_proxy" | ||
rsource "Kconfig.sensor_stub_gen" | ||
|
||
endmenu |
30 changes: 30 additions & 0 deletions
30
applications/machine_learning/common/src/modules/Kconfig.event_proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
menuconfig ML_APP_EVENT_PROXY | ||
bool "Event proxy module" | ||
depends on SOC_SERIES_NRF54HX | ||
depends on EVENT_MANAGER_PROXY | ||
select APP_EVENT_MANAGER_POSTINIT_HOOK | ||
help | ||
Enable and initialize event manager proxy subsystem on application | ||
start. Subscribtion to events is done based on configuration file. | ||
|
||
if ML_APP_EVENT_PROXY | ||
|
||
config ML_APP_REMOTE_CORE_INITIALIZATION_TIMEOUT | ||
int "Remote core initialization timeout [ms]" | ||
range 10 10000 | ||
default 2000 | ||
help | ||
The time to wait for remote cores to report its readines. The time is | ||
given in miliseconds. | ||
|
||
module = ML_APP_EVENT_PROXY | ||
module-str = event proxy module | ||
source "subsys/logging/Kconfig.template.log_config" | ||
|
||
endif |
22 changes: 22 additions & 0 deletions
22
applications/machine_learning/common/src/modules/Kconfig.sensor_stub_gen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
menuconfig ML_APP_SENSOR_STUB_GEN | ||
bool "Sensor stub data generator" | ||
|
||
if ML_APP_SENSOR_STUB_GEN | ||
|
||
config ML_APP_SENSOR_STUB_GEN_TRIG_TIMEOUT_MS | ||
int "Wave signal change timeout [ms]" | ||
default 1000 | ||
help | ||
The timeout triggers selecting next simulated wave signal. | ||
|
||
module = ML_APP_SENSOR_STUB_GEN | ||
module-str = sensor stub gen | ||
source "subsys/logging/Kconfig.template.log_config" | ||
|
||
endif # ML_APP_SENSOR_STUB_GEN |
65 changes: 65 additions & 0 deletions
65
applications/machine_learning/common/src/modules/event_proxy.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#include <zephyr/kernel.h> | ||
|
||
#include "event_proxy_def.h" | ||
|
||
#include <zephyr/ipc/ipc_service.h> | ||
#include <event_manager_proxy.h> | ||
|
||
#define MODULE event_proxy | ||
|
||
#include <zephyr/logging/log.h> | ||
LOG_MODULE_REGISTER(MODULE, CONFIG_ML_APP_EVENT_PROXY_LOG_LEVEL); | ||
|
||
#define EVENT_PROXY_INIT_TIMEOUT CONFIG_ML_APP_REMOTE_CORE_INITIALIZATION_TIMEOUT | ||
|
||
|
||
static int event_proxy_init(void) | ||
{ | ||
int ret = 0; | ||
|
||
for (size_t i = 0; i < ARRAY_SIZE(proxy_configs); i++) { | ||
const struct event_proxy_config *pcfg = proxy_configs[i]; | ||
const struct device *inst = pcfg->ipc; | ||
|
||
ret = event_manager_proxy_add_remote(inst); | ||
if (ret) { | ||
LOG_ERR("Can not add %s remote: %d", inst->name, ret); | ||
__ASSERT_NO_MSG(false); | ||
return ret; | ||
} | ||
|
||
for (size_t e_idx = 0; e_idx < pcfg->events_cnt; e_idx++) { | ||
ret = event_manager_proxy_subscribe(inst, pcfg->events[e_idx]); | ||
if (ret) { | ||
LOG_ERR("Can not subscribe to remote %s: %d", | ||
pcfg->events[e_idx]->name, ret); | ||
__ASSERT_NO_MSG(false); | ||
return ret; | ||
} | ||
} | ||
} | ||
|
||
ret = event_manager_proxy_start(); | ||
if (ret) { | ||
LOG_ERR("Can not start: %d", ret); | ||
__ASSERT_NO_MSG(false); | ||
return ret; | ||
} | ||
|
||
ret = event_manager_proxy_wait_for_remotes(K_MSEC(EVENT_PROXY_INIT_TIMEOUT)); | ||
if (ret) { | ||
LOG_ERR("Remotes not ready: %d", ret); | ||
__ASSERT_NO_MSG(false); | ||
return ret; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
APP_EVENT_MANAGER_HOOK_POSTINIT_REGISTER(event_proxy_init); |
Oops, something went wrong.