<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs</link><description>hello Nordic 
 
 i am using nrf52832 and nrf52840, working with ncs v2.3.0 
 currently i am using the SMP service for DFU but i also want to use the service&amp;#39;s property to work directly with file system. 
 1. i saw a mention about security but if i have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Jul 2024 12:19:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs" /><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/495014?ContentTypeID=1</link><pubDate>Mon, 22 Jul 2024 12:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc1ee6b2-d8be-4aa2-ae14-3d2221cb3c22</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Icj&lt;/p&gt;
&lt;p&gt;we have added a separate follow up command from the central after it finishes the upload it will send apply command for the peripheral to read the file that was uploaded&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/494752?ContentTypeID=1</link><pubDate>Fri, 19 Jul 2024 10:54:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:195a1c47-38d2-4a1d-bd57-a9c413f3f97e</guid><dc:creator>lcj</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/ziv123"&gt;ziv123&lt;/a&gt;&amp;nbsp;did you figure this out? I want to use reuse the SMP from MCUBoot and was thinking how I would approach this. I am using littlefs as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/460062?ContentTypeID=1</link><pubDate>Wed, 13 Dec 2023 08:12:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:710e206c-04ed-4523-bc9a-c578437f003b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Sorry that I couldn&amp;#39;t do much help here. But doesn&amp;#39;t the client send a close file command after it&amp;#39;s done uploading&amp;nbsp;the file ?&lt;/p&gt;
&lt;p&gt;The server should receive a &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/smp_groups/smp_group_8.html#file-close-request"&gt;File Close&lt;/a&gt; request from the client.&amp;nbsp;Maybe you can inspect how the phone does a DFU update via BLE to check if the phone send such File Close request or not.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/459953?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 14:13:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df873dee-d605-4a05-ac30-c1db52179599</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/459943"]You can take a look at this guidelines to send a request or contribution to[/quote]
&lt;p&gt;i&amp;#39;ll look to it&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/459943"]There is a Zephyr&amp;#39;s Discord channel that you can post your question[/quote]
&lt;p&gt;i know, this is actually how i know there is no such event of upload done in smp&amp;nbsp;&lt;/p&gt;
&lt;p&gt;this is why i asked :&lt;/p&gt;
[quote userid="90084" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/459860"]maybe you know if there is an option to register for an event of fs_close() for specific file in lfs ?[/quote]
&lt;p&gt;without any regards to SMP&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/459943"]For example file status request is Opcode 0, Group ID 8, Command ID 1[/quote]
&lt;p&gt;i am familiare&amp;nbsp;with that but i am looking for the server how receives the file to know when it has finished and not to poll from the client to know when it is done and send another commend for the server to read the file&lt;/p&gt;
&lt;p&gt;if you know about the lfs that would be nice, if not then i will close this thread once i have a PR ready in zephyr with the addition of the event&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/459943?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 13:57:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66b35faf-b8dc-455b-bea2-e1a54002f2fe</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&lt;br /&gt;You can take a look at this guidelines to send a request or contribution to Zephyr:&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/contribute/index.html#general-guidelines"&gt;https://docs.zephyrproject.org/latest/contribute/index.html#general-guidelines&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There is a Zephyr&amp;#39;s Discord channel that you can post your question :&amp;nbsp;&lt;a href="https://discord.com/invite/Ck7jw53nU2"&gt;https://discord.com/invite/Ck7jw53nU2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As I mentioned I haven&amp;#39;t worked with the SMP protocol, but I believe that what I pointed you to doesn&amp;#39;t require you to modify the SMP protocol. What I pointed you to is part of the SMP protocol:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/smp_protocol.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/smp_protocol.html&lt;/a&gt;&amp;nbsp;&lt;br /&gt;For example file status request is Opcode 0, Group ID 8, Command ID 1&lt;/p&gt;
&lt;p&gt;If you write your own Bluetooth SMP client you should be able to send such command and wait for the file status response back.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/459860?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 08:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e102eed-c474-4f8e-97cc-0a7fc5469468</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&lt;/p&gt;
&lt;p&gt;it seems there is no event for upload done on the receiving side with the ncs&lt;/p&gt;
&lt;p&gt;(i wonder how to suggest to add one to zephyr)&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/457538"]When you upload a chunk you will receive a file upload response that tell at which offset it has received the file chunk[/quote]
&lt;p&gt;not sure i understand, this part of code is in the ncs and i don&amp;#39;t think its a good practice to add my code there.&lt;/p&gt;
&lt;p&gt;maybe you know if there is an option to register for an event of fs_close() for specific file in lfs ?&lt;/p&gt;
&lt;p&gt;if not, maybe i can create an event and publish it with zbus ?&lt;/p&gt;
&lt;p&gt;what do you think ?&lt;/p&gt;
&lt;p&gt;hope to read from you soon&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/457538?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2023 12:04:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19d90c49-17a7-4547-87fb-c8ad5d8e8cda</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;br /&gt;I dont have much experience with the SMP protocol, but have you looked at the specification ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/smp_groups/smp_group_8.html#mcumgr-smp-group-8"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/smp_groups/smp_group_8.html#mcumgr-smp-group-8&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When you upload a chunk you will receive a file upload response that tell at which offset it has received the file chunk.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/457494?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2023 09:24:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cafa4ed-ef62-4b3a-b10a-5e5d0ac9b6d2</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&lt;/p&gt;
&lt;p&gt;OK, figured out the issue with the throughput and closed the mentioned thread.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;one last question, hope you can help, one i finish the transfer of the file to my file system i need the received device to read it so it has to be in formed some how, i did not see a place for give some handler or a way to register for file upload done event or something like that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;any idea how i can get notified with in the device on the upload finish ?&lt;/p&gt;
&lt;p&gt;hope to read from you soon&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/455461?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 09:13:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9f19326-ab07-41e1-aace-c4d63b997671</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;br /&gt;I don&amp;#39;t have the insight on how exactly the file system in Zephyr works. But keeping a map file that need to be updated whenever you have a new file may wear the flash area that the map file is located.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please be aware that we don&amp;#39;t make the file system in Zephyr. I would suggest to check on Zephyr support channel as well.&amp;nbsp;&lt;br /&gt;Please continue in the ticket with Andreas.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/455379?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 15:50:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97066f8c-a638-4b65-b911-5363f2152fa6</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/455369"]It&amp;#39;s because the system need to find where the file is located[/quote]
&lt;p&gt;is it not saved on some map for file name and address or ptr in a small area in flash, seems very wastful other wise (also considering that up until ncs v2.5.0 fs upload/download using smp requires to open and close the file on each fs_mgmt event&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/455369"]As file system it&amp;#39;s normal that it has to do more reading than a simple one single read if you want to get the data out.&amp;nbsp;[/quote]
&lt;p&gt;some overhead is reasonable but i am talking about a serious over head and the reading of all the file happen also at the write operation, after the file was already opened which does not make any sense, first because it is upload and not download and second cause it will get only few bytes to write in each fs_mgmt_upload event so how come it reads all the file again (after opening) ??&lt;/p&gt;
&lt;p&gt;(i added some prints in ncs &amp;quot;fs_mgmt_write&amp;quot; and&amp;nbsp; as can be seen in the code here , and added part of the rtt log as a file)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4456.canary_5F00_upload.txt"&gt;/cfs-file/__key/communityserver-discussions-components-files/4/4456.canary_5F00_upload.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static int fs_mgmt_write(const char *path, size_t offset,
			 const void *data, size_t len)
{
	struct fs_file_t file;
	int rc;
	size_t file_size = 0;
	LOG_INF(&amp;quot;in fs_mgmt_write&amp;quot;);
	if (offset == 0) {
		rc = fs_mgmt_filelen(path, &amp;amp;file_size);
	}
	LOG_INF(&amp;quot;in fs_mgmt_write call fs_file_t_init&amp;quot;);
	fs_file_t_init(&amp;amp;file);
	LOG_INF(&amp;quot;in fs_mgmt_write call fs_open&amp;quot;);
	rc = fs_open(&amp;amp;file, path, FS_O_CREATE | FS_O_WRITE);
	if (rc != 0) {
		return MGMT_ERR_EUNKNOWN;
	}

	if (offset == 0 &amp;amp;&amp;amp; file_size &amp;gt; 0) {
		/* Offset is 0 and existing file exists with data, attempt to truncate the file
		 * size to 0
		 */
		rc = fs_truncate(&amp;amp;file, 0);

		if (rc == -ENOTSUP) {
			/* Truncation not supported by filesystem, therefore close file, delete
			 * it then re-open it
			 */
			fs_close(&amp;amp;file);

			rc = fs_unlink(path);
			if (rc &amp;lt; 0 &amp;amp;&amp;amp; rc != -ENOENT) {
				return rc;
			}
			LOG_INF(&amp;quot;in fs_mgmt_write second call fs_open&amp;quot;);
			rc = fs_open(&amp;amp;file, path, FS_O_CREATE | FS_O_WRITE);
		}

		if (rc &amp;lt; 0) {
			/* Failed to truncate file */
			return MGMT_ERR_EUNKNOWN;
		}
	} else if (offset &amp;gt; 0) {
		LOG_INF(&amp;quot;in fs_mgmt_write call fs_seek&amp;quot;);
		rc = fs_seek(&amp;amp;file, offset, FS_SEEK_SET);
		if (rc != 0) {
			goto done;
		}
	}
	LOG_INF(&amp;quot;in fs_mgmt_write call fs_write&amp;quot;);

	rc = fs_write(&amp;amp;file, data, len);
	if (rc &amp;lt; 0) {
		goto done;
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;* File operations */
int fs_open(struct fs_file_t *zfp, const char *file_name, fs_mode_t flags)
{
	struct fs_mount_t *mp;
	int rc = -EINVAL;

	if ((file_name == NULL) ||
			(strlen(file_name) &amp;lt;= 1) || (file_name[0] != &amp;#39;/&amp;#39;)) {
		LOG_ERR(&amp;quot;invalid file name!!&amp;quot;);
		return -EINVAL;
	}

	if (zfp-&amp;gt;mp != NULL) {
		return -EBUSY;
	}
	LOG_INF(&amp;quot;in fs_open call fs_get_mnt_point&amp;quot;);

	rc = fs_get_mnt_point(&amp;amp;mp, file_name, NULL);
	if (rc &amp;lt; 0) {
		LOG_ERR(&amp;quot;mount point not found!!&amp;quot;);
		return rc;
	}

	if (((mp-&amp;gt;flags &amp;amp; FS_MOUNT_FLAG_READ_ONLY) != 0) &amp;amp;&amp;amp;
	    (flags &amp;amp; FS_O_CREATE || flags &amp;amp; FS_O_WRITE)) {
		return -EROFS;
	}

	CHECKIF(mp-&amp;gt;fs-&amp;gt;open == NULL) {
		return -ENOTSUP;
	}
	LOG_INF(&amp;quot;in fs_open call mp-&amp;gt;fs-&amp;gt;open&amp;quot;);
	zfp-&amp;gt;mp = mp;
	rc = mp-&amp;gt;fs-&amp;gt;open(zfp, file_name, flags);
	if (rc &amp;lt; 0) {
		LOG_ERR(&amp;quot;file open error (%d)&amp;quot;, rc);
		zfp-&amp;gt;mp = NULL;
		return rc;
	}

	/* Copy flags to zfp for use with other fs_ API calls */
	zfp-&amp;gt;flags = flags;

	return rc;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/455369?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 15:20:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2e703f0-7527-41db-8c14-ecd8995e62a2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;br /&gt;I would suggest to continue on the ticket with AHaug.&amp;nbsp;&lt;br /&gt;As file system it&amp;#39;s normal that it has to do more reading than a simple one single read if you want to get the data out.&amp;nbsp;&lt;br /&gt;It&amp;#39;s because the system need to find where the file is located. Quite often that it need to read the whole&amp;nbsp;database&amp;#39;s records to find the file ID and then read it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/455360?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 14:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0751effb-699a-4667-b64d-67108fd72105</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&lt;/p&gt;
&lt;p&gt;though this thread is closed and i opened a new one, i think it is also related so this is the new thread&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/105501/using-smp-to-download-upload-files-from-fs-is-extremely-slow-in-compare-to-custom-service"&gt;using smp to download/upload files from fs is extremely slow in compare to custom service&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;there is something really strange in the way the lfs behaves with all the extra reads, every time a file is open and not just then.. hope you can take a look and explain why it behaves like it does and how can i fix it&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f64f.svg" title="Pray"&gt;&amp;#x1f64f;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/453711?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2023 12:35:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7716b067-890f-434d-adb8-f4bc8f210b7d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;br /&gt;I have little knowledge of littlefs but quite often a file system will not erase the area of flash when you delete a file or when you overwrite a file. Usually a file system will just invalid the file marking as it&amp;#39;s deleted and then write a new record and mark it as the new location for the file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This way the flash will be erased less often and the whole block/page only get erased when needed (garbage collection).&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Most likely the minimum size is 128:&amp;nbsp;&lt;a href="https://github.com/littlefs-project/littlefs/issues/264"&gt;https://github.com/littlefs-project/littlefs/issues/264&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/453619?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2023 07:14:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba4d60fc-582b-42c4-8f9f-06ceae0ade2e</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;hi Hung&amp;nbsp;&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/453550"]You would need to use file upload to overwrite the existing[/quote]
&lt;p&gt;ok, just to better understand, in file system, isn&amp;#39;t it deleting&amp;nbsp;an area in flash before writing on it ? is it happening under the hood ? and do i have some why to only delete a file using the mcumgr/SMP service API ?&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/105261/using-smp-service-with-file-system-lfs/453550"]3. I&amp;#39;m not so sure. You may need to do your own search. But as far as I know it should be the multiple of 64.&amp;nbsp;[/quote]
&lt;p&gt;i actually did not find so this is why i asked. what stands behind this question is to know how to better manage, divide or connect data to a file to be efficient, i would consider to have structs of data close to the size of a file frame in the lfs. for that i need to understand what is the minimal size block for a file&amp;nbsp;&lt;/p&gt;
&lt;p&gt;hope to read from you soon&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using SMP service with file system (lfs)</title><link>https://devzone.nordicsemi.com/thread/453550?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2023 15:07:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da667944-4940-4a4b-8c11-252da156e1f9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ziv,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1.There is no security feature implemented in SMP. You would&amp;nbsp; need to implement your own code on top of the SMP service for that. However as you already pointed out you can use general Bluetooth pairing to prevent unauthorized access. As long as you can perform the pairing in a secured way (level 3 or 4) the link is encrypted (AES 128) and the access is authorized.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. You would need to use file upload to overwrite the existing file.&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/smp_groups/smp_group_8.html#file-upload"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/smp_groups/smp_group_8.html#file-upload&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3. I&amp;#39;m not so sure. You may need to do your own search. But as far as I know it should be the multiple of 64.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>