B
Reaction score
0

Latest activity Postings About

    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      That's easy enough, thanks for the info.
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      I modified initSDCard() so that it writes all zeros to the sectors to be written, so that in the event of a power outage it is obvious where the data stops: char zeros1[4096]; int filePosition; void initSDCard(){ Serial.println("Type any...
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      Bastardized from the teensysdiologger example: #include "SD.h" #include "RingBuf.h" // Use Teensy SDIO #define SD_CONFIG SdioConfig(FIFO_SDIO) #define LOG_FILE_SIZE 10 * 25000 * 600 * 4 #define RING_BUF_CAPACITY 300000 #define...
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      Here is the bytes in buffer for a brand new SD card. Same 4MB and 32 MB spikes. I wonder if you have a recommendation for how to fully erase the preallocated file beforehand?
      • 1718662649531.png
    • B
      Datalogging is a problem I've been trying to brute-force for half a year now. My solution (that I hope to release in a couple more months of testing) runs on top of the SdFs library for the purpose of low-latency high-frequency binary logging...
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      That worked like a charm, thank you! Removed the sync and replaced with: if ((n > 512) && !file.isBusy()) { rb.writeOut(512); } No blocking now: Just for interest, the 4MB and 32 MB spikes are still evident in the "bytes...
      • 1718658419721.png
      • 1718658973504.png
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      Ah I should say I've been using rb.sync within an if statement checking sd.busy, so I don't think the periodic blocking is related to SD busyness. The rb.sync must also be performing a flush somewhere, I guess within writeOut
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      I'll have a look at only printing 512 B from the ring buffer to the file. From a bit of playing around rb.sync seemed to me like it was performing a file.write followed by a file.flush? Agree it's a bit excessive doing a flush type operation...
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      Think the 4 MB and 32 MB spikes might be something to do with the AU blocks and the UHS AU block size discussed in the physical layer specification here: https://www.sdcard.org/downloads/pls/
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      Thanks jmarsh. I did some googling based on that and found this reddit post: Minimizing microSD block rewrites and erasures when datalogging They talk about erase blocks being 4 MB for a couple of SD cards, and 512-byte or 4 k write blocks. So...
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      Maybe a different SD card would have different housekeeping operations? I'll try and hunt another SD card down
    • B
      Berollos replied to the thread SD Card Write Speed Patterns.
      Yes, the file space is pre-allocated. The file is left open for the duration, then truncated and closed at the end of logging. Interesting about the housekeeping. Any clues where those kind of functions might be defined?
    • B
      I've been experimenting with the TeensySdioLogger example in the SdFat library on the suggestion of joepasquariello in a couple of threads e.g. Best Teensy for a datalogger, Fastest Way to Log to SD Card. Here are some details: Teensy 4.1 using...
      • 1718599564936.png
      • 1718599654087.png
  • Loading…
  • Loading…
Back
Top