USB HOST (PEN DRIVE)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB HOST (PEN DRIVE)

Jump to solution
2,196 Views
eliezer_fortron
Contributor I

Hello, I have an IMXRT1050-EVKB kit.
I'm trying to create .txt file and write to a thumb drive, but all examples of the SDK teach only to communicate with terminal (Tera Term).
Has anyone ever written a txt file on the thumb drive? Can you help me?

0 Kudos
1 Solution
1,985 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Eliezer,

Please ensure that you are connecting the USB stick on micro USB connector U9, using a proper micro USB - USB Host adapter (that ties to GND the ID pin).


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
5 Replies
1,985 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Eliezer,

You could take as reference/base the “host_msd_fatfs_bm” SDK example (from SDK v2.4.2 for IMXRT1050-EVKB board), that access to USB stick folders/files:

usb_examples->host_msd_fatfs_bm

Attached you can find the readme PDF file of such example.

 

CAUTION: This example erases all the content of the connected USB stick (performs a format).


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,985 Views
eliezer_fortron
Contributor I

Hello Carlos,
I imported the SDK sample and followed step by step into PDF but it did not work.
Is something missing to be done?

0 Kudos
1,986 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Eliezer,

Please ensure that you are connecting the USB stick on micro USB connector U9, using a proper micro USB - USB Host adapter (that ties to GND the ID pin).


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,985 Views
eliezer_fortron
Contributor I

Hi Carlos, I've been able to find what I need.
Thanks for listening.

0 Kudos
1,985 Views
eliezer_fortron
Contributor I

Ola Carlos, set the example right.
I am trying to create a .txt file to save in PEN DRIVE but there is a lot of stuff in that code, I'm pretty confused, I'm new to NPX.
I am using as base the FatFs - Generic FAT Filesystem Module.
I am not able to find the functions that tests if the pen drive is connected in order to generate my .txt file and when it is disconnected.

0 Kudos