Skip to content

Commit b66f13c

Browse files
MarkusLassilaSeppoTakalo
authored andcommitted
applications: serial_lte_modem: Free RAM for Thingy boards
Release unnecessarily used RAM to allow the CMUX + PPP usage with Thingy:91 and CMUX + PPP + modem traces with Thingy:91 X. CONFIG_SLM_CMUX_UART_BUFFER_SIZE only needs to be slightly larger than CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE. Signed-off-by: Markus Lassila <[email protected]>
1 parent a9891c4 commit b66f13c

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

applications/serial_lte_modem/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ config SLM_UART_RX_BUF_COUNT
5959
config SLM_UART_RX_BUF_SIZE
6060
int "Receive buffer size for UART"
6161
range 128 4096
62+
default 2048 if BOARD_THINGY91_NRF9160_NS || BOARD_THINGY91X_NRF9151_NS
6263
default 256
6364
help
6465
Amount of received (RX), unprocessed, UART traffic that can be held by single buffer.
66+
Increase buffer space for Thingy:91 and Thingy:91 X as hardware flow control is not used.
6567
These buffers are not used when CMUX is in use.
6668

6769
config SLM_UART_TX_BUF_SIZE
@@ -189,7 +191,7 @@ config SLM_CMUX
189191
config SLM_CMUX_UART_BUFFER_SIZE
190192
int "UART buffer size for CMUX"
191193
depends on SLM_CMUX
192-
default 6000
194+
default 600
193195
help
194196
Size of the buffer for data received in CMUX mode.
195197
Same buffer size is used for both RX and TX.

applications/serial_lte_modem/boards/thingy91_nrf9160_ns.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@
1010

1111
# Configuration related to external sensors.
1212
CONFIG_SLM_POWER_PIN=26
13-
14-
# Increase buffer space as hardware flow control is not used with Thingy:91.
15-
CONFIG_SLM_UART_RX_BUF_SIZE=2048

applications/serial_lte_modem/boards/thingy91x_nrf9151_ns.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@
1010

1111
# Configuration related to external sensors.
1212
CONFIG_SLM_POWER_PIN=26
13-
14-
# Increase buffer space as hardware flow control is not used with Thingy:91 X.
15-
CONFIG_SLM_UART_RX_BUF_SIZE=2048

applications/serial_lte_modem/overlay-cmux.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ CONFIG_MODEM_BACKEND_UART_ASYNC=n
1717
CONFIG_MODEM_BACKEND_UART_SLM=y
1818
CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS=1000
1919

20+
# These buffers are unused after AT#CMUX is enabled
21+
# so use minimal buffer size
22+
CONFIG_SLM_UART_RX_BUF_COUNT=2
23+
CONFIG_SLM_UART_RX_BUF_SIZE=128
24+
CONFIG_SLM_UART_TX_BUF_SIZE=128
25+
2026
# debug options
2127
#CONFIG_MODEM_CMUX_LOG_LEVEL_DBG=y
2228
#CONFIG_MODEM_MODULES_LOG_LEVEL_DBG=y

applications/serial_lte_modem/overlay-ppp-cmux-linux.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ CONFIG_SLM_CR_TERMINATION=y
1111

1212
CONFIG_MODEM_CMUX_MTU=127
1313
CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE=536
14-
CONFIG_SLM_CMUX_UART_BUFFER_SIZE=6000
14+
CONFIG_SLM_CMUX_UART_BUFFER_SIZE=600
1515

1616
# Enable SLM UART backend
1717
CONFIG_MODEM_BACKEND_UART=n
1818
CONFIG_MODEM_BACKEND_UART_ASYNC=n
1919
CONFIG_MODEM_BACKEND_UART_SLM=y
2020

21-
# For sending full 6000 bytes at 115200 baudrate
22-
# 6000 * 10 / 115200 = 521 ms
23-
CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS=521
21+
# For sending full 600 bytes at 115200 baudrate
22+
# 600 * 10 / 115200 = 52.1 ms
23+
CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS=53
2424
# Assume at least baudrate 115200 for UART
2525
# so CMUX frame can be received in 12 ms (134*10/115200)
2626
CONFIG_MODEM_BACKEND_UART_SLM_RECEIVE_IDLE_TIMEOUT_MS=12
2727

2828
# These buffers are unused after AT#CMUX is enabled
2929
# so use minimal buffer size
30-
CONFIG_SLM_UART_RX_BUF_COUNT=3
30+
CONFIG_SLM_UART_RX_BUF_COUNT=2
3131
CONFIG_SLM_UART_RX_BUF_SIZE=128
3232
CONFIG_SLM_UART_TX_BUF_SIZE=128
3333

0 commit comments

Comments
 (0)