<?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>Dynamically changing USB Descriptor on NCS?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85653/dynamically-changing-usb-descriptor-on-ncs</link><description>I would like to be able to use 3 different USB descriptors. 
 1. CDC ACM 
 2. Mass Storage 
 3. Composite device with CDC ACM and Mass Storage 
 These should be selectable within firmware based on what configuration is desired. 
 Is there a way to do</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Mar 2022 17:25:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85653/dynamically-changing-usb-descriptor-on-ncs" /><item><title>RE: Dynamically changing USB Descriptor on NCS?</title><link>https://devzone.nordicsemi.com/thread/357748?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 17:25:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb7a5b36-989e-4d31-a9ae-aaabaadaa15d</guid><dc:creator>dstarling</dc:creator><description>&lt;p&gt;Sorry about the last question, let me rephrase.&amp;nbsp; Is there any plan to implement a locking mechanism that would allow for simultaneous operation between the processor and the USB driver as mention?&amp;nbsp; I am assuming that is up to the user to implement, but thought&amp;nbsp;I would ask.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically changing USB Descriptor on NCS?</title><link>https://devzone.nordicsemi.com/thread/357597?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 10:08:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc0ac09d-79a3-4038-b151-b9b3e60a2d9c</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what they do for their MSD disabling, no. It is Segger firmware that we do not have access to, and it is running on the interface MCU which is not even an nRF device. AFAIK it is not Zephyr based either, so it&amp;#39;s a completely unrelated implementation from what we have in nRF Connect SDK.&lt;/p&gt;
&lt;p&gt;You would need some mechanism to ensure that two flash instances doesn&amp;#39;t try to modify the same file system at the same time, yes.&lt;/p&gt;
[quote user="dstarling"]Is there any expectation that the flash via FatFS should work with both devices connected at the same time?[/quote]
&lt;p&gt;I am afraid I am not quite able to parse your question. Which devices, what type of connection, and what flash operation working in what way? I am sorry for not being able to connect the dots.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically changing USB Descriptor on NCS?</title><link>https://devzone.nordicsemi.com/thread/357524?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 04:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7999aa0-3238-4cee-8818-4d132ef5a312</guid><dc:creator>dstarling</dc:creator><description>&lt;p&gt;Interesting, so do you know anything about how the MSDEnable/Disable works?&amp;nbsp; I guess I&amp;#39;ll go take a look at that functionality.&lt;/p&gt;
&lt;p&gt;The other issue seems to be corruption when accessing the device from both the firmware side and the PC side.&amp;nbsp; I guess I will need to disable the MSD function on the USB while the device is accessing the flash via FatFS and not write to it when the PC is accessing the device, correct?&lt;/p&gt;
&lt;p&gt;Is there any expectation that the flash via FatFS should work with both devices connected at the same time?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically changing USB Descriptor on NCS?</title><link>https://devzone.nordicsemi.com/thread/357440?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 14:18:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6325227f-90d1-4502-9050-4401ce75caba</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You cannot change the descriptor of a USB device, since per specification the descriptor of a USB device should be constant. This means from e.g. Windows you will always see the device as having MSD. This is also cached internally in the registers of Windows (and similarly for other OS) as it is an integral part of how USB works.&lt;/p&gt;
&lt;p&gt;However, there might be ways to disengage the drive exposed through the MSD, from the device side. From what I understand, the interface MCU from Segger, on our DKs, use a similar approach. There, you go in through J-Link Commander and issue the MSDDisable or the MSDEnable command. You could go for a similar approach for disabling/enabling access to your data, i.e. commands over the CDC ACM. If you are using a &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/file_system/index.html"&gt;Zephyr File System&lt;/a&gt; underneath, then you might for instance have a look at &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/file_system/index.html#c.fs_unmount"&gt;fs_unmount()&lt;/a&gt; for disengaging the underlying data storage.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>