diff --git a/applications/serial_lte_modem/doc/SOCKET_AT_commands.rst b/applications/serial_lte_modem/doc/SOCKET_AT_commands.rst index 35690bfb3dd5..3b25511d0854 100644 --- a/applications/serial_lte_modem/doc/SOCKET_AT_commands.rst +++ b/applications/serial_lte_modem/doc/SOCKET_AT_commands.rst @@ -571,6 +571,10 @@ Syntax Indicates that the socket is in active use by a server application. This lets the modem stay in connected mode longer. + * ``62`` - :c:macro:`SO_IPV6_DELAYED_ADDR_REFRESH`. + + * ```` is an integer that indicates whether delayed IPv6 address refresh is enabled. + It is ``0`` for disabled or ``1`` for enabled. See :ref:`nRF socket options ` for explanation of the supported options. diff --git a/applications/serial_lte_modem/src/slm_at_socket.c b/applications/serial_lte_modem/src/slm_at_socket.c index a00c80b03131..ddc667d947cf 100644 --- a/applications/serial_lte_modem/src/slm_at_socket.c +++ b/applications/serial_lte_modem/src/slm_at_socket.c @@ -346,6 +346,9 @@ static int at_sockopt_to_sockopt(enum at_sockopt at_option, int *level, int *opt *level = IPPROTO_IPV6; *option = SO_IPV6_ECHO_REPLY; break; + case AT_SO_IPV6_DELAYED_ADDR_REFRESH: + *level = IPPROTO_IPV6; + *option = SO_IPV6_DELAYED_ADDR_REFRESH; case AT_SO_BINDTOPDN: *level = SOL_SOCKET; *option = SO_BINDTOPDN; diff --git a/applications/serial_lte_modem/src/slm_sockopt.h b/applications/serial_lte_modem/src/slm_sockopt.h index 71960baf1911..749eaf076a12 100644 --- a/applications/serial_lte_modem/src/slm_sockopt.h +++ b/applications/serial_lte_modem/src/slm_sockopt.h @@ -26,6 +26,7 @@ enum at_sockopt { AT_SO_BINDTOPDN = 40, AT_SO_TCP_SRV_SESSTIMEO = 55, AT_SO_RAI = 61, + AT_SO_IPV6_DELAYED_ADDR_REFRESH = 62, }; /** diff --git a/applications/serial_lte_modem/src/slm_trap_macros.h b/applications/serial_lte_modem/src/slm_trap_macros.h index 5844dd04f448..783d0e5a62ab 100644 --- a/applications/serial_lte_modem/src/slm_trap_macros.h +++ b/applications/serial_lte_modem/src/slm_trap_macros.h @@ -13,8 +13,8 @@ * when forwarding intercepted AT commands from within the callbacks. * Alternatives to these functions are available in slm_util.h. */ -#define nrf_modem_at_printf(...) function_disallowed_use_slm_util_alternative(void) -#define nrf_modem_at_scanf(...) function_disallowed_use_slm_util_alternative(void) -#define nrf_modem_at_cmd_async(...) function_disallowed(void) +#define nrf_modem_at_printf(...) function_disallowed_use_slm_util_printf_alternative(__VA_ARGS__) +#define nrf_modem_at_scanf(...) function_disallowed_use_slm_util_scanf_alternative(__VA_ARGS__) +#define nrf_modem_at_cmd_async(...) function_disallowed(__VA_ARGS__) #endif diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 2b3cc19bbb41..f5303a58bf56 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -314,6 +314,7 @@ Serial LTE modem * DTLS support for the ``#XUDPSVR`` and ``#XSSOCKET`` (UDP server sockets) AT commands when the :file:`overlay-native_tls.conf` configuration file is used. * The :kconfig:option:`CONFIG_SLM_PPP_FALLBACK_MTU` Kconfig option that is used to control the MTU used by PPP when the cellular link MTU is not returned by the modem in response to the ``AT+CGCONTRDP=0`` AT command. * Handler for new nRF Cloud event type ``NRF_CLOUD_EVT_RX_DATA_DISCON``. + * Support for socket option ``AT_SO_IPV6_DELAYED_ADDR_REFRESH``. * Removed: @@ -828,13 +829,19 @@ Modem libraries * :ref:`nrf_modem_lib_readme`: + * Added support for socket option ``SO_IPV6_DELAYED_ADDR_REFRESH``. + * Updated: * The RTT trace backend to allocate the RTT channel at boot, instead of when the modem is activated. * The flash trace backend to solve concurrency issues when reading traces while writing, and when reinitializing the application (warm start). * Rename the nRF91 socket offload layer from ``nrf91_sockets`` to ``nrf9x_sockets`` to reflect that the offload layer is not exclusive to the nRF91 Series SiPs. - * Removed support for deprecated RAI socket options ``SO_RAI_LAST``, ``SO_RAI_NO_DATA``, ``SO_RAI_ONE_RESP``, ``SO_RAI_ONGOING``, and ``SO_RAI_WAIT_MORE``. + + * Removed: + + * Support for deprecated RAI socket options ``SO_RAI_LAST``, ``SO_RAI_NO_DATA``, ``SO_RAI_ONE_RESP``, ``SO_RAI_ONGOING``, and ``SO_RAI_WAIT_MORE``. + * The mutex in the :c:func:`nrf9x_socket_offload_getaddrinfo` function after updating the :c:func:`nrf_getaddrinfo` function to handle concurrent requests. * :ref:`modem_info_readme` library: diff --git a/lib/gcf_sms/gcf_sms.c b/lib/gcf_sms/gcf_sms.c index 404a8a9f4a7f..9435987960e2 100644 --- a/lib/gcf_sms/gcf_sms.c +++ b/lib/gcf_sms/gcf_sms.c @@ -192,7 +192,7 @@ int gcf_sms_filter_callback(char *buf, size_t len, char *at_cmd) /* AT command is filtered. */ err = (*callback)(buf_remaining, len_remaining, msg); } else { - err = nrf_modem_at_cmd(buf_remaining, len_remaining, msg); + err = nrf_modem_at_cmd(buf_remaining, len_remaining, "%s", msg); } if (err != 0) { @@ -370,7 +370,7 @@ static int at_cmd_callback_cmss(char *buf, size_t len, char *at_cmd) } /* Send AT+CMGS command to modem. */ - err = nrf_modem_at_cmd(buf, len, "AT+CMGS=%d\r%s\x1a\0", + err = nrf_modem_at_cmd(buf, len, "AT+CMGS=%d\r%s\x1a", sms_buffers[sms_buffer_index].pdu_size, sms_buffers[sms_buffer_index].data); if (err) { @@ -393,7 +393,7 @@ static int at_cmd_callback_cmms(char *buf, size_t len, char *at_cmd) int err; /* Send to modem without buffer. */ - err = nrf_modem_at_printf(at_cmd); + err = nrf_modem_at_printf("%s", at_cmd); if (err) { if (err > 0) { LOG_ERR("%s failed, error_type: %d, error_value: %d", at_cmd, diff --git a/lib/modem_attest_token/modem_attest_token.c b/lib/modem_attest_token/modem_attest_token.c index 0082133d9be9..6a2bdb3b3143 100644 --- a/lib/modem_attest_token/modem_attest_token.c +++ b/lib/modem_attest_token/modem_attest_token.c @@ -43,7 +43,7 @@ int modem_attest_token_get(struct nrf_attestation_token *const token) /* Execute AT command to get attestation token */ ret = nrf_modem_at_scanf(AT_ATTEST_CMD, - "%%ATTESTTOKEN: \"%127[^.].%127[^\"]\"", &attest, &cose); + "%%ATTESTTOKEN: \"%127[^.].%127[^\"]\"", attest, cose); if (ret != 2) { return -EBADMSG; } diff --git a/lib/nrf_modem_lib/CMakeLists.txt b/lib/nrf_modem_lib/CMakeLists.txt index 20318cd4ca14..217cec7f6eca 100644 --- a/lib/nrf_modem_lib/CMakeLists.txt +++ b/lib/nrf_modem_lib/CMakeLists.txt @@ -7,6 +7,7 @@ zephyr_library() zephyr_library_sources(nrf_modem_lib.c) zephyr_library_sources(nrf_modem_os.c) +zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_NRF92X nrf_modem_os_rpc.c) zephyr_library_sources_ifdef(CONFIG_NRF_MODEM_LIB_CFUN_HOOKS cfun_hooks.c) zephyr_library_sources_ifdef(CONFIG_NRF_MODEM_LIB_MEM_DIAG diag.c) zephyr_library_sources_ifdef(CONFIG_NET_SOCKETS nrf9x_sockets.c) diff --git a/lib/nrf_modem_lib/Kconfig b/lib/nrf_modem_lib/Kconfig index c8fe1d183508..c7098f138a04 100644 --- a/lib/nrf_modem_lib/Kconfig +++ b/lib/nrf_modem_lib/Kconfig @@ -5,8 +5,8 @@ menuconfig NRF_MODEM_LIB bool "Modem library" - depends on SOC_SERIES_NRF91X - depends on TRUSTED_EXECUTION_NONSECURE + depends on (SOC_SERIES_NRF91X && TRUSTED_EXECUTION_NONSECURE) || SOC_NRF9280_CPUAPP + select EXPERIMENTAL if SOC_NRF9280_CPUAPP select NRF_MODEM imply NET_SOCKETS_OFFLOAD imply NET_SOCKETS_POSIX_NAMES if !POSIX_API diff --git a/lib/nrf_modem_lib/Kconfig.modemlib b/lib/nrf_modem_lib/Kconfig.modemlib index 8b67773cd5d3..720fc66af6ef 100644 --- a/lib/nrf_modem_lib/Kconfig.modemlib +++ b/lib/nrf_modem_lib/Kconfig.modemlib @@ -34,6 +34,8 @@ config NRF_MODEM_LIB_SHMEM_CTRL_SIZE This is a constant for a given library build, and is exported by the library via NRF_MODEM_SHMEM_CTRL_SIZE. +if SOC_SERIES_NRF91X || UNITY + config NRF_MODEM_LIB_SHMEM_TX_SIZE int "TX region size" range 1024 32768 @@ -67,6 +69,20 @@ config NRF_MODEM_LIB_SHMEM_TRACE_SIZE help Size of the shared memory region used to receive modem traces. +endif # SOC_SERIES_NRF91X || UNITY + +if SOC_SERIES_NRF92X + +config NRF_MODEM_LIB_TRANSPORT_MBOX + bool + default y + select MBOX + select IPC_SERVICE + select IPC_SERVICE_ICMSG + select IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC + +endif # SOC_SERIES_NRF92X + config NRF_MODEM_LIB_SENDMSG_BUF_SIZE int "Size of the sendmsg intermediate buffer" default 128 @@ -108,6 +124,7 @@ endmenu # Memory config menuconfig NRF_MODEM_LIB_TRACE bool "Tracing" + depends on SOC_SERIES_NRF91X || UNITY help When enabled, a portion of RAM (called Trace region) will be shared with the modem to receive modem's trace data. The size of the Trace region is defined by the NRF_MODEM_LIB_SHMEM_TRACE_SIZE option. diff --git a/lib/nrf_modem_lib/nrf9x_sockets.c b/lib/nrf_modem_lib/nrf9x_sockets.c index 663d56bd2d49..a593b22222f0 100644 --- a/lib/nrf_modem_lib/nrf9x_sockets.c +++ b/lib/nrf_modem_lib/nrf9x_sockets.c @@ -241,6 +241,9 @@ static int z_to_nrf_optname(int z_in_level, int z_in_optname, case SO_IPV6_ECHO_REPLY: *nrf_out_optname = NRF_SO_IPV6_ECHO_REPLY; break; + case SO_IPV6_DELAYED_ADDR_REFRESH: + *nrf_out_optname = NRF_SO_IPV6_DELAYED_ADDR_REFRESH; + break; default: retval = -1; break; @@ -760,7 +763,6 @@ static int nrf9x_socket_offload_getaddrinfo(const char *node, struct nrf_addrinfo nrf_hints; struct nrf_addrinfo *nrf_res = NULL; struct nrf_addrinfo *nrf_hints_ptr = NULL; - static K_MUTEX_DEFINE(getaddrinfo_lock); memset(&nrf_hints, 0, sizeof(struct nrf_addrinfo)); @@ -769,11 +771,10 @@ static int nrf9x_socket_offload_getaddrinfo(const char *node, nrf_hints_ptr = &nrf_hints; } - k_mutex_lock(&getaddrinfo_lock, K_FOREVER); int retval = nrf_getaddrinfo(node, service, nrf_hints_ptr, &nrf_res); if (retval != 0) { - goto error; + return retval; } struct nrf_addrinfo *next_nrf_res = nrf_res; @@ -817,8 +818,6 @@ static int nrf9x_socket_offload_getaddrinfo(const char *node, } nrf_freeaddrinfo(nrf_res); -error: - k_mutex_unlock(&getaddrinfo_lock); return retval; } diff --git a/lib/nrf_modem_lib/nrf_modem_lib.c b/lib/nrf_modem_lib/nrf_modem_lib.c index db3f0d735044..a07d60c24983 100644 --- a/lib/nrf_modem_lib/nrf_modem_lib.c +++ b/lib/nrf_modem_lib/nrf_modem_lib.c @@ -4,16 +4,26 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include #include #include #include #include #include -#include #include -#include + +#include +LOG_MODULE_DECLARE(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); + +#define AT_CFUN_READ "AT+CFUN?" +#define AT_CFUN0_VAL 0 +#define AT_CFUN4_VAL 4 + +static void nrf_modem_lib_dfu_handler(uint32_t dfu_res); + +#ifdef CONFIG_SOC_SERIES_NRF91X #include +#include #include #ifndef CONFIG_TRUSTED_EXECUTION_NONSECURE @@ -21,23 +31,15 @@ Are you building for the correct board ? #endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ -LOG_MODULE_DECLARE(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); - /* Interrupt used for communication with the network layer. */ #define NRF_MODEM_IPC_IRQ DT_IRQ_BY_IDX(DT_NODELABEL(ipc), 0, irq) BUILD_ASSERT(IPC_IRQn == NRF_MODEM_IPC_IRQ, "NRF_MODEM_IPC_IRQ mismatch"); -#define AT_CFUN_READ "AT+CFUN?" -#define AT_CFUN0_VAL 0 -#define AT_CFUN4_VAL 4 - /* The heap implementation in `nrf_modem_os.c` require some overhead * to allow allocating up to `NRF_MODEM_LIB_SHMEM_TX_SIZE` bytes. */ #define NRF_MODEM_LIB_SHMEM_TX_HEAP_OVERHEAD_SIZE 128 -static void nrf_modem_lib_dfu_handler(uint32_t dfu_res); - static const struct nrf_modem_init_params init_params = { .ipc_irq_prio = CONFIG_NRF_MODEM_LIB_IPC_IRQ_PRIO, .shmem.ctrl = { @@ -69,6 +71,27 @@ static const struct nrf_modem_bootloader_init_params bootloader_init_params = { .shmem.size = PM_NRF_MODEM_LIB_SRAM_SIZE, .fault_handler = nrf_modem_fault_handler }; +#endif /* CONFIG_SOC_SERIES_NRF91X */ + +#ifdef CONFIG_SOC_SERIES_NRF92X + +static const struct nrf_modem_init_params init_params = { + .shmem.ctrl = { + .base = DT_REG_ADDR(DT_NODELABEL(cpuapp_cpucell_ipc_shm)), + .size = CONFIG_NRF_MODEM_LIB_SHMEM_CTRL_SIZE, + }, + .shmem.tx = { + .base = DT_REG_ADDR(DT_NODELABEL(cpuapp_cpucell_ipc_shm_heap)), + .size = DT_REG_SIZE(DT_NODELABEL(cpuapp_cpucell_ipc_shm_heap)), + }, + .shmem.rx = { + .base = DT_REG_ADDR(DT_NODELABEL(cpucell_cpuapp_ipc_shm_heap)), + .size = DT_REG_SIZE(DT_NODELABEL(cpucell_cpuapp_ipc_shm_heap)), + }, + .fault_handler = nrf_modem_fault_handler, + .dfu_handler = nrf_modem_lib_dfu_handler, +}; +#endif /* CONFIG_SOC_SERIES_NRF92X */ #if CONFIG_NRF_MODEM_LIB_TRACE extern void nrf_modem_lib_trace_init(void); @@ -129,11 +152,13 @@ int nrf_modem_lib_init(void) { int err; +#ifdef CONFIG_SOC_SERIES_NRF91X /* Setup the network IRQ used by the Modem library. * Note: No call to irq_enable() here, that is done through nrf_modem_init(). */ IRQ_CONNECT(NRF_MODEM_IPC_IRQ, CONFIG_NRF_MODEM_LIB_IPC_IRQ_PRIO, nrfx_isr, nrfx_ipc_irq_handler, 0); +#endif /* CONFIG_SOC_SERIES_NRF91X */ err = nrf_modem_init(&init_params); if (err) { @@ -161,7 +186,11 @@ int nrf_modem_lib_init(void) int nrf_modem_lib_bootloader_init(void) { +#ifdef CONFIG_SOC_SERIES_NRF91X return nrf_modem_bootloader_init(&bootloader_init_params); +#else + return -ENOSYS; +#endif } int nrf_modem_lib_shutdown(void) diff --git a/lib/nrf_modem_lib/nrf_modem_os.c b/lib/nrf_modem_lib/nrf_modem_os.c index fc1ce239f17d..7c76cc750f39 100644 --- a/lib/nrf_modem_lib/nrf_modem_os.c +++ b/lib/nrf_modem_lib/nrf_modem_os.c @@ -12,14 +12,23 @@ #include #include #include -#include + #include +LOG_MODULE_REGISTER(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); + +#if CONFIG_SOC_SERIES_NRF91X +#include +#define SHMEM_TX_HEAP_ADDR (PM_NRF_MODEM_LIB_TX_ADDRESS) +#define SHMEM_TX_HEAP_SIZE (CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE) +#elif CONFIG_SOC_SERIES_NRF92X +#define SHMEM_TX_HEAP_ADDR (DT_REG_ADDR(DT_NODELABEL(cpuapp_cpucell_ipc_shm_heap))) +#define SHMEM_TX_HEAP_SIZE (DT_REG_SIZE(DT_NODELABEL(cpuapp_cpucell_ipc_shm_heap))) +#endif + #define UNUSED_FLAGS 0 #define THREAD_MONITOR_ENTRIES 10 -LOG_MODULE_REGISTER(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); - struct sleeping_thread { sys_snode_t node; struct k_sem sem; @@ -375,7 +384,14 @@ void nrf_modem_os_free(void *mem) void *nrf_modem_os_shm_tx_alloc(size_t bytes) { extern uint32_t nrf_modem_lib_shmem_failed_allocs; + +#if (CONFIG_SOC_SERIES_NRF92X && CONFIG_DCACHE) + /* Allocate cache line aligned memory. */ + void * const addr = k_heap_aligned_alloc(&nrf_modem_lib_shmem_heap, CONFIG_DCACHE_LINE_SIZE, + ROUND_UP(bytes, CONFIG_DCACHE_LINE_SIZE), K_NO_WAIT); +#else void * const addr = k_heap_alloc(&nrf_modem_lib_shmem_heap, bytes, K_NO_WAIT); +#endif if (IS_ENABLED(CONFIG_NRF_MODEM_LIB_MEM_DIAG_ALLOC) && !addr) { nrf_modem_lib_shmem_failed_allocs++; @@ -487,8 +503,7 @@ void nrf_modem_os_init(void) { /* Initialize heaps */ k_heap_init(&nrf_modem_lib_heap, library_heap_buf, sizeof(library_heap_buf)); - k_heap_init(&nrf_modem_lib_shmem_heap, (void *)PM_NRF_MODEM_LIB_TX_ADDRESS, - CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE); + k_heap_init(&nrf_modem_lib_shmem_heap, (void *)SHMEM_TX_HEAP_ADDR, SHMEM_TX_HEAP_SIZE); } void nrf_modem_os_shutdown(void) diff --git a/lib/nrf_modem_lib/nrf_modem_os_rpc.c b/lib/nrf_modem_lib/nrf_modem_os_rpc.c new file mode 100644 index 000000000000..e6a1bb1740d2 --- /dev/null +++ b/lib/nrf_modem_lib/nrf_modem_os_rpc.c @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#define DCACHE_LINE_SIZE 0 + +/** Structure to hold pbuf configuration and data. */ +struct nrf_modem_pbuf { + struct pbuf_cfg pb_cfg; + struct pbuf pb; +}; + +/** + * Structure nrf_modem_os_rpc was only declared in nrf_modem_os_rpc.h. + * Define the members of the struct here. Populating it with the required IPC data. + */ +struct nrf_modem_os_rpc { + /** ICMsg internal data. */ + struct icmsg_data_t data; + /** ICMsg configuration. */ + struct icmsg_config_t conf; + /** ICMsg callbacks to nrf_modem. */ + struct ipc_service_cb cb; + /** TX pbuf. */ + struct nrf_modem_pbuf tx; + /** RX pbuf. */ + struct nrf_modem_pbuf rx; +}; + +/** + * Structure nrf_modem_os_rpc_signal was only declared in nrf_modem_os_rpc.h. + * Define the members of the struct here. Populating it with the required mbox data. + */ +struct nrf_modem_os_rpc_signal { + /** MBOX instance data. */ + struct mbox_dt_spec mbox; + /** Callback to nrf_modem. */ + nrf_modem_os_rpc_signal_cb_t recv; + /** Private context data usable by nrf_modem. */ + void *priv; +}; + +/** + * Macro to initialize an instance of struct nrf_modem_os_rpc. + * + * @param _inst RPC instance to be initialized. + * @param _dcache_line_size cache line size in bytes. + * + * @return Initializer list for initializing the instance. + */ +#define NRF_MODEM_OS_RPC_INIT(_inst, _dcache_line_size) \ + { \ + .data.tx_pb = &(_inst).tx.pb, \ + .data.rx_pb = &(_inst).rx.pb, \ + .tx.pb.cfg = &(_inst).tx.pb_cfg, \ + .rx.pb.cfg = &(_inst).rx.pb_cfg, \ + .tx.pb_cfg.dcache_alignment = (_dcache_line_size), \ + .rx.pb_cfg.dcache_alignment = (_dcache_line_size), \ + } + +/** + * Define and initialize the RPC instances used by nrf_modem. + * These are declared extern in nrf_modem_os_rpc.h. + */ +struct nrf_modem_os_rpc inst_ctrl = NRF_MODEM_OS_RPC_INIT(inst_ctrl, DCACHE_LINE_SIZE); +struct nrf_modem_os_rpc inst_data = NRF_MODEM_OS_RPC_INIT(inst_data, DCACHE_LINE_SIZE); + +/** + * Define and initialize the signaling instances used by nrf_modem. + * These are declared extern in nrf_modem_os_rpc.h. + */ +struct nrf_modem_os_rpc_signal inst_app_fault; +struct nrf_modem_os_rpc_signal inst_modem_fault; +struct nrf_modem_os_rpc_signal inst_modem_sysoff; + +uintptr_t nrf_modem_os_rpc_sigdev_app_get(void) +{ + const struct device *app_bellboard = DEVICE_DT_GET(DT_NODELABEL(cpuapp_bellboard)); + + return (uintptr_t)app_bellboard; +} + +uintptr_t nrf_modem_os_rpc_sigdev_modem_get(void) +{ + const struct device *modem_bellboard = DEVICE_DT_GET(DT_NODELABEL(cpucell_bellboard)); + + return (uintptr_t)modem_bellboard; +} + +static inline void pbuf_configure(struct pbuf_cfg *pb_cfg, uintptr_t mem_addr, size_t size) +{ + const uint32_t wr_idx_offset = MAX(pb_cfg->dcache_alignment, _PBUF_IDX_SIZE); + + pb_cfg->rd_idx_loc = (uint32_t *)(mem_addr); + pb_cfg->wr_idx_loc = (uint32_t *)(mem_addr + wr_idx_offset); + pb_cfg->len = (uint32_t)((uint32_t)size - wr_idx_offset - _PBUF_IDX_SIZE); + pb_cfg->data_loc = (uint8_t *)(mem_addr + wr_idx_offset + _PBUF_IDX_SIZE); +} + +int nrf_modem_os_rpc_open(struct nrf_modem_os_rpc *instance, + const struct nrf_modem_os_rpc_config *config) +{ + if (instance == NULL || config == NULL) { + return -NRF_EINVAL; + } + + pbuf_configure(&instance->tx.pb_cfg, config->tx.addr, config->tx.size); + pbuf_configure(&instance->rx.pb_cfg, config->rx.addr, config->rx.size); + + instance->conf.mbox_tx.dev = (struct device *)config->tx.sigdev; + instance->conf.mbox_rx.dev = (struct device *)config->rx.sigdev; + instance->conf.mbox_tx.channel_id = config->tx.ch; + instance->conf.mbox_rx.channel_id = config->rx.ch; + + instance->cb.bound = config->cb.bound; + instance->cb.received = config->cb.received; + + return icmsg_open(&instance->conf, &instance->data, &instance->cb, config->cb.priv); +} + +int nrf_modem_os_rpc_send(struct nrf_modem_os_rpc *instance, const void *msg, size_t len) +{ + int ret; + + ret = icmsg_send(&instance->conf, &instance->data, msg, len); + if (ret < 0) { + switch (ret) { + case -EBUSY: + case -EINVAL: + return -NRF_EBUSY; + case -ENOBUFS: + case -ENOMEM: + return -NRF_ENOMEM; + default: + return ret; + } + } + + return 0; +} + +int nrf_modem_os_rpc_close(struct nrf_modem_os_rpc *instance) +{ + return icmsg_close(&instance->conf, &instance->data); +} + +int nrf_modem_os_rpc_rx_suspend(struct nrf_modem_os_rpc *instance) +{ + return mbox_set_enabled_dt(&instance->conf.mbox_rx, false); +} + +int nrf_modem_os_rpc_rx_resume(struct nrf_modem_os_rpc *instance) +{ + return mbox_set_enabled_dt(&instance->conf.mbox_rx, true); +} + +static void mbox_common_callback(const struct device *dev, mbox_channel_id_t ch, void *ctx, + struct mbox_msg *data) +{ + struct nrf_modem_os_rpc_signal *inst = (struct nrf_modem_os_rpc_signal *)ctx; + + ARG_UNUSED(dev); + ARG_UNUSED(data); + + if (inst->recv != NULL) { + inst->recv(ch, inst->priv); + } +} + +int nrf_modem_os_rpc_signal_init(struct nrf_modem_os_rpc_signal *instance, + struct nrf_modem_os_rpc_signal_config *conf) +{ + int err; + + instance->mbox.dev = (struct device *)conf->sigdev; + instance->mbox.channel_id = (mbox_channel_id_t)conf->ch; + instance->priv = conf->priv; + instance->recv = conf->recv; + + if (instance->recv == NULL) { + return 0; + } + + err = mbox_register_callback_dt(&instance->mbox, mbox_common_callback, (void *)instance); + if (err) { + goto errout; + } + + err = mbox_set_enabled_dt(&instance->mbox, true); + if (err) { + goto errout; + } + + return 0; + +errout: + instance->recv = NULL; + return err; +} + +int nrf_modem_os_rpc_signal_send(struct nrf_modem_os_rpc_signal *instance) +{ + if (instance->recv != NULL) { + return -ENOSYS; + } + + return mbox_send_dt(&instance->mbox, NULL); +} + +int nrf_modem_os_rpc_signal_deinit(struct nrf_modem_os_rpc_signal *instance) +{ + if (instance->recv == NULL) { + return 0; + } + + return mbox_set_enabled_dt(&instance->mbox, false); +} + +int nrf_modem_os_rpc_cache_data_flush(void *addr, size_t size) +{ +#if CONFIG_DCACHE + /* Separate heaps are used for data payloads to and from the modem. + * Cache flush is only used on the tx heap. Therefore, cache coherency is + * maintained even when start address and size are not aligned with cache lines. + */ + addr = (void *)ROUND_DOWN((uint32_t)addr, CONFIG_DCACHE_LINE_SIZE); + size = ROUND_UP(size, CONFIG_DCACHE_LINE_SIZE); + + return sys_cache_data_flush_range(addr, size); +#else + ARG_UNUSED(addr); + ARG_UNUSED(size); + return 0; +#endif +} + +int nrf_modem_os_rpc_cache_data_invalidate(void *addr, size_t size) +{ +#if CONFIG_DCACHE + /* Separate heaps are used for data payloads to and from the modem. + * Cache invalidation is only used on the rx heap. Therefore, cache coherency is + * maintained even when start address and size are not aligned with cache lines. + */ + addr = (void *)ROUND_DOWN((uint32_t)addr, CONFIG_DCACHE_LINE_SIZE); + size = ROUND_UP(size, CONFIG_DCACHE_LINE_SIZE); + + return sys_cache_data_invd_range(addr, size); +#else + ARG_UNUSED(addr); + ARG_UNUSED(size); + return 0; +#endif +} diff --git a/lib/nrf_modem_lib/sanity.c b/lib/nrf_modem_lib/sanity.c index 64f6feaa13ae..226e36f5516c 100644 --- a/lib/nrf_modem_lib/sanity.c +++ b/lib/nrf_modem_lib/sanity.c @@ -6,7 +6,9 @@ #include #include +#ifdef CONFIG_SOC_SERIES_NRF91X #include +#endif /* CONFIG_SOC_SERIES_NRF91X */ #include #include @@ -110,6 +112,7 @@ BUILD_ASSERT(ETOOMANYREFS == NRF_ETOOMANYREFS, "Errno not aligned with nrf /* Shared memory sanity check */ +#ifdef CONFIG_SOC_SERIES_NRF91X #define SRAM_BASE 0x20000000 #define SHMEM_RANGE KB(128) #define SHMEM_END (SRAM_BASE + SHMEM_RANGE) @@ -131,6 +134,7 @@ BUILD_ASSERT(PM_NRF_MODEM_LIB_RX_ADDRESS % 4 == 0, BUILD_ASSERT(PM_NRF_MODEM_LIB_TRACE_ADDRESS % 4 == 0, "libmodem Trace region base address must be word aligned"); #endif +#endif /* CONFIG_SOC_SERIES_NRF91X */ /* Socket values sanity check */ diff --git a/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c b/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c index 7a78c89fbea7..25a88cdc144a 100644 --- a/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c +++ b/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c @@ -108,10 +108,8 @@ static int util_get_pdn_conn_dyn_params(int cid, struct pdn_conn_dyn_params *ret { struct at_parser parser; size_t param_str_len; - char at_cmd_str[16]; char at_cmd_response_str[512]; char dns_addr_str[128]; - char *at_ptr = at_cmd_response_str; int ret, family, iterator; struct in_addr *addr; struct in6_addr *addr6; @@ -119,16 +117,15 @@ static int util_get_pdn_conn_dyn_params(int cid, struct pdn_conn_dyn_params *ret uint32_t mtu; int family_for_mtu; - sprintf(at_cmd_str, AT_CMD_PDP_CONTEXT_READ_DYN_INFO, cid); - - ret = nrf_modem_at_cmd(at_cmd_response_str, sizeof(at_cmd_response_str), at_cmd_str); + ret = nrf_modem_at_cmd(at_cmd_response_str, sizeof(at_cmd_response_str), + AT_CMD_PDP_CONTEXT_READ_DYN_INFO, cid); if (ret) { mosh_error("Cannot get PDP conn dyn params, ret: %d", ret); return false; } /* Parse the response */ - ret = at_parser_init(&parser, at_ptr); + ret = at_parser_init(&parser, at_cmd_response_str); if (ret) { mosh_error("Could not init AT parser, error: %d\n", ret); return ret; diff --git a/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_ctrl.c b/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_ctrl.c index bdfaa3f1dbae..7fea0d583fa2 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_ctrl.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/dect_phy_ctrl.c @@ -674,6 +674,12 @@ static void dect_phy_ctrl_mdm_on_capability_get_cb( } } +static void dect_phy_ctrl_mdm_on_stf_cover_seq_control_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + printk("WARN: Unexpectedly in %s\n", (__func__)); +} + static void dect_phy_ctrl_mdm_on_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) { ctrl_data.phy_api_initialized = false; @@ -693,6 +699,7 @@ static const struct nrf_modem_dect_phy_callbacks dect_phy_api_config = { .link_config = dect_phy_ctrl_mdm_on_link_configuration_cb, .time_get = dect_phy_ctrl_mdm_time_query_cb, .capability_get = dect_phy_ctrl_mdm_on_capability_get_cb, + .stf_cover_seq_control = dect_phy_ctrl_mdm_on_stf_cover_seq_control_cb, .deinit = dect_phy_ctrl_mdm_on_deinit_cb, }; diff --git a/samples/dect/dect_phy/dect_shell/src/dect/perf/dect_phy_perf.c b/samples/dect/dect_phy/dect_shell/src/dect/perf/dect_phy_perf.c index 57043dbc3434..14fd918bb700 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/perf/dect_phy_perf.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/perf/dect_phy_perf.c @@ -655,6 +655,12 @@ static void dect_phy_perf_capability_get_cb(const uint64_t *time, enum nrf_modem } } +static void dect_phy_perf_stf_cover_seq_control_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + printk("WARN: Unexpectedly in %s\n", (__func__)); +} + static void dect_phy_perf_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) { dect_phy_ctrl_msgq_non_data_op_add(DECT_PHY_CTRL_OP_PERF_CMD_DONE); @@ -672,6 +678,7 @@ static const struct nrf_modem_dect_phy_callbacks perf_phy_api_config = { .link_config = dect_phy_perf_link_configuration_cb, .time_get = dect_phy_perf_time_query_cb, .capability_get = dect_phy_perf_capability_get_cb, + .stf_cover_seq_control = dect_phy_perf_stf_cover_seq_control_cb, .deinit = dect_phy_perf_deinit_cb, }; diff --git a/samples/dect/dect_phy/dect_shell/src/dect/ping/dect_phy_ping.c b/samples/dect/dect_phy/dect_shell/src/dect/ping/dect_phy_ping.c index a0b2b0d6bbc7..ce88d09ae155 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/ping/dect_phy_ping.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/ping/dect_phy_ping.c @@ -785,6 +785,12 @@ static void dect_phy_ping_capability_get_cb(const uint64_t *time, enum nrf_modem dect_app_modem_time_save(time); } +static void dect_phy_ping_stf_cover_seq_control_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + printk("WARN: Unexpectedly in %s\n", (__func__)); +} + static void dect_phy_ping_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) { dect_phy_ctrl_msgq_non_data_op_add(DECT_PHY_CTRL_OP_PING_CMD_DONE); @@ -802,6 +808,7 @@ static const struct nrf_modem_dect_phy_callbacks ping_phy_api_config = { .link_config = dect_phy_ping_link_configuration_cb, .time_get = dect_phy_ping_time_query_cb, .capability_get = dect_phy_ping_capability_get_cb, + .stf_cover_seq_control = dect_phy_ping_stf_cover_seq_control_cb, .deinit = dect_phy_ping_deinit_cb, }; diff --git a/samples/dect/dect_phy/dect_shell/src/dect/rf_tool/dect_phy_rf_tool.c b/samples/dect/dect_phy/dect_shell/src/dect/rf_tool/dect_phy_rf_tool.c index e38d9bf6168f..820f369bbb51 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/rf_tool/dect_phy_rf_tool.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/rf_tool/dect_phy_rf_tool.c @@ -132,7 +132,7 @@ static bool dect_phy_rf_tool_rx_mode(enum dect_phy_rf_tool_mode mode); /**************************************************************************************************/ -void dect_phy_rf_tool_initialize_cb(const uint64_t *time, int16_t temperature, +static void dect_phy_rf_tool_initialize_cb(const uint64_t *time, int16_t temperature, enum nrf_modem_dect_phy_err status, const struct nrf_modem_dect_phy_modem_cfg *modem_configuration) { @@ -149,13 +149,13 @@ void dect_phy_rf_tool_initialize_cb(const uint64_t *time, int16_t temperature, sizeof(struct dect_phy_common_op_initialized_params)); } -void dect_phy_rf_tool_rx_op_stop_cb(uint64_t const *time, enum nrf_modem_dect_phy_err status, +static void dect_phy_rf_tool_rx_op_stop_cb(uint64_t const *time, enum nrf_modem_dect_phy_err status, uint32_t handle) { dect_app_modem_time_save(time); } -void dect_phy_rf_tool_op_complete_cb(uint64_t const *time, int16_t temperature, +static void dect_phy_rf_tool_op_complete_cb(uint64_t const *time, int16_t temperature, enum nrf_modem_dect_phy_err status, uint32_t handle) { struct dect_phy_common_op_completed_params rf_tool_op_completed_params = { @@ -196,7 +196,7 @@ static void dect_phy_rf_tool_rx_pcc_cb(uint64_t const *time, sizeof(struct dect_phy_common_op_pcc_rcv_params)); } -void dect_phy_rf_tool_pcc_crc_failure_cb( +static void dect_phy_rf_tool_pcc_crc_failure_cb( uint64_t const *time, struct nrf_modem_dect_phy_rx_pcc_crc_failure const *crc_failure) { struct dect_phy_common_op_pcc_crc_fail_params pdc_crc_fail_params = { @@ -210,7 +210,7 @@ void dect_phy_rf_tool_pcc_crc_failure_cb( sizeof(struct dect_phy_common_op_pcc_crc_fail_params)); } -void dect_phy_rf_tool_rx_pdc_cb(uint64_t const *time, +static void dect_phy_rf_tool_rx_pdc_cb(uint64_t const *time, struct nrf_modem_dect_phy_rx_pdc_status const *p_rx_status, void const *p_data, uint32_t length) { @@ -240,7 +240,7 @@ void dect_phy_rf_tool_rx_pdc_cb(uint64_t const *time, } } -void dect_phy_rf_tool_on_pdc_crc_failure_cb( +static void dect_phy_rf_tool_on_pdc_crc_failure_cb( uint64_t const *time, struct nrf_modem_dect_phy_rx_pdc_crc_failure const *crc_failure) { struct dect_phy_common_op_pdc_crc_fail_params pdc_crc_fail_params = { @@ -254,29 +254,37 @@ void dect_phy_rf_tool_on_pdc_crc_failure_cb( sizeof(struct dect_phy_common_op_pdc_crc_fail_params)); } -void dect_phy_rf_tool_on_rssi_cb(const uint64_t *time, +static void dect_phy_rf_tool_on_rssi_cb(const uint64_t *time, const struct nrf_modem_dect_phy_rssi_meas *p_result) { printk("WARN: Unexpectedly in %s\n", (__func__)); } -void dect_phy_rf_tool_link_configuration_cb(uint64_t const *time, +static void dect_phy_rf_tool_link_configuration_cb(uint64_t const *time, enum nrf_modem_dect_phy_err status) { printk("WARN: Unexpectedly in %s\n", (__func__)); } -void dect_phy_rf_tool_time_query_cb(uint64_t const *time, enum nrf_modem_dect_phy_err status) +static void dect_phy_rf_tool_time_query_cb( + uint64_t const *time, enum nrf_modem_dect_phy_err status) { } -void dect_phy_rf_tool_capability_get_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err, - const struct nrf_modem_dect_phy_capability *capabilities) +static void dect_phy_rf_tool_capability_get_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err, + const struct nrf_modem_dect_phy_capability *capabilities) { dect_app_modem_time_save(time); } -void dect_phy_rf_tool_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) +static void dect_phy_rf_tool_stf_cover_seq_control_cb( + const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + printk("WARN: Unexpectedly in %s\n", (__func__)); +} + +static void dect_phy_rf_tool_deinit_cb(const uint64_t *time, enum nrf_modem_dect_phy_err err) { dect_phy_rf_tool_msgq_non_data_op_add(DECT_PHY_RF_TOOL_EVT_MDM_DEINITIALIZED); } @@ -293,6 +301,7 @@ static const struct nrf_modem_dect_phy_callbacks rf_tool_phy_api_config = { .link_config = dect_phy_rf_tool_link_configuration_cb, .time_get = dect_phy_rf_tool_time_query_cb, .capability_get = dect_phy_rf_tool_capability_get_cb, + .stf_cover_seq_control = dect_phy_rf_tool_stf_cover_seq_control_cb, .deinit = dect_phy_rf_tool_deinit_cb, }; diff --git a/samples/dect/dect_phy/hello_dect/src/main.c b/samples/dect/dect_phy/hello_dect/src/main.c index b31d1449f9ca..1b1801a6ce86 100644 --- a/samples/dect/dect_phy/hello_dect/src/main.c +++ b/samples/dect/dect_phy/hello_dect/src/main.c @@ -136,6 +136,11 @@ static void capability_get(const uint64_t *time, enum nrf_modem_dect_phy_err err LOG_DBG("capability_get cb time %"PRIu64" status %d", *time, err); } +static void stf_cover_seq_control(const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + LOG_WRN("Unexpectedly in %s\n", (__func__)); +} + /* Dect PHY callbacks. */ static struct nrf_modem_dect_phy_callbacks dect_phy_callbacks = { .init = init, @@ -150,6 +155,7 @@ static struct nrf_modem_dect_phy_callbacks dect_phy_callbacks = { .link_config = link_config, .time_get = time_get, .capability_get = capability_get, + .stf_cover_seq_control = stf_cover_seq_control, }; /* Dect PHY init parameters. */ diff --git a/tests/lib/date_time/CMakeLists.txt b/tests/lib/date_time/CMakeLists.txt index c41241cc6798..7f9377d22085 100644 --- a/tests/lib/date_time/CMakeLists.txt +++ b/tests/lib/date_time/CMakeLists.txt @@ -14,7 +14,8 @@ test_runner_generate(src/main.c) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf" - FUNC_EXCLUDE ".*nrf_modem_at_printf") + FUNC_EXCLUDE ".*nrf_modem_at_printf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/sntp.h) cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/socket.h) diff --git a/tests/lib/location/CMakeLists.txt b/tests/lib/location/CMakeLists.txt index f1a621a3ce42..add304d2a4ca 100644 --- a/tests/lib/location/CMakeLists.txt +++ b/tests/lib/location/CMakeLists.txt @@ -17,7 +17,8 @@ cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/net/rest_client.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_gnss.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_printf" - FUNC_EXCLUDE ".*nrf_modem_at_scanf") + FUNC_EXCLUDE ".*nrf_modem_at_scanf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/net/nrf_cloud.h FUNC_EXCLUDE ".*nrf_cloud_obj_shadow_update") diff --git a/tests/lib/lte_lc/CMakeLists.txt b/tests/lib/lte_lc/CMakeLists.txt index 9101bb70b591..4147d4611597 100644 --- a/tests/lib/lte_lc/CMakeLists.txt +++ b/tests/lib/lte_lc/CMakeLists.txt @@ -13,7 +13,8 @@ test_runner_generate(src/main.c) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf" - FUNC_EXCLUDE ".*nrf_modem_at_printf") + FUNC_EXCLUDE ".*nrf_modem_at_printf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) @@ -27,6 +28,7 @@ target_include_directories(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/lte_link_control/ ${ZEPHYR_NRF_MODULE_DIR}/include/modem/ + ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include ) target_compile_options(app diff --git a/tests/lib/lte_lc_api/CMakeLists.txt b/tests/lib/lte_lc_api/CMakeLists.txt index 3623d660c199..866c238d80ce 100644 --- a/tests/lib/lte_lc_api/CMakeLists.txt +++ b/tests/lib/lte_lc_api/CMakeLists.txt @@ -14,7 +14,8 @@ test_runner_generate(src/lte_lc_api_test.c) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf" - FUNC_EXCLUDE ".*nrf_modem_at_printf") + FUNC_EXCLUDE ".*nrf_modem_at_printf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem.h) diff --git a/tests/lib/modem_jwt/CMakeLists.txt b/tests/lib/modem_jwt/CMakeLists.txt index 686c99d830fb..485a10d939bd 100644 --- a/tests/lib/modem_jwt/CMakeLists.txt +++ b/tests/lib/modem_jwt/CMakeLists.txt @@ -14,9 +14,12 @@ test_runner_generate(src/jwt_test.c) target_include_directories(app PRIVATE src) -cmock_handle(../../../../nrfxlib/nrf_modem/include/nrf_modem_at.h) +cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") # add test file target_sources(app PRIVATE src/jwt_test.c) target_sources(app PRIVATE ../../../lib/modem_jwt/modem_jwt.c) add_definitions(-DCONFIG_MODEM_JWT_MAX_LEN=850) + +target_include_directories(app PRIVATE ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include) diff --git a/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt b/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt index abe03d3d73d5..04581d7b1b80 100644 --- a/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt +++ b/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt @@ -18,7 +18,9 @@ cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/lte_lc.h WORD_EXCLUDE "__deprecated") cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/nrf_modem_lib.h FUNC_EXCLUDE ".*nrf_modem_lib_shutdown_wait") cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/pdn.h) -cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf") +cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h + FUNC_EXCLUDE ".*nrf_modem_at_scanf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_socket.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_errno.h) @@ -41,6 +43,7 @@ target_sources(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/nrf9x_sock target_include_directories(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/lte_net_if + ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include ${ZEPHYR_BASE}/subsys/net/lib/sockets ) diff --git a/tests/lib/nrf_modem_lib/lte_net_if/testcase.yaml b/tests/lib/nrf_modem_lib/lte_net_if/testcase.yaml index 07322235c7ea..c3fe6e460013 100644 --- a/tests/lib/nrf_modem_lib/lte_net_if/testcase.yaml +++ b/tests/lib/nrf_modem_lib/lte_net_if/testcase.yaml @@ -2,6 +2,7 @@ tests: nrf_modem_lib.lte_net_if: sysbuild: true tags: nrf_modem_lib sysbuild ci_tests_lib_nrf_modem_lib - platform_allow: native_posix + platform_allow: + - native_sim integration_platforms: - - native_posix + - native_sim diff --git a/tests/lib/nrf_modem_lib/nrf9x_sockets/testcase.yaml b/tests/lib/nrf_modem_lib/nrf9x_sockets/testcase.yaml index df99de0d58e0..2a9198862b53 100644 --- a/tests/lib/nrf_modem_lib/nrf9x_sockets/testcase.yaml +++ b/tests/lib/nrf_modem_lib/nrf9x_sockets/testcase.yaml @@ -1,7 +1,8 @@ tests: unity.nrf9x_sockets_test: sysbuild: true - platform_allow: native_posix tags: nrf_modem_lib sysbuild ci_tests_lib_nrf_modem_lib + platform_allow: + - native_sim integration_platforms: - - native_posix + - native_sim diff --git a/tests/lib/sms/CMakeLists.txt b/tests/lib/sms/CMakeLists.txt index 9ea329cee2dd..7a98d84e740f 100644 --- a/tests/lib/sms/CMakeLists.txt +++ b/tests/lib/sms/CMakeLists.txt @@ -14,7 +14,8 @@ test_runner_generate(src/sms_test.c) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_at.h FUNC_EXCLUDE ".*nrf_modem_at_scanf" - FUNC_EXCLUDE ".*nrf_modem_at_printf") + FUNC_EXCLUDE ".*nrf_modem_at_printf" + WORD_EXCLUDE "__nrf_modem_(printf|scanf)_like\(.*\)") # When mocking nrf_modem_at then nrf_modem/include must manually be added # because CONFIG_NRF_MODEM_LINK_BINARY=n diff --git a/west.yml b/west.yml index 46b7acec93be..ac7c0cda2e9c 100644 --- a/west.yml +++ b/west.yml @@ -149,7 +149,7 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: 823dc44860702fcad14b1b12c32c99d8fa11be44 + revision: 5d75e4047488d4056fe34f8343743a5959a82508 - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m