This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB MSC write on SDCard fail (while read works)

Hello together,

i am using the RL_ARM Library (newest version) for USB MSC Device and MCI (SD Card).

In Windows the SD-Card is correctly shown and i am able to transfer files from SD-Card to PC. But, as soon as i try to write any Data (copy files) to SD-Card, the transfer rate is VERY SLOW (even with max of 32KB Drive Cache Size in FS_Config)and what is more, the files are mostly corrupted. Sometimes the whole FAT Filesystem is no more readable after trying to transfer one file.

My code for testing is based on the USB Mass Storage Example for MCB1700 (without unnecessary LCD code). Both (USB + FlashFS) seems well configured.

If i uncomment the write-call for FlashFS, the transfer rate is quite okay, so the USB transfer rate seems not to be the problem.

Stack (0x0400 Byte), Heap (0x0800 Byte) and RTX Thread stack size (1024 Byte) should be large enough. User Timers (as requested by documentation) are enabled.
MCI-Mode is set to "Native", Filename Cache and FAT Journal are disabled. Enabling the Journal does not prevent the write problems shown above.

The PCB is similar to OM13020 DEV-board (LPC1778).

Does anyone have an idea why my write attempts fail?

Best regards,
Sascha

  • Hello,

    if not already done: check the power supply of the sd-card with a scope close to the supply-pin of the sd-card.
    In read-mode the card needs less power than in write-mode.
    Some SD-cards mitght even work in read-mode without connection of power-supply - they draw the power from the connected cmd/datalines.