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
8 changes: 6 additions & 2 deletions applications/serial_lte_modem/overlay-cmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ CONFIG_SLM_SKIP_READY_MSG=y
# Zephyr modem subsystem
CONFIG_MODEM_MODULES=y
CONFIG_MODEM_CMUX=y
CONFIG_MODEM_BACKEND_UART=y
CONFIG_MODEM_BACKEND_UART_ASYNC_TRANSMIT_TIMEOUT_MS=1000

# Enable SLM UART backend
CONFIG_MODEM_BACKEND_UART=n
CONFIG_MODEM_BACKEND_UART_ASYNC=n
CONFIG_MODEM_BACKEND_UART_SLM=y
CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS=1000

# debug options
#CONFIG_MODEM_CMUX_LOG_LEVEL_DBG=y
Expand Down
16 changes: 10 additions & 6 deletions applications/serial_lte_modem/overlay-ppp-cmux-linux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@ CONFIG_SLM_CMUX=y
CONFIG_SLM_PPP=y
CONFIG_SLM_CR_TERMINATION=y

# Assume at least baudrate 115200 for UART
# so CMUX frame can be received in 12 ms (134*10/115200)
CONFIG_MODEM_BACKEND_UART_ASYNC_RECEIVE_IDLE_TIMEOUT_MS=12
CONFIG_MODEM_CMUX_MTU=127
CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE=536
CONFIG_SLM_CMUX_UART_BUFFER_SIZE=6000

# Enable SLM UART backend
CONFIG_MODEM_BACKEND_UART=n
CONFIG_MODEM_BACKEND_UART_ASYNC=n
CONFIG_MODEM_BACKEND_UART_SLM=y

# For sending full 6000 bytes at 115200 baudrate
# 6000 * 10 / 115200 = 521 ms
CONFIG_MODEM_BACKEND_UART_ASYNC_TRANSMIT_TIMEOUT_MS=521
CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC=y
CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS=521
# Assume at least baudrate 115200 for UART
# so CMUX frame can be received in 12 ms (134*10/115200)
CONFIG_MODEM_BACKEND_UART_SLM_RECEIVE_IDLE_TIMEOUT_MS=12

# These buffers are unused after AT#CMUX is enabled
# so use minimal buffer size
Expand All @@ -43,7 +48,6 @@ CONFIG_NET_L2_PPP=y
CONFIG_MODEM_MODULES=y
CONFIG_MODEM_CMUX=y
CONFIG_MODEM_PPP=y
CONFIG_MODEM_BACKEND_UART=y

# L2 protocol
CONFIG_NET_L2_PPP_MGMT=y
Expand Down
9 changes: 6 additions & 3 deletions applications/serial_lte_modem/overlay-ppp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ CONFIG_NET_NATIVE=y
CONFIG_NET_L2_PPP=y
CONFIG_MODEM_MODULES=y
CONFIG_MODEM_PPP=y
CONFIG_MODEM_BACKEND_UART=y
CONFIG_MODEM_BACKEND_UART_ASYNC_TRANSMIT_TIMEOUT_MS=1000
CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC=y

# Enable SLM UART backend
CONFIG_MODEM_BACKEND_UART=n
CONFIG_MODEM_BACKEND_UART_ASYNC=n
CONFIG_MODEM_BACKEND_UART_SLM=y
CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS=1000

# L2 protocol
CONFIG_NET_L2_PPP_MGMT=y
Expand Down
9 changes: 5 additions & 4 deletions applications/serial_lte_modem/src/slm_cmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#endif
#include "slm_util.h"
#include <zephyr/logging/log.h>
#include <zephyr/modem/backend/uart.h>
#include <zephyr/modem/backend/uart_slm.h>
#include <zephyr/modem/cmux.h>
#include <zephyr/modem/pipe.h>
#include <assert.h>
Expand All @@ -35,7 +35,7 @@ static struct {
/* UART backend */
struct modem_pipe *uart_pipe;
bool uart_pipe_open;
struct modem_backend_uart uart_backend;
struct modem_backend_uart_slm uart_backend;
uint8_t uart_backend_receive_buf[CONFIG_SLM_CMUX_UART_BUFFER_SIZE]
__aligned(sizeof(void *));
uint8_t uart_backend_transmit_buf[CONFIG_SLM_CMUX_UART_BUFFER_SIZE];
Expand Down Expand Up @@ -348,15 +348,16 @@ static int cmux_start(void)
}

{
const struct modem_backend_uart_config uart_backend_config = {
const struct modem_backend_uart_slm_config uart_backend_config = {
.uart = DEVICE_DT_GET(DT_CHOSEN(ncs_slm_uart)),
.receive_buf = cmux.uart_backend_receive_buf,
.receive_buf_size = sizeof(cmux.uart_backend_receive_buf),
.transmit_buf = cmux.uart_backend_transmit_buf,
.transmit_buf_size = sizeof(cmux.uart_backend_transmit_buf),
};

cmux.uart_pipe = modem_backend_uart_init(&cmux.uart_backend, &uart_backend_config);
cmux.uart_pipe =
modem_backend_uart_slm_init(&cmux.uart_backend, &uart_backend_config);
if (!cmux.uart_pipe) {
return -ENODEV;
}
Expand Down
8 changes: 4 additions & 4 deletions applications/serial_lte_modem/src/slm_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <modem/lte_lc.h>
#include <modem/pdn.h>
#include <zephyr/modem/ppp.h>
#include <zephyr/modem/backend/uart.h>
#include <zephyr/modem/backend/uart_slm.h>
#include <zephyr/net/ethernet.h>
#include <zephyr/net/net_if.h>
#include <zephyr/net/ppp.h>
Expand Down Expand Up @@ -594,20 +594,20 @@ int slm_ppp_init(void)
}

{
static struct modem_backend_uart ppp_uart_backend;
static struct modem_backend_uart_slm ppp_uart_backend;
static uint8_t ppp_uart_backend_receive_buf[sizeof(ppp_data_buf)]
__aligned(sizeof(void *));
static uint8_t ppp_uart_backend_transmit_buf[sizeof(ppp_data_buf)];

const struct modem_backend_uart_config uart_backend_config = {
const struct modem_backend_uart_slm_config uart_backend_config = {
.uart = ppp_uart_dev,
.receive_buf = ppp_uart_backend_receive_buf,
.receive_buf_size = sizeof(ppp_uart_backend_receive_buf),
.transmit_buf = ppp_uart_backend_transmit_buf,
.transmit_buf_size = sizeof(ppp_uart_backend_transmit_buf),
};

ppp_pipe = modem_backend_uart_init(&ppp_uart_backend, &uart_backend_config);
ppp_pipe = modem_backend_uart_slm_init(&ppp_uart_backend, &uart_backend_config);
if (!ppp_pipe) {
return -ENOSYS;
}
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: 926fafbe9f0745eb3c3f0b37e8bfa9c0afc1db13
revision: 964736df4b123d94117477fd05337f999b025026
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down
Loading