<?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>Transfer data (in file) between PC and nrf52840-mdk-usb-dongle over USB CDC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59996/transfer-data-in-file-between-pc-and-nrf52840-mdk-usb-dongle-over-usb-cdc</link><description>Hi, 
 I am working on an USB CDC program with nrf52840-mdk-usb-dongle. The PC needs to use a terminal emulator like putty to connect to the dongle. Now I send and recieve data through the putty terminal. 
 I want to send and recieve data through files</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Apr 2020 05:50:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59996/transfer-data-in-file-between-pc-and-nrf52840-mdk-usb-dongle-over-usb-cdc" /><item><title>RE: Transfer data (in file) between PC and nrf52840-mdk-usb-dongle over USB CDC</title><link>https://devzone.nordicsemi.com/thread/245417?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 05:50:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d457e0c2-e0db-49a3-af7b-b7c0cbb22fd4</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Thank you for sharing your solution with the community!&lt;/p&gt;
&lt;p&gt;Have a good one!&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer data (in file) between PC and nrf52840-mdk-usb-dongle over USB CDC</title><link>https://devzone.nordicsemi.com/thread/245331?ContentTypeID=1</link><pubDate>Sat, 18 Apr 2020 03:12:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd424b20-ffcc-4a2f-bb1e-225323bac016</guid><dc:creator>Tashkent</dc:creator><description>&lt;p&gt;Hi Simonr,&lt;/p&gt;
&lt;p&gt;Thanks for your help! I have solved this problem in another way. I replace the putty with&amp;nbsp;&lt;a href="https://pypi.org/project/pyserial/"&gt;pyserial&lt;/a&gt;, a python serial port library.&lt;/p&gt;
&lt;p&gt;Here are the steps:&lt;/p&gt;
&lt;p&gt;1. Load an USB CDC program to the dongle, e.g., &amp;lt;SDK&amp;gt;/&lt;span style="background-color:#ffffff;"&gt;examples/peripheral/cli. The program can be adapted to dongle by following &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;this&lt;/a&gt; excellent tutorial.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;"&gt;2. Install pyserial on PC.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;3&lt;span style="background-color:#ffffff;"&gt;. Create a file named INPUT on PC, and write some words to the file.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;4&lt;span style="background-color:#ffffff;"&gt;. Run the following python program:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;pre class="ui-code" data-mode="python"&gt;import serial

ser=serial.Serial(&amp;quot;/dev/ttyS8&amp;quot;,115200,timeout=0.1)  # Open the port

fin = open(&amp;quot;./INPUT&amp;quot;, &amp;quot;r&amp;quot;)
fout = open(&amp;quot;./OUTPUT&amp;quot;, &amp;quot;w&amp;quot;)

s = fin.read()										# Read data from INPUT

ser.write(&amp;quot;print all &amp;quot;+&amp;quot;\&amp;#39;&amp;quot;+s+&amp;quot;\&amp;#39;&amp;quot;+&amp;quot;\r\n&amp;quot;)			# Send data to the port
s = ser.readlines()									# Receive data from the port

fout.write(str(s))									# Write the received data to OUTPUT

fin.close()
fout.close()

ser.close()											# Close the port&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer data (in file) between PC and nrf52840-mdk-usb-dongle over USB CDC</title><link>https://devzone.nordicsemi.com/thread/244073?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2020 11:59:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:682a0177-4420-40d5-816e-73d131de0865</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes, I think this should be possible. You can check out the &lt;a href="https://github.com/NordicPlayground/nrf52-ble-image-transfer-demo"&gt;nRF52 BLE image transfer demo&lt;/a&gt; to see&amp;nbsp;an example where the nRF52 handles and transfers files. You should be able to modify this to handle your desired file type and to transfer over USB instead of BLE. I am not sure what type of files you have in mind though, and this has not been tested as far as I know, so I can&amp;#39;t guarantee that it will work.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>