Arduino as mass storage device?

Use the link, there might be something useful in there.

Thank you.

Joseph

The SD card already uses DOS FAT and the SD library works like DOS folders and files access with 8.3 filenames and FILE blocks.

It can use a Sandisk format, that's all I know.

The card has an MCU and does it's own wear-leveling.

It is Very Important to know that SD/flash has to write 128 byte page if just 1 changes.
These can't be treated like hard drives as far as hopping through data say sorting on the card.

What you do instead is to get your raw data to one file as it arrives and write an index file with the start byte # of each data record concurrently. Instead of sorting the data file, write a sorted index file and use that to write a sorted data file if needed. Indexed file access is a very powerful tool.

hello again i don't have room to put a sd card in there or i would.

My problem is I'm limited on space.

Joseph

Do you have room in your Arduino chip's flash? The newer bootloaders allow writing to flash in runtime.

If i did i have to bodge it a little and run some magic wire on the pins. I might be able to do it.

Joseph

You don't know this Arduino capability then. It is built-in.

You know that your sketch gets turned into machine code loaded into internal flash on the Arduino MCU by the IDE?

You know about using PROGMEM to store constant data in unfilled parts of the same flash? Arduino Uno has 32K flash, a big sketch might fill 8K if it's not waste-y.

The newer Arduino bootloaders allow writing to flash by a running sketch. It lets you save data not previously known as constant in flash, and read it often after.

You have mentioned that a few times. So the question is what will fit? If an Uno or Zero fit, you can use e.g. a Nano or proMini or ProMicro and have space for a SD card (I guess).

Questions:

  1. What is the use of sending stuff to the serial monitor? What are you trying to build?
  2. If you can provide some detail of what would be in that text file, we might be able to help with code for an alternative to the mass storage device.