{"id":6650,"date":"2025-03-25T07:48:56","date_gmt":"2025-03-25T06:48:56","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=6650"},"modified":"2025-03-25T12:08:51","modified_gmt":"2025-03-25T11:08:51","slug":"test","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/","title":{"rendered":"SD Read and Write Speeds on an ESP32"},"content":{"rendered":"<p>I did not find any comprehensive overview of the <strong>expected read on write speeds<\/strong> of the different Arduino <strong>SD APIs<\/strong> that are provided to access the SD drive. I also expected to see a difference depending on the <strong>read\/write size<\/strong>.<\/p>\n<p>I tested the <strong>SD and SDMMC libraries<\/strong>, that are provided by the ESP32 Arduino core.<br \/>\nI also wanted to include the SDFAT library, but unfortunately it was crashing with different read or write sizes, so I excluded it from my tests. I was including my own <a href=\"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/\">VFS implementations<\/a> however that are provided by the <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">AudioTools<\/a> library, to support the different audio scenarios using purely the Espressif IDF.<\/p>\n<p>In this Blog, I am posting my results, that were measured using an AI Thinker AudioKit Board which has an <strong>ESP32 and a buit-in SD drive<\/strong>.<\/p>\n<p>I did not perform any optimizations and was using the proposed standard settings. The presented values are measured in <strong>thruput of MB per seconds<\/strong>: so the higher, the better!<\/p>\n<h3>SD<\/h3>\n<p>Here are the values using the SD library that is provided by the ESP32 Arduino core:<\/p>\n<div id=\"sd_chart\" style=\"width: 800px; height: 400px\"><\/div>\n<p>The thruput both for reading and writing depends on the write size. Sizes below 100 bytes lead to an extensive overhead and the thruput is is maxing out at slightly above 0.4 MB\/sec.<\/p>\n<h3>SDMMC<\/h3>\n<p>Here are the values using the SDMMC library that is provided by the ESP32 Arduino core. I was using it with 4 bits:<\/p>\n<div id=\"sdmmc_chart\" style=\"width: 800px; height: 400px\"><\/div>\n<p>SDMMC has a much higher thruput that increase with the read and write size!<\/p>\n<h3>VFS_SDSPI<\/h3>\n<p>This is my custom VFS SDSPI driver for the ESP32 that is part of my AudioTools library to provide the Stream API access the SD from pure IDF.<\/p>\n<div id=\"vfssd_chart\" style=\"width: 800px; height: 400px\"><\/div>\n<p>The write size is constant: the read thruput however increases with the read size! The read performance is better then the provided Arduino implementation.<\/p>\n<h3>VFS_SDMMC<\/h3>\n<p>This is my custom VFS SDMMC driver for the ESP32 that is part of my AudioTools library to provide the Stream API access the SD from pure IDF.<\/p>\n<div id=\"vfssdmmc_chart\" style=\"width: 800px; height: 400px\"><\/div>\n<p>The write size is constant: the read thruput however increases with the read size! The read performance is better then the provided Arduino implementation.<\/p>\n<h3>Summary: Write Speed Comparison<\/h3>\n<div id=\"write_chart\" style=\"width: 800px; height: 400px\"><\/div>\n<p>The standard Arduino SDMMC provides the best performance (except for very small write sizes) !<\/p>\n<h3>Summary: Read Speed Comparison<\/h3>\n<div id=\"read_chart\" style=\"width: 800px; height: 400px\"><\/div>\n<p>The standard Arduino SDMMC provides the best performance (except for very small and veriy big write sizes) !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I did not find any comprehensive overview of the expected read on write speeds of the different Arduino SD APIs that are provided to access the SD drive. I also expected to see a difference depending on the read\/write size. I tested the SD and SDMMC libraries, that are provided [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6671,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20],"tags":[],"class_list":["post-6650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SD Read and Write Speeds on an ESP32 - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SD Read and Write Speeds on an ESP32 - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"I did not find any comprehensive overview of the expected read on write speeds of the different Arduino SD APIs that are provided to access the SD drive. I also expected to see a difference depending on the read\/write size. I tested the SD and SDMMC libraries, that are provided [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-25T06:48:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-25T11:08:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/sd_read_speed.png\" \/>\n\t<meta property=\"og:image:width\" content=\"576\" \/>\n\t<meta property=\"og:image:height\" content=\"322\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"SD Read and Write Speeds on an ESP32\",\"datePublished\":\"2025-03-25T06:48:56+00:00\",\"dateModified\":\"2025-03-25T11:08:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/\"},\"wordCount\":404,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/sd_read_speed.png\",\"articleSection\":[\"Arduino\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/\",\"name\":\"SD Read and Write Speeds on an ESP32 - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/sd_read_speed.png\",\"datePublished\":\"2025-03-25T06:48:56+00:00\",\"dateModified\":\"2025-03-25T11:08:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/sd_read_speed.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/sd_read_speed.png\",\"width\":576,\"height\":322},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/25\\\/test\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SD Read and Write Speeds on an ESP32\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SD Read and Write Speeds on an ESP32 - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/","og_locale":"en_US","og_type":"article","og_title":"SD Read and Write Speeds on an ESP32 - Phil Schatzmann","og_description":"I did not find any comprehensive overview of the expected read on write speeds of the different Arduino SD APIs that are provided to access the SD drive. I also expected to see a difference depending on the read\/write size. I tested the SD and SDMMC libraries, that are provided [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/","og_site_name":"Phil Schatzmann","article_published_time":"2025-03-25T06:48:56+00:00","article_modified_time":"2025-03-25T11:08:51+00:00","og_image":[{"width":576,"height":322,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/sd_read_speed.png","type":"image\/png"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"SD Read and Write Speeds on an ESP32","datePublished":"2025-03-25T06:48:56+00:00","dateModified":"2025-03-25T11:08:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/"},"wordCount":404,"commentCount":1,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/sd_read_speed.png","articleSection":["Arduino"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/","url":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/","name":"SD Read and Write Speeds on an ESP32 - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/sd_read_speed.png","datePublished":"2025-03-25T06:48:56+00:00","dateModified":"2025-03-25T11:08:51+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/sd_read_speed.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/sd_read_speed.png","width":576,"height":322},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/25\/test\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"SD Read and Write Speeds on an ESP32"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=6650"}],"version-history":[{"count":20,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6650\/revisions"}],"predecessor-version":[{"id":6670,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6650\/revisions\/6670"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/6671"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=6650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=6650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=6650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}