Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/gateway_lte/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,18 @@ configdefault NRF_MODEM_LIB_SHMEM_TX_SIZE
configdefault NRF_MODEM_LIB_SHMEM_RX_SIZE
default 8192

#
# Defaults for native nRF91 gateways
#
choice LTE_NETWORK_MODE
default LTE_NETWORK_MODE_LTE_M
endchoice
choice INFUSE_NRF_MODEM_MONITOR_MOBILITY
default INFUSE_NRF_MODEM_MONITOR_MOBILITY_NORDIC_PROPRIETARY
endchoice
configdefault LTE_PSM_REQ
default n
configdefault INFUSE_NRF_MODEM_DATA_PROFILE_DEFAULT
default 4

source "Kconfig.zephyr"
4 changes: 0 additions & 4 deletions apps/gateway_lte/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ CONFIG_BT_MAX_CONN=4

# LTE
CONFIG_NETWORKING=y
CONFIG_LTE_NETWORK_MODE_LTE_M=y
CONFIG_LTE_PSM_REQ=n
CONFIG_INFUSE_MODEM_MONITOR_CONN_STATE_LOG=y
CONFIG_INFUSE_NRF_MODEM_DATA_PROFILE_DEFAULT=4
CONFIG_INFUSE_NRF_MODEM_MONITOR_MOBILITY_NORDIC_PROPRIETARY=y

# Group packets for TX efficiency
CONFIG_EPACKET_RECEIVE_GROUPING=y
Expand Down
9 changes: 8 additions & 1 deletion apps/gateway_lte/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static const struct task_schedule schedules[] = {
.periodicity.fixed.period_s = 30,
},
#endif /* DT_NODE_EXISTS(DT_ALIAS(environmental0)) */
#if DT_NODE_EXISTS(DT_ALIAS(gnss))
{
.task_id = TASK_ID_GNSS,
.validity = TASK_VALID_ALWAYS,
Expand All @@ -105,19 +106,25 @@ static const struct task_schedule schedules[] = {
.position_dop = 100,
},
},
#endif /* DT_NODE_EXISTS(DT_ALIAS(gnss)) */
};

#if DT_NODE_EXISTS(DT_ALIAS(environmental0))
#define ENV_TASK_DEFINE (ENVIRONMENTAL_TASK, DEVICE_DT_GET(DT_ALIAS(environmental0)))
#else
#define ENV_TASK_DEFINE
#endif
#if DT_NODE_EXISTS(DT_ALIAS(gnss))
#define GNSS_TASK_DEFINE (GNSS_TASK, DEVICE_DT_GET(DT_ALIAS(gnss)))
#else
#define GNSS_TASK_DEFINE
#endif

TASK_SCHEDULE_STATES_DEFINE(states, schedules);
TASK_RUNNER_TASKS_DEFINE(app_tasks, app_tasks_data, (TDF_LOGGER_TASK, custom_tdf_logger),
(TDF_LOGGER_ALT1_TASK, NULL),
(BATTERY_TASK, DEVICE_DT_GET(DT_ALIAS(fuel_gauge0))), ENV_TASK_DEFINE,
(GNSS_TASK, DEVICE_DT_GET(DT_ALIAS(gnss))));
GNSS_TASK_DEFINE);

GATEWAY_HANDLER_DEFINE(udp_backhaul_handler, DEVICE_DT_GET(DT_NODELABEL(epacket_udp)));

Expand Down
1 change: 1 addition & 0 deletions boards/embeint/kudu/kudu_cpuapp_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
led1 = &led1;
led2 = &led2;
watchdog0 = &wdt31;
fuel-gauge0 = &fuel_gauge;
environmental0 = &sht4x;
imu0 = &lsm6dsv;
};
Expand Down
4 changes: 2 additions & 2 deletions lib/modem_monitor/modem_nrf9x/nrf_modem_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static void network_info_update(struct k_work *work)
KV_STRUCT_KV_STRING_VAR(25) sim_uicc;

/* SIM IMSI */
rc = nrf_modem_at_scanf("AT+CIMI", "%" SCNd64 "\n", &sim_imsi.imsi);
rc = nrf_modem_at_scanf("AT+CIMI", "%" SCNu64 "\n", &sim_imsi.imsi);
if (rc == 1) {
if (KV_STORE_WRITE(KV_KEY_LTE_SIM_IMSI, &sim_imsi) > 0) {
/* Print value when first saved to KV store */
Expand Down Expand Up @@ -508,7 +508,7 @@ static void infuse_modem_init(int ret, void *ctx)
modem_info.value_num = strlen(modem_info.value) + 1;
(void)kv_store_write(KV_KEY_LTE_MODEM_ESN, &modem_info, 1 + modem_info.value_num);
/* Modem IMEI */
nrf_modem_at_scanf("AT+CGSN=1", "+CGSN: \"%" SCNd64 "\"\n", &modem_imei.imei);
nrf_modem_at_scanf("AT+CGSN=1", "+CGSN: \"%" SCNu64 "\"\n", &modem_imei.imei);
(void)KV_STORE_WRITE(KV_KEY_LTE_MODEM_IMEI, &modem_imei);
/* Modem info has been stored */
modem_info_stored = true;
Expand Down
29 changes: 29 additions & 0 deletions snippets/infuse/boards/kudu_nrf54l15_cpuapp.overlay
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
#include <common/nordic/infuse_nrf54l15_cpuapp.dtsi>
#include <common/infuse_bluetooth.dtsi>

/* Recover the FLPR core RAM for the main application */
&cpuapp_sram {
reg = <0x20000000 (DT_SIZE_K(256) - 0x100)>;
ranges = <0x0 0x20000000 (DT_SIZE_K(256) - 0x100)>;
};
/delete-node/ &retained_mem_region;

/ {
chosen {
infuse,reboot-state = &retention0;
infuse,kv-partition = &storage_partition;
};

/* Move the retained memory region to the new end of application RAM */
retained_mem_region: memory@2003FF00 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x2003FF00 0x100>;
zephyr,memory-region = "RetainedMem";
status = "okay";

retainedmem {
compatible = "zephyr,retained-ram";
status = "okay";
#address-cells = <1>;
#size-cells = <1>;

retention0: retention@0 {
compatible = "zephyr,retention";
status = "okay";
reg = <0x0 0x100>;
prefix = [DE 03];
};
};
};

epacket_serial: epacket_serial {
compatible = "embeint,epacket-serial";
serial = <&rtt0>;
Expand Down
8 changes: 6 additions & 2 deletions subsys/rpc/commands/lte_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include <infuse/rpc/types.h>
#include <infuse/lib/lte_modem_monitor.h>

#include <nrf_modem_at.h>

#include "common_net_query.h"

LOG_MODULE_DECLARE(rpc_server);
Expand Down Expand Up @@ -50,7 +48,13 @@ static void lte_modem_lte_state(struct rpc_struct_lte_state *lte)

struct net_buf *rpc_command_lte_state(struct net_buf *request)
{
#if defined(CONFIG_NRF_MODEM_LIB)
struct net_if *iface = net_if_get_first_by_type(&(NET_L2_GET_NAME(OFFLOADED_NETDEV)));
#elif defined(CONFIG_NET_L2_PPP)
struct net_if *iface = net_if_get_first_by_type(&(NET_L2_GET_NAME(PPP)));
#else
#error Unknown LTE modem network interface
#endif
struct rpc_lte_state_response rsp = {0};

if (iface == NULL) {
Expand Down