Search results

  1. B

    Can arrays in DMAMEM be initialized?

    I have a SdFat user posting an SdFat issue. He wrote an initialized array to an SD and said the content was not correct. I looked at his example and it appears a DMAMEM array like the example below is not initialized. It appears to have random content. DMAMEM uint8_t test[] =...
  2. B

    I need help with an SdFat ADC DMA ISR example

    I am working on an improved RingBuf ISR example for SdFat. I want to handle the cache for DMAMEM correctly and achieve the maximum ADC rate. This is an example to test at maximum speed so I am not concerned with accuracy. It appears that arm_dcache_delete() is only required on Teensy 4.x and...
  3. B

    exFAT SD card append-write fails after 256 kb when writing to 2 files

    I posted a reply on github. I tested with SdFat 2.1.2 and 2.1.4-beta.3 I uses 32GB FAT, 64GB exFAT, 512GB exFAT on a Teensy 4.1 I used Teensyduino 1.56 with Arduino 1.8.19 Seems to work on all. I used Samsung SD cards. With 32GB FAT test exFAT logger 2.1.4-beta.3 sd.begin() done file...
  4. B

    Which SD is Best for Audio Projects?

    New SdFat-beta I posted a new version of SdFat here as 2.1.4-beta.3. It allows more old cards to be used with SDIO. More cards work on Teensy 3.x than Teensy 4.1. Often a card that fails with FIFO_SDIO will work with DMA_SDIO. FIFO_SDIO depends on a card being able to pause read at sector...
  5. B

    Which SD is Best for Audio Projects?

    I have been testing mods for old small V1.XX cards. I can get almost all to init with sd.begin(). Several require a power cycle before a second call to sd.begin(). Several cards will fail with FIFO_SDIO but will work with DMA_SDIO. The problem seems to be no support for read wait in SDIO...
  6. B

    Which SD is Best for Audio Projects?

    Here are key milestone SD specs that apply to Teensy. The uSDHC controller only supports features up to the V3.01 May 18, 2010 Spec. The current spec is V8.0 September 2020. Version 1.01 Card Requirements (SD_SPEC is set to 0) (1) The card does not support CMD6 (2) The card does not support...
  7. B

    Which SD is Best for Audio Projects?

    I have lots of small cards like that. They are SD2 cards and work fine. The problem involves SD1 cards produced with the April 15, 2001 V1.01 or October 15, 2004 V1.10 command structure. I have the V1.10 cards working and understand the V1.01 problem. V1.01 cards only support 25 MHz SDIO...
  8. B

    Which SD is Best for Audio Projects?

    I have made progress on SD1 cards on Teensy 4.1. The problem is not ACMD41. It is CMD8 which is the way you detect a SD1 card. There is no response to CMD8 from SD1 cards. On Teensy 4.1 a controller reset seems to be required before the ACMD41 loop. Here is the init flow chart with SD1 on...
  9. B

    Which SD is Best for Audio Projects?

    I have six cards in three sizes that fail with Teensy 4.1 but work with Teensy 3.6. My worry now is that ACMD41 is so simple and well documented that finding the problem is a real puzzle. The init for SD1 is send CMD0, which does not send a response then loop using ACMD41 to wait for the SD...
  10. B

    Which SD is Best for Audio Projects?

    I found the SD-> microSD adapter and my SD1 cards work on Teensy 3.6. Here is a really old, 16MB card: init time: 39 ms Card type: SD1 Manufacturer ID: 0X3 OEM ID: SD Product: SD016 Revision: 3.1 Serial number: 0XA30FA0 Manufacturing date: 8/2003 cardSize: 14.75 MB (MB = 1,000,000 bytes)...
  11. B

    Which SD is Best for Audio Projects?

    Looks like none of my microSD cards are V1.xx. I have lots of full size V1.xx cards and a SD to microSD adapter somewhere. I will find it or make one with a microSD sniffer. It can be crude since SD init takes place at 400 kHz. I suspect I see the problem with V1.xx cards but will test it...
  12. B

    Which SD is Best for Audio Projects?

    The break in support is not at 2GB, it's at the May 9, 2006 V2.00 SD standard. At this point A major change in the command structure and register structure was introduced to allow expansion to greater than 2GB. To support backward comparability the standard relied the failure of the new CMD8...
  13. B

    Which SD is Best for Audio Projects?

    Run the SdInfo example and post the error Info. It should be something like this: SD errorCode: SD_CARD_ERROR_ACMD41 = 0X17 SD errorData = 0X0 Try editing SdFat/src/SdCard/SdioTeensy.cpp at line 36 and increase this timeout. It was as high as 5000000 at one time. This is mainly for the...
  14. B

    Which SD is Best for Audio Projects?

    Have you tried any non-SDHC (2GB or smaller) cards on SDIO? No consumer cards "Standard SD" cards are being manufactured currently. I only have two microSD cards. I developed with full size cards. These are are not SLC cards. Here is the problem with consumer cards after about 2008 they were...
  15. B

    Which SD is Best for Audio Projects?

    Looks like the Samsung Evo Select is the same as the Samsung Evo Plus, just branding, Amazon had exclusive rights to the Select brands of Samsung cards. Here are images of the "New Generation" cards. They appear to have very large "Record Units" so are optimized for recording a single stream...
  16. B

    Which SD is Best for Audio Projects?

    New generation Samsung vs Kingston Canvas Go! Plus I bought cards to test the "new generation" of Samsung microSD cards. I compare these with the Kingston Canvas Go! Plus. Shared SPI write is really poor for the new Samsung cards. They are clearly designed for phones with a huge file cache...
  17. B

    Which SD is Best for Audio Projects?

    Watch Out for Old Cards on the Internet Try to get cards with the highest Application Level, A2 or A1. Video level V30 if possible and U3 if possible and at least U1. The Extreme below has about the best you will find for a UHS-I card. The Ultra below is Good but watch for older Ultra cards...
  18. B

    Which SD is Best for Audio Projects?

    Old vs New models and UHS-I vs UHS-II I have been doing benchmarks to select a set of SD cards for development tests. Here are some interesting results for shared SPI performance. Many newer version of a card have quite different write performance. New SanDisk Ultra 32GB cards are much...
  19. B

    Which SD is Best for Audio Projects?

    Three Great MicroSD cards. Here are Tests for three more cards. The PNY Elite-X is as good as the Canvas GO! Plus. The PNY and Lexar beat the Canvas GO! Plus for shared SPI write performance. I bought the PNY for $11.99. https://www.amazon.com/gp/product/B07WW1H346/ PNY Elite-X 64GB Begin...
  20. B

    Which SD is Best for Audio Projects?

    I used 30 to space files by 1GB. I named files so A.bin is 8 GB from B.bin and so forth. I suspect using 0.5 GB files won't make much difference. Notice I added more cards above. I wish manufactures would reveal their buffer algorithms. There are some strange patterns.
  21. B

    Which SD is Best for Audio Projects?

    The CANVAS Go! Plus 256GB vs 512GB Sandisk Extreme is interesting. In the range I expect to be important the CANVAS Go! seems to have a bit more read performance. The Lexar 128GB is appealing for maxLat but speed is not best. Often max latency is the winner for time critical apps. CANVAS Go...
  22. B

    Which SD is Best for Audio Projects?

    I agree. After some thought, I think FreeRTOS would be a good kernel to transition to a RTOS, provided Amazon supports the simple kernel. I have used a RTOS in every serious project since RSX-11/M in the mid 1970s. I tried to be an evangelist for an Arduino RTOS over eight years ago. I...
  23. B

    Which SD is Best for Audio Projects?

    I tried a 16GB card and it worked with 1.55. It was really slow with FAT32 to create files. Write latency was huge. It took forever to finish. Try formatting with the SdFormater example or the SD Association formatter Edit: this is how it ended:
  24. B

    Which SD is Best for Audio Projects?

    There is some hope for an async API with DMA but it is not worth doing. Solving this type problem with an RTOS is better since it is a general solution and modern tick-less RTOSs have little extra overhead. Even a better solution for multi-processors.
  25. B

    Which SD is Best for Audio Projects?

    I preAllocate 16GB for files. change this to use 29 instead of 30: const uint32_t FILE_ALLOC = 1UL << 30; I wanted the files spread over the SD.
  26. B

    Which SD is Best for Audio Projects?

    I just downloaded the 202107.00 version of FreeRTOS. Wow! It's 455MB. The entire source for my port six years ago was 753 KB. Be warned by comments like this:
  27. B

    Which SD is Best for Audio Projects?

    I ported FreeRTOS to Teensy 3.x six years ago. I would be cautious about FreeRTOS now that Amazon bought it for their IoT mission. https://www.freertos.org/FAQ_Amazon.html FreeRTOS is/was a simple kernel with no real framework for HAL. It is easy to port so almost all chip companies choose...
  28. B

    Which SD is Best for Audio Projects?

    The problem is that DMA does not work well with the NXP controller so everything is polled. Here is the core for reading a sector: if (waitTimeout(isBusyFifoRead)) { // <<--- this is polled return sdError(SD_CARD_ERROR_READ_FIFO); } for (uint32_t iw = 0 ; iw < 512/(4*FIFO_WML)...
  29. B

    Which SD is Best for Audio Projects?

    I have edited the original post to add a latency test. The CANVAS Go! Plus may appear to have long write latency but other cards I tested have ten times greater when pushed. At least you can schedule around write latency to some extent by checking for SD busy and using several single sector...
  30. B

    Which SD is Best for Audio Projects?

    Warning: I have edited this post to add a latency measurement. Paul is looking for better SD performance for multi-file audio projects. I wrote a quick random I/O test for evaluating SD cards on Teensy 4.1. I posted results for a CANVAS Go! Plus 256GB below. Run the test on your fastest card...
  31. B

    Teensy 4.1 + Circuitpython + Ethernet

    On the Teensy loader page it claims you can drop the hex file on the loader window: I have been searching for the full specs and repo for Teensy 4.1 and have not found it. There is lot of activity with frequent builds showing up here...
  32. B

    Teensy 4.1 + Circuitpython + Ethernet

    Looks like there is CircuitPython for Teensy 4.1. Here is the hex file: https://circuitpython.org/board/teensy41/ Does the teensy loader use drag and drop for hex files?
  33. B

    Raspberry Pi Pico

    I was impressed when I executed this command, from a pdf document, on a Raspberry Pi 4 All software and tools were installed. Tutorials for creating a project using CMake. Using SWD to program flash, GDB and OpenOCD to debug. Unlike Arduino, I felt right at home with the BSD Unix...
  34. B

    Raspberry Pi Pico

    It's really bad. I really like the RP2040 for users that are using Arduino SDMD21 or AVR boards and want more SdFat performance. There are now at least ten boards. There is great documentation and help. You can be in the Arduino world, the Raspberry Pi world or the mbed world. I know Teensy...
  35. B

    Raspberry Pi Pico

    Pico ADC Errata the good news: I managed to implement DMA ADC with chained buffers at 500 ksps. The interval between samples can be set in steps 1/48 of a microsecond. The bad news: The ADC has a design flaw. Like many SAR ADCs it uses a a capacitive DAC. One of the capacitors is not scaled...
  36. B

    analogRead sampling

    Yes timer triggered ADCs are best for jitter. Too bad there are not simple Teensy functions for the ADC to take a 16K point sample using DMA. I have been playing with the Raspberry Pi SDK for the RP2040 and it has a simple way to take such a sample with DMA. The ADC is capable of 500 ksps...
  37. B

    analogRead sampling

    I have used the simple loop with micros() to time intervals in my data logging examples and assumed lots of jitter. I did a test using the cycle counter in a Teeny 4.1. The result is far better than I hoped for. Here is the test code that take 20,000 samples and prints the min and max time in...
  38. B

    Raspberry Pi Pico

    Pico SD logger source. Here is the code. It is rough since I am exploring the Pico. It runs at 100,000 sps. I may try to hit 200,000 sps or better by using simple chained DMA in core1. The Pico has some fancy fast features to synchronize cores but I am not using them. It has two 8x32-bit...
  39. B

    Raspberry Pi Pico

    RP2040 ADC to SD logger I started playing with the Pico using Python but recently decided to see how much performance I could get with an adc to SD card data logger. I did a test of SD speed and got a write speed of just over 2 MB/sec. The ARM PrimeCell SSP (PL022) SPI is far better than SPI...
  40. B

    Changes to SdFat Unicode support.

    I don't get the warning even though I have warnings set to "All" in the Arduino IDE where I test SdFat. Must be new to gcc 10. I wrote this when there were only AVR boards and float was the same as double. I will fix it by replacing FLT_MIN and FLT_MAX.
  41. B

    Changes to SdFat Unicode support.

    I noticed posts here about use of the UTF-16 features in SdFat. I want to warn of future changes to Unicode in SdFat. I plan on replacing UTF-16 with UTF-8. I did a quick hack and find UTF-8 is easy to implement and easy to use. Here is a test example with error checking removed. I used...
  42. B

    Increasing Sample Rate and SD Card Upload Rate (Teensy 4.1)

    Sometimes I find users call flush/sync since they do not properly close a file. close() just calls sync() then marks the file closed. bool ExFatFile::close() { bool rtn = sync(); m_attributes = FILE_ATTR_CLOSED; m_flags = 0; return rtn; } With any example you should run it to...
  43. B

    Increasing Sample Rate and SD Card Upload Rate (Teensy 4.1)

    You will never get high speed low latency results with flush()/sync(). flush() is just a call to sync(). /** Arduino name for sync() */ void flush() {sync();} sync() causes a huge amount of extra I/O. The data buffers are written to the SD, the directory entry is read, updated and...
  44. B

    SPI for Teensy 3.6 On-board microSD?

    There are lots of microsSD extenders, converters and sniffers that I use to look at signals while debugging. Look for something like this on ebay. They tend to be about $3.50 I find boards that allow me to probe signals with a scope. Probably not as good as an extender with a cable...
  45. B

    MTP dependency issues w/Teensy 3.6 and SDFat 2.0.4

    Paul, I stopped development of 16-bit Unicode when I discovered how hard it was to use. I already have decided that the next attempt would be UTF8 based. The case problem is next. FAT16/FAT32 LFN is ambiguous. Windows has it's way of handling case. Microsoft doesn't clearly define the rules...
  46. B

    Teensy 4.1 digitalWrite question.

    I want providers of Arduino compatible systems to support standard Arduino functions. When I hit The Board Manager Tab I see over thirty board support packages. Not to mention things like PlatformIO. Something like this happened in the Unix wars in the late 1980s and early 1990s to set the...
  47. B

    MTP dependency issues w/Teensy 3.6 and SDFat 2.0.4

    I wrote SdFat with the intention of better Unicode support but the underlying Arduino system make this difficult. Even supporting 8-bit as opposed to 7-bit ASCII is difficult since this require ANSI code pages. exFAT defines so much of how 16-bit characters work with it's Up-case Table so I...
  48. B

    Teensy 4.1 digitalWrite question.

    I know about digitalWriteFast(). My question is about digitalWrite(). I am trying to write simple examples for all Arduino boards and Teensy 4.1 has this strange digitalWrite() property. I looked at the code and the execution path depends on the write value. It's amazing the code compiles to...
  49. B

    Teensy 4.1 digitalWrite question.

    I have been using digitalWrite() with a scope to time various operations in a new version of ChibiOS/RT. I first characterized digitalWrite() timing with this program: void setup() { pinMode(LED_BUILTIN, OUTPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH)...
  50. B

    Problem reading from SD card directly into PSRAM

    Release of SdFat is not related to Teensy. I like playing with Teensy but the overwhelming number of users are on other boards. Most of the mods in 2.0.5 will be for other systems. I will be adding more support for STM32, STM32 is becoming more popular since ST now has an official Arduino...
Back
Top