[SINGLE SLOT/DFU] FW loader/ble_mcumgr customization

Hi,

I am developing with NCS 3.2.3 on the nRF54L15.

I need to customize the FW loader located here:
github.com/.../ble_mcumgr

The customization is related to the BLE device name, which should include the device serial number, in the form:
device_name-serial_number.

Basically, I need to override the implementation from:
github.com/.../bluetooth.c

To do that, I "retarget" the bluetooth.c implementation by adding the following to my CMakeLists.txt (executed when building the ble_mcumgr image):

# HACK:using the following hack the original bluetooth.c is not considered from build system, ref: https://stackoverflow.com/questions/63157793/remove-a-source-file-after-adding-it-with-target-sources-in-cmake
# https://cmake.org/cmake/help/v3.21/prop_sf/HEADER_FILE_ONLY.html
set_source_files_properties(${ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c TARGET_DIRECTORY app PROPERTIES HEADER_FILE_ONLY ON)
target_sources(app PRIVATE bluetooth.c)

This way I can transparently reuse everything from the SDK without duplicating the whole ble_mcumgr application.

In your opinion, is this the best approach?

Thanks,

Alessandro

Parents Reply Children
No Data
Related