i have done all the procedure in lpc55S16 JBD100 with the help MCUXpresso IDE.
example code generated MCUXpresso IDE. read and write function is not created, kindly help me the steps to read and write in pendriver through USB communication in lpc55S16 JBD100 iam using USB1 HOST.
Hello @Arularasan
There is USB HOST demo under SDK, you can refer to, download from:
https://mcuxpresso.nxp.com/en/select
BR
Alice
@Alice_Yang thanks for your reply.
USB HOST demo under SDK example code ("host_msd_fatfs_bm") I have download but its not working !
I want to read and write in pen drive through usb communication iam using USB1.
kindly help me @Alice_Yang
Hello @Arularasan
"but its not working"
->> Please tell me the details of the "not working" and how do you run it. My colleague have tested this demo, it can work well.
BR
Alice
thanks for your reply @Alice_Yang
in debug mode
it prints only " host init done "
when I plug in u disk in USB1 nothing is printed in terminal.
please reply @Alice_Yang
Hello @Arularasan
The default USB of this demo is USB0, if you want to use USB1, you need change some code, and jumper on board.
Change code as below:
.2 Update USB host demo: USB0->USB1
Taking usb_host_hid_mouse demo code as an example, to switch to USB1, modify the macro definition in usb_host_config.h as follows:
#defineUSB_HOST_CONFIG_KHCI (0U)
#defineUSB_HOST_CONFIG_EHCI (0U)
#define USB_HOST_CONFIG_OHCI (0U)
#define USB_HOST_CONFIG_IP3516HS (1U)
Jumpers refer to readme.txt, I also tested on my side, works well, jumpers as below:
BR
Alice
@Alice_Yang thanks for your support
After modify demo code lpcxpresso55s16_host_msd_fatfs_bm macro definition in usb_host_config.h and jumpers to USB1 It detects the mass storage device
kindly help me to write and read in mass storage device(PEN DRIVE)
in debug session
(
host init done
mass storage device attached:pid=0x558avid=0x781 address=1
............................fatfs test.....................
fatfs mount as logiacal driver 1......success
test f_mkfs......success
test f_getfree:
FAT type = FAT32
bytes per cluster = 32768; number of clusters=938764
The free size: 30040416KB, the total size:30040448KB
directory operation:
list root directory:
create directory "dir_1"......success
create directory "dir_2"......success
create sub directory "dir_2/sub_1"......success
list root directory:
dir - ___ - DIR_1 - 0Bytes - 2018-1-1 0:0:0
dir - ___ - DIR_2 - 0Bytes - 2018-1-1 0:0:0
list directory "dir_1":
dir - ___ - SUB_1 - 0Bytes - 2018-1-1 0:0:0
rename directory "dir_1/sub_1" to "dir_1/sub_2"......success
delete directory "dir_1/sub_2"......success
get directory "dir_1" information:
dir - ___ - DIR_1 - 0Bytes - 2018-1-1 0:0:0
change "dir_1" timestamp to 2015.10.1, 12:30:0......success
get directory "dir_1" information:
dir - ___ - DIR_1 - 0Bytes - 2015-10-1 12:30:0
file operation:
create file "f_1.dat"......success
test f_write......success
test f_printf......success
test f_puts......success
test f_putc......success
test f_seek......success
test f_gets......ABCDEFGHI
test f_read......JKLMNOPQRS
test f_truncate......success
test f_close......success
get file "f_1.dat" information:
fil - ___ - F_1.DAT - 19Bytes - 2018-1-1 0:0:0
change "f_1.dat" timestamp to 2015.10.1, 12:30:0......success
change "f_1.dat" to readonly......success
get file "f_1.dat" information:
fil - R__ - F_1.DAT - 19Bytes - 2015-10-1 12:30:0
remove "f_1.dat" readonly attribute......success
get file "f_1.dat" information:
fil - ___ - F_1.DAT - 19Bytes - 2015-10-1 12:30:0
rename "f_1.dat" to "f_2.dat"......success
delete "f_2.dat"......success
............................test done......................
)
Hello @Arularasan
You can refer to readme.pdf, config "throughput test", there is write and read function code.
BR
Alice