Skip to content
Closed
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
6 changes: 3 additions & 3 deletions app/overlay-ppp-cmux-linux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ CONFIG_SM_CMUX=y
CONFIG_SM_PPP=y

CONFIG_MODEM_CMUX_MTU=127
CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE=536
CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA=399

# With CMUX, the UART buffers should be at least the size of the
# CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE
CONFIG_SM_UART_RX_BUF_COUNT=3
CONFIG_SM_UART_RX_BUF_SIZE=256
CONFIG_SM_UART_TX_BUF_SIZE=768
CONFIG_SM_UART_RX_BUF_SIZE=532
CONFIG_SM_UART_TX_BUF_SIZE=532

# When using PPP, disable commands of IP-based protocols to save flash space.
CONFIG_SM_FTPC=n
Expand Down
33 changes: 29 additions & 4 deletions app/overlay-zephyr-modem-nrf9160dk-nrf52840.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,46 @@

/ {
chosen {
ncs,sm-uart = &dtr_uart;
ncs,sm-uart = &dtr_uart1;
};
};

/* nRF52 <=> nRF91 interface pins.
* (see https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/board_controller.html)
* (see https://docs.nordicsemi.com/bundle/ug_nrf9160_dk/page/UG/nrf91_DK/hw_description/nrf9160_board_controller.html)
*/
&uart1 {
current-speed = <115200>;
hw-flow-control;
status = "okay";
dtr_uart: dtr-uart {
pinctrl-0 = <&uart1_default_alt>;
pinctrl-1 = <&uart1_sleep_pull>;
pinctrl-names = "default", "sleep";

dtr_uart1: dtr_uart1 {
compatible = "nordic,dtr-uart";
dtr-gpios = <&interface_to_nrf52840 4 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
dtr-gpios = <&interface_to_nrf52840 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
ri-gpios = <&interface_to_nrf52840 5 (GPIO_ACTIVE_LOW)>;
status = "okay";
};
};

&pinctrl {
uart1_sleep_pull: uart1_sleep_pull {
/* Enable pull-up when sleeping */
group1 {
psels = <NRF_PSEL(UART_TX, 0, 18)>,
<NRF_PSEL(UART_RTS, 0, 21)>;
low-power-enable;
bias-pull-up;
};
group2 {
psels = <NRF_PSEL(UART_RX, 0, 17)>,
<NRF_PSEL(UART_CTS, 0, 19)>;
low-power-enable;
};
};
};

&dtr_uart0 {
status = "disabled";
};
1 change: 1 addition & 0 deletions app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ CONFIG_GPIO_NRFX=y
CONFIG_SERIAL=y
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_NRFX_TIMER2=y

# Stacks and heaps
Expand Down
4 changes: 2 additions & 2 deletions app/src/sm_cmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ static struct {

/* CMUX */
struct modem_cmux instance;
uint8_t cmux_receive_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE];
uint8_t cmux_transmit_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE];
uint8_t cmux_receive_buf[MODEM_CMUX_WORK_BUFFER_SIZE];
uint8_t cmux_transmit_buf[MODEM_CMUX_WORK_BUFFER_SIZE];

/* CMUX channels (Data Link Connection Identifier); index = address - 1 */
struct cmux_dlci {
Expand Down
4 changes: 4 additions & 0 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ manifest:
repo-path: sdk-nrf
revision: v3.2.0-preview2
import: true
- name: zephyr
url: https://github.com/SeppoTakalo/sdk-zephyr
revision: ncs_cmux_power_control
import: true
Loading