Go Down

Topic: An example of Arduino Due as an USB host mass storage (Read 38274 times) previous topic - next topic


Hola Palliser, gracias for the answer

But that's the problem, I must make a school project with it, and I don't have enough time to expect the summer. I want only to ask you if there's an alternative to create the "library code" for rd/rw usb pen drive. For example, can the USB Host Library 2.0 be used for this on Arduino Due without buy an USB Host Shield? I think not but I can myself wrong...


Juan: I've tried USB Host Library 2.0 and it most definitely can not be used with the Due. Everything is written for the MAXIM usb host chip. So all the MAXIM code needs to be replaced with SAM3 uhc code.


On a more positive note! This ASF example is great news for me! I want to have keyboard + usb stick connected to the Due at the same time and it looks like Palliser's example can do just this?

Is there any easy way to convert this to the Arduino IDE?


well, i'm already trying to hack and get this working on plain old arm-gcc..


afaik, Atmel/Arduino are working on a new USB host stack for both Due and Zero. It will have the support of Mass Storage. No milestone announced yet. Regards,



Holy shit, that would be amazing!! Thanks for that news!! 

I've even gone so far as to turn the entire USBHost system into statemachines. Costing me a whole week of development alone. It works, but mass storage had to be backported from USBHost 2.0/3.0 and that's no walk in the park.

Palliser: Is there any way I could come into contact with Atmel or Arduino about this new development. If possible, I would like to help!



hi all

I have a small doubt, at time of programming using bossac.exe file my USB cable connected to Programming port or Native USB port


hi all

I have a small doubt, at time of programming using bossac.exe file my USB cable connected to Programming port or Native USB port
Hello vinod_chinthoti,
You can use any of the Arduino Due USB ports (Programming or Native) but make sure you use:

'false' with USB Programming port

'true' with USB Native port


Let's say...

...your directory_path_to_bossac' is: C:\Users\YourName\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino
...your 'directory_path_to_program' is: C:\Users\YourName\AppData\Local\Temp\arduino_build_805975
...your program is: program.ino.bin
...you USB Programming port is: COM2
...you USB Native port is: COM3


When connected to USB Programming port (COM2):

directory_path_to_bossac\bossac.exe --port=COM2 -U false -e -w -v -b \directory_path_to_program\program.ino.bin -R

Example  when connected to USB Native port (COM3):

directory_path_to_bossac\bossac.exe --port=COM3 -U true -e -w -v -b \directory_path_to_program\program.ino.bin -R



Hola Juan,

I must say I am half way to finish my porting of the Atmel ASF example for Due. I just need time to finish it (nowadays I am busy at my work). I hope to have the library and raw example (write/read USB memory stick) ready by the end of this Summer, thus, it is about to wait. Regards,

Добрый день Palliser.
 Вы завершили проект?


Hello guys, I need your help... please.
   I followed all the recommendations of Travis .... Termit 3.4 shows me -
 USB HOST HID / MSC Example -
- Arduino Due / X -
- Compiled: Feb 3 2019 03:48:48 -

[main] MAX_DRIVE = 8: [main] Device Attached!
  Vid = 0x1307
  PID = 0x0165
[main] Sof Detected!
[main] create file

where "create file"  its my debug string from function

res = f_open (& file_object,
(char const *) test_file_name,
if (res == FR_OK)
{DbgPrint ("create file"); }

everything seems to be ok, but when  connect  my USB stick(fat32) to the PC,  I don't find  file (uhi_msc_test.txt) . I'm trying to figure it out the third day .. Please help me.

if i call :

res= f_mkdir ((char const *)test_file_name);

I get :

[main]  f_mkdir=8  // FR_EXIST /* (8) Acces denied due to prohibited access */
thank you for your help


Hi guys! Is there any news on code migration to ARDUINO IDE?
I tried to create a reading based on the USB HOST library but it was without result, it only works with the mouse and keyboard.
Whether prompt there is a decision to use USB storage with Native Usb from Arduino Due?


For those who don't want to wait for an hypothetical Arduino release of a USB Host Mass Storage library for the DUE, and if you have some spare time (~ 6 months) :) , read chapter 17 of Benjamin David LUNT book: "USB : The Universal Serial Bus". There is everything you need for a USB Mass Storage driver implementation to handle your favorite thumb drive.

Although it's for video streaming only, I warmly recommend the preliminary reading of the following tutorial:


The DUE embeds a USB 2.0 compliant High Speed capable peripheral usable either as a Host or a Device.

Go Up