subsys: mgmt: CMake and Kconfig support.
Add the necessary CMakeLists.txt and Kconfig files for the mgmt subsystem. Signed-off-by: Christopher Collins <ccollins@apache.org>
This commit is contained in:
parent
d14b1aca62
commit
3986ef2770
4 changed files with 110 additions and 1 deletions
|
@ -6,9 +6,9 @@ add_subdirectory_ifdef(CONFIG_CONSOLE_SHELL shell)
|
||||||
add_subdirectory_ifdef(CONFIG_CPLUSPLUS cpp)
|
add_subdirectory_ifdef(CONFIG_CPLUSPLUS cpp)
|
||||||
add_subdirectory_ifdef(CONFIG_DISK_ACCESS disk)
|
add_subdirectory_ifdef(CONFIG_DISK_ACCESS disk)
|
||||||
add_subdirectory(fs)
|
add_subdirectory(fs)
|
||||||
|
add_subdirectory_ifdef(CONFIG_MCUMGR mgmt)
|
||||||
add_subdirectory_ifdef(CONFIG_MCUBOOT_IMG_MANAGER dfu)
|
add_subdirectory_ifdef(CONFIG_MCUBOOT_IMG_MANAGER dfu)
|
||||||
add_subdirectory_ifdef(CONFIG_NET_BUF net)
|
add_subdirectory_ifdef(CONFIG_NET_BUF net)
|
||||||
add_subdirectory_ifdef(CONFIG_USB usb)
|
add_subdirectory_ifdef(CONFIG_USB usb)
|
||||||
add_subdirectory(mgmt)
|
|
||||||
add_subdirectory(random)
|
add_subdirectory(random)
|
||||||
add_subdirectory(storage)
|
add_subdirectory(storage)
|
||||||
|
|
|
@ -19,6 +19,8 @@ source "subsys/fs/Kconfig"
|
||||||
|
|
||||||
source "subsys/logging/Kconfig"
|
source "subsys/logging/Kconfig"
|
||||||
|
|
||||||
|
source "subsys/mgmt/Kconfig"
|
||||||
|
|
||||||
source "subsys/net/Kconfig"
|
source "subsys/net/Kconfig"
|
||||||
|
|
||||||
source "subsys/shell/Kconfig"
|
source "subsys/shell/Kconfig"
|
||||||
|
|
11
subsys/mgmt/CMakeLists.txt
Normal file
11
subsys/mgmt/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
zephyr_library()
|
||||||
|
zephyr_library_sources(buf.c)
|
||||||
|
zephyr_library_sources(smp.c)
|
||||||
|
zephyr_library_sources_ifdef(CONFIG_MCUMGR_SMP_BT smp_bt.c)
|
||||||
|
zephyr_library_sources_ifdef(CONFIG_MCUMGR_SMP_SHELL smp_shell.c)
|
||||||
|
zephyr_library_sources_ifdef(CONFIG_MCUMGR_SMP_UART smp_uart.c)
|
||||||
|
zephyr_library_link_libraries(MCUMGR)
|
||||||
|
|
||||||
|
if (CONFIG_MCUMGR_SMP_SHELL OR CONFIG_MCUMGR_SMP_UART)
|
||||||
|
zephyr_library_sources(serial_util.c)
|
||||||
|
endif ()
|
96
subsys/mgmt/Kconfig
Normal file
96
subsys/mgmt/Kconfig
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
# Kconfig - mcumgr configuration options
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright Runtime.io 2018. All rights reserved.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
menu "Management"
|
||||||
|
|
||||||
|
config MCUMGR_SMP_BT
|
||||||
|
bool
|
||||||
|
prompt "Bluetooth mcumgr SMP transport"
|
||||||
|
select MCUMGR
|
||||||
|
select BT
|
||||||
|
select BT_PERIPHERAL
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enables handling of SMP commands received over Bluetooth.
|
||||||
|
|
||||||
|
config MCUMGR_SMP_SHELL
|
||||||
|
bool
|
||||||
|
prompt "Shell mcumgr SMP transport"
|
||||||
|
select MCUMGR
|
||||||
|
select UART_CONSOLE_MCUMGR
|
||||||
|
select CONSOLE_SHELL
|
||||||
|
select MBEDTLS
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enables handling of SMP commands received over shell. This allows
|
||||||
|
the shell to be use for both mcumgr commands and shell commands.
|
||||||
|
|
||||||
|
if MCUMGR_SMP_SHELL
|
||||||
|
config MCUMGR_SMP_SHELL_MTU
|
||||||
|
int
|
||||||
|
prompt "Shell SMP MTU"
|
||||||
|
default 256
|
||||||
|
help
|
||||||
|
Maximum size of SMP frames sent and received over shell. This value
|
||||||
|
must satisfy the following relation:
|
||||||
|
MCUMGR_SMP_SHELL_MTU <= MCUMGR_BUF_SIZE + 2
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
config MCUMGR_SMP_UART
|
||||||
|
bool
|
||||||
|
prompt "UART mcumgr SMP transport"
|
||||||
|
select MCUMGR
|
||||||
|
select UART_MCUMGR
|
||||||
|
select MBEDTLS
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enables handling of SMP commands received over UART. This is a
|
||||||
|
lightweight alternative to MCUMGR_SMP_SHELL. It allows mcumgr
|
||||||
|
commands to be received over UART without requiring an additional
|
||||||
|
thread.
|
||||||
|
|
||||||
|
if MCUMGR_SMP_UART
|
||||||
|
config MCUMGR_SMP_UART_MTU
|
||||||
|
int
|
||||||
|
prompt "UART SMP MTU"
|
||||||
|
default 256
|
||||||
|
help
|
||||||
|
Maximum size of SMP frames sent and received over UART, in bytes.
|
||||||
|
This value must satisfy the following relation:
|
||||||
|
MCUMGR_SMP_UART_MTU <= MCUMGR_BUF_SIZE + 2
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
config MCUMGR_BUF_COUNT
|
||||||
|
int
|
||||||
|
prompt "Number of mcumgr buffers"
|
||||||
|
default 4
|
||||||
|
help
|
||||||
|
The number of net_bufs to allocate for mcumgr. These buffers are
|
||||||
|
used for both requests and responses.
|
||||||
|
|
||||||
|
config MCUMGR_BUF_SIZE
|
||||||
|
int
|
||||||
|
prompt "Size of each mcumgr buffer"
|
||||||
|
default 384
|
||||||
|
help
|
||||||
|
The size, in bytes, of each mcumgr buffer. This value must satisfy
|
||||||
|
the following relation:
|
||||||
|
MCUMGR_BUF_SIZE >= transport-specific-MTU + transport-overhead
|
||||||
|
|
||||||
|
config MCUMGR_BUF_USER_DATA_SIZE
|
||||||
|
int
|
||||||
|
prompt "Size of mcumgr buffer user data"
|
||||||
|
default 7
|
||||||
|
help
|
||||||
|
The size, in bytes, of user data to allocate for each mcumgr buffer.
|
||||||
|
Different mcumgr transports impose different requirements for this
|
||||||
|
setting. A value of 7 is sufficient for UART, shell, and bluetooth.
|
||||||
|
|
||||||
|
endmenu
|
Loading…
Add table
Add a link
Reference in a new issue