This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[nRF Connect SDK] How to add SMP Server into my project?

Target nRF52832(nrf52dk_nrf52832)
SDK NCS v1.9.1
Base source
1. C:\Users\user\ncs\v1.9.1\nrf\samples\bluetooth\peripheral_hids_keyboard
2. C:\Users\user\ncs\v1.9.1\nrf\samples\bluetooth\peripheral_uart
My project require two mode(HID and NUS).
I made new project that support two mode.(User can select mode, and each mode will begin at boot time).

First, I made image of following sample and found it works well. (via Android). I could download & flash new bin.
<C:\Users\user\ncs\v1.9.1\zephyr\samples\subsys\mgmt\mcumgr\smp_svr>

Next, I try to make image (nrf\samples\bluetooth\peripheral_uart). Because it had similar option.
I add those definition to prj.conf but building image failed with error message.

My question is how I add SMP server implementations into my project.
Can you please let me have any guide or sample?

--------------------------------------------------------------------------------------------------------------------
[Error messgae]
cmd.exe /C "cd . && C:\Users\user\ncs\v1.9.1\toolchain\opt\bin\arm-none-eabi-gcc.exe @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\Users\user\ncs\v1.9.1\nrf\samples\bluetooth\peripheral_hids_keyboard.0\build\zephyr && C:\Users\user\ncs\v1.9.1\toolchain\opt\bin\cmake.exe -E echo ""
c:/users/user/ncs/v1.9.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr\zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
c:/users/user/ncs/v1.9.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 10456 bytes
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

--------------------------------------------------------------------------------------------------------------------
[prj.conf]
CONFIG_MCUMGR=y
CONFIG_MCUMGR_SMP_BT=y
CONFIG_MCUMGR_SMP_BT_AUTHEN=n
CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL=y

CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y

# Enable custom SMP request to erase settings partition.
CONFIG_MCUMGR_GRP_ZEPHYR_BASIC=y
CONFIG_MCUMGR_GRP_BASIC_CMD_STORAGE_ERASE=y

# Increase system workqueue stack size to prevent stack overflows while handling
# SMP requests.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2800

CONFIG_BT_L2CAP_TX_MTU=498
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_ACL_RX_SIZE=502

# Use connection parameters that ensure quick data transfer
CONFIG_BT_PERIPHERAL_PREF_MIN_INT=6
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=6
CONFIG_BT_PERIPHERAL_PREF_LATENCY=99
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400

# LEDs are not inverted on Thingy:53
CONFIG_DK_LIBRARY_INVERT_LEDS=n

# Bootloader configuration

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_IMAGE_VERSION="1.0.0+0"
CONFIG_UPDATEABLE_IMAGE_NUMBER=2

CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

Related