Commit 2cbaf01b authored by Mateusz Syc's avatar Mateusz Syc Committed by Anas Nashif
Browse files

samples: subsys: mgmt: smp_svr: Possible download log file from flash FS



Added ability to downlaod log file from flash with LittleFS
using mcumgr.

Signed-off-by: default avatarMateusz Syc <Mateusz.Syc@nordicsemi.no>
parent 73d658bd
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -333,3 +333,16 @@ on the next reset unless the image is confirmed. To confirm the new image:
Note that if you try to send the very same image that is already flashed in
slot-0 then the procedure will not complete successfully since the hash values
for both slots will be identical.

Download file from File System
******************************

SMP server supports downloading files from File System on device via
:file:`mcumgr`. This is useful with FS log backend, when files are stored in
non-volatile memory. Build and flash both MCUboot and smp_svr applications and
then use :file:`mcumgr` with :file:`download` command, e.g.:

.. code-block:: console

   mcumgr --conntype serial --connstring='dev=/dev/ttyACM0,baud=115200' \
   fs download /lfs/log.0000 ~/log.txt
+7 −1
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@
#ifdef CONFIG_MCUMGR_CMD_SHELL_MGMT
#include "shell_mgmt/shell_mgmt.h"
#endif
#ifdef CONFIG_MCUMGR_CMD_FS_MGMT
#include "fs_mgmt/fs_mgmt.h"
#endif

#define LOG_LEVEL LOG_LEVEL_DBG
#include <logging/log.h>
@@ -53,7 +56,7 @@ static struct fs_mount_t littlefs_mnt = {
	.type = FS_LITTLEFS,
	.fs_data = &cstorage,
	.storage_dev = (void *)FLASH_AREA_ID(storage),
	.mnt_point = "/lfs"
	.mnt_point = "/lfs1"
};
#endif

@@ -87,6 +90,9 @@ void main(void)
#ifdef CONFIG_MCUMGR_CMD_SHELL_MGMT
	shell_mgmt_register_group();
#endif
#ifdef CONFIG_MCUMGR_CMD_FS_MGMT
	fs_mgmt_register_group();
#endif
#ifdef CONFIG_MCUMGR_SMP_BT
	start_smp_bluetooth();
#endif