I'm implementing FAT16 on SD card with Atmega328.
I often need to change just one or two bytes in the sector (512B region).
I know how Flash works and that it needs to overwrite entire sector at once, but I was wondering if there maybe was some special command that would make the card itself handle it?
The point is, the atmega has only 2k RAM, and allocating 512 just for a read-modify-write SD card buffer is very unfavorable. Is there no other way?
(PS. AFAIK the atmega can't natively have external ram)
YOu cannot changge just few bytes in a sector without reading/writing the the whole 512 bytes. So you actually do need the RAM for buffer.
However, there are ways to pre-alloc the filespace or update the FAT every some writes only. That will even conserve write cycles, but might result in data loss if power down before the FAT has been updated (however, it might not corrupt the filesystem if implemented properly).
As you state that these are cheap ArduinoNano (clones - supposedly), you could just use two of them interconnected with UART/SPI/i2C - whatever is available, even 8 bit bit-bang would work.
One does whateveryouwanttodo and the other is just for SD-card/FAT processing.
Reminds me of the Comodore 64 and its floppy-disc drive 1541 which also included a small CPU (well "MCU", but not single chip).