I want to be able to use the full capacity of my SD card by reading/writing data directly from/to it, not like in any file. It doesn't matter the filesystem will be erased, I could just open the card in a hex editor. So far I've looked at the RawWrite sketch part of SdFat but it's too complex. There have been other questions concerning this on the forum but they don't have good answers.
I'm not an expert Arduino programmer and I don't know how you would do this. That's what the library is for. As I had said the SdFat can do raw writes just fine.
Don't assume I'm an expert lol
I know that library is meant for SPI flash chips and not really SD cards. How would that work?
It's not in the tradition of the forum - to respond with ready-made code. We can suggest how to write it or what to read. But you write the code yourself.
Looks like you need to create an instance of a "DedicatedSpiCard" and then call the readSectors() and writeSectors() functions. Maybe a search for "DedictedSpiCard" will show an example.
The code is very short and straightforward. Create a large file named RawWrite.txt of so many contiguous blocks, write the blocks out one by one, then close it.
This operates within the framework of the SDFat file system, so it does not use "the full capacity of my SD card", which for some unspecified reason is required by the OP.
This thread had me wondering! The SD card has a controller that does page wear-leveling and presents us with a simulation of a file. Even if I could, why would I reach in and screw with that?
With magnetic disks we might arrange to sort and rewrite a file but with limited writes and large space we write a sorted file or much better is to write a smaller file of sorted offsets into the original data, it works so well that it's faster and smaller on magnetic drives too. You should never have to overwrite SD, that's get a bigger card time.