Hi
I take a look on the example provided with MQX who demonstrate how to use the board as a USB masse storage device, this example allow to read and write to a part of the ram from the computer like any other thumb drive.
My goal is to do the same thing but no from flash but from a sd card.
When i look on how the example work it look simple, the computer directly ask to the board to read a zone of memory by furnishing an offset to the start from the start of the memory.
The probleme is that MQX by default only provide Hight level function who only allow to acces to the file level of the SD card.
So i would like to know if low level function are available an how to use it, when i look into the MQX code i saw some sectore_read function but i can't make it work.
Thank's
Best regard
Solved! Go to Solution.
Check mfs sdcard example.
You need to install sdcard driver, open the driver, so the sdcard gets initialized and then you can use functions like fseek, fread, fwrite that are 512B sector based - fread (buffer, 1, 1, sdcard_fd) reads 1 sector = 512B.
Regards,
PetrM
Check mfs sdcard example.
You need to install sdcard driver, open the driver, so the sdcard gets initialized and then you can use functions like fseek, fread, fwrite that are 512B sector based - fread (buffer, 1, 1, sdcard_fd) reads 1 sector = 512B.
Regards,
PetrM
Hi PetrM
Thank's for you're help, I used it on a mcd52259 and taht work fine i was able to used the usb msd with the SD card.
I tried to used the same code with a K60 and MQX 3.7 EAR V2 and that don't work , the fread function do not return data, did they have a special way to implement it on kinetis ?
Thank's
Best regard
Hi,
When you did MSD on SD card, how did you solve the problem that read from SD card is 512 bytes and read from USB is 64 bytes?
Thank you.
-Daniel
Hi,
I have the code for USB SD card - MSD and it is working. My problem is data transfer speed over usb is very slow.How i can improve this?
Thanks,
Pramod.
The usage should be the same on all platforms, so it's more likely a bug in pre-release code.
Does the original sd card example work for you on K60?
BTW: It should use ESDHC low level communication and onboard sd slot by default...
PetrM
Thank's for you're answer
it was a mistake from my side (run a empty program on the mcf51 embedded on the lcd board solve the problem)
I do some test and i got a very low bandwitch (about 400 Ko/s) from SD to USB
Actually I have the ESDHC port runing a full speed (25Mhz) but i can't set the usb to Hight speed mode on K60, I had some compilation issue apparently the K60 HS is no supported on MQX 3.7 they have a solution to have USB hight speed on MQX with K60 ?
Best regard
Hi,
current K60 processor supports only USB full speed.
PetrL