Search results

  1. B

    SD Card Write Speed Patterns

    That's easy enough, thanks for the info.
  2. B

    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 character to initialize file"); while...
  3. B

    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 LOG_FILENAME "SdioLogger23.csv" SdFs sd; FsFile...
  4. B

    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?
  5. B

    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 in buffer" : I removed all instances of...
  6. B

    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
  7. B

    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 every loop-rather do it every couple of seconds for my...
  8. B

    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/
  9. B

    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 the block erasure could conceivably account for the...
  10. B

    SD Card Write Speed Patterns

    Maybe a different SD card would have different housekeeping operations? I'll try and hunt another SD card down
  11. B

    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?
  12. B

    SD Card Write Speed Patterns

    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 the in-built SD card with a 32GB...
  13. B

    Teensyduino File System Integration, including MTP and MSC

    Hi all, I have a small problem with MTP and hoping for some guidance... I'm using a Teensy 4.1 as a data-logger using the in-built SD card. After the datalogging has concluded, I would like the the SD card to appear in Windows Explorer. The Teensy is always connected to the PC via USB. I do...
  14. B

    Display SD card as mass storage: Teensy 4.1

    I fixed my issue. Problem was that sdx[ii].totalSize() and sdx[ii].usedSize() were returning 0. In SD.h (teensyduino library) there is: uint64_t usedSize() { if (!cardPreviouslyPresent) return (uint64_t)0; return (uint64_t)(sdfs.clusterCount() - sdfs.freeClusterCount()) *...
  15. B

    Display SD card as mass storage: Teensy 4.1

    Thanks MichaelMeissner. I copied and pasted your code and it worked straight away! One small thing - in Windows Explorer, the BUILTIN-SD capacity bar appears full red for me, despite the SD card being empty. I'm running a Teensy 4.1. Does this happen for you as well? Not a big deal honestly...
  16. B

    Beware! T4x RTC power consumption

    New Zealand, wrong side of all oceans :p Digikey usually gets here within a week though so can't complain
  17. B

    Beware! T4x RTC power consumption

    Thanks Bricomp, sounds ideal. Trust the Swiss to make a good watch.
  18. B

    Beware! T4x RTC power consumption

    Hi Davidelvig, I am in a similar boat, moving designs from Teensy 3.5 to Teensy 4.1. I've tested 3 x Teensy 4.1 boards (1 abused and 2 fresh out the packet), and 2 x Teensy 3.5 (1 abused and 1 fresh out the packet). I measured the current consumption from a CR2032 battery connected to VBAT...
Back
Top