SD Card
SD card usage notes, specification, rebuilding contents and troubleshooting.
This guide deals with SD cards for use in the Duet SD card socket, for all Duets including Duet 0.6/0.85, Duet 2 WiFi/Ethernet/Maestro, and Duet 3 running in standalone mode. For Duet 3 boards connected to a Raspberry Pi or other Single Board Computer (SBC), the SD card is put in the SBC, not in the Duet 3; see the Duet 3 documentation for using the Duet 3 in this configuration: Getting Started With Duet 3
General Notes
All Duets have a built-in micro SDHC card socket. Duet 2 WiFi/Ethernet/Maestro are supplied with a compatible SD card. Duet 3 is also supplied with an SD card, but this is formatted for use in a Raspberry Pi; future versions may work in both RPi and Duet 3 in 'standalone' mode. You may need to create a new SD card for use Duet 3 in standalone mode.
In normal use, you should never need to remove the SD card from its socket. You can transfer files to/from the SD card over the web interface.
Caution! Do not use an SD extender cable. Such cables do not generally work well at the high SD card transfer speeds used by the Duet. Additionally, some types of SD card extender cable have been found to damage the SD card socket. Damage to the SD card socket from using an extender cable is not covered by the warranty.
It is possible to connect a second, low-speed SD card socket to the Duet - see Connecting an LCD control panel: Using the external SD card socket on the LCD panel
Specification
If you need to replace the micro SDHC card, we recommend you choose:
- a branded card with a speed rating of Class 4 or higher
- of up to 32GB capacity, formatted as below. RepRapFirmware does not support SD cards formatted in exFAT format.
Formatting
If you need to reformat the micro SDHC card:
- If the capacity of the card is 4GB or lower, use FAT16 format
- If the capacity is more than 4GB (up to 32GB) then you will have to use FAT32 format
- All cards should be formatted with 512 byte sectors
- For best upload speed choose the largest cluster size available, which is normally 64kb for FAT16 and 32kb for FAT32
- Use the official SD Card formatting tool for best results: https://www.sdcard.org/downloads/formatt...
- DO NOT use Windows 'Quick Erase'. This generally does not create a clean FAT32 partition.
Creating the file structure
- To create a new SD card that will act as the Duet's primary card, first format a suitable SD card as above.
- Use the config tool to create a configuration for your printer.
- On the 'Finish' page, if you select "Get the latest stable Duet Web Control version" the config.zip file you download will have a /www folder with the latest version of DWC in it.
- On the 'Finish' page, if you select "Get the latest stable RepRapFirmware version", the config.zip file you download will have the latest versions of the firmware and IAP file (In-App Programmer, needed to update the firmware) for your board in it. Note that you do not need these files on the SD card to run the Duet, only to update it. The Firmware Version you selected in the Config Tool > General page will determine where these are stored:
- 3.3 or later - a /firmware folder is created and firmware and IAP files placed in it.
- 3.0 to 3.2 - firmware and IAP files are placed in the /sys folder.
- Download the configuration, unzip the file and copy the folder(s) to the SD card.
- If you didn't get the latest DWC version, or are creating a new SD card for a Duet running older firmware, get a compatible version of DWC for the firmware you are using and place that in /www/, see Firmware Overview for more details on the firmware versions.
- Add a gcodes folder for your print files. These can be uploaded over the web interface.
- Add a macros folder for scripts to automate tasks. See Macros for some inspiration.
- This should give you a basic config.g and web interface files. The SD card structure should be similar to this, though the exact file names may vary:
. ├── firmware │ ├── Duet2CombinedFirmware.bin │ └── Duet2_SDiap32_WiFiEth.bin ├── gcodes ├── macros ├── sys │ ├── bed.g │ ├── config.g │ ├── config.json │ ├── homeall.g │ ├── homex.g │ ├── homey.g │ ├── homez.g │ ├── pause.g │ ├── resume.g │ ├── sleep.g │ ├── stop.g │ ├── tfree0.g │ ├── tpost0.g │ └── tpre0.g └── www ├── DuetAPI.xml ├── css │ ├── Accelerometer.5c60999b.css.gz │ ├── GCodeViewer.9597b317.css.gz │ ├── HeightMap.4d390d72.css.gz │ ├── ObjectModelBrowser.c5e13b42.css.gz │ ├── OnScreenKeyboard.7f43fe4b.css.gz │ └── app.ce075a4e.css.gz ├── favicon.ico.gz ├── fonts │ ├── materialdesignicons-webfont.147e3378.woff │ ├── materialdesignicons-webfont.147e3378.woff.gz │ ├── materialdesignicons-webfont.174c02fc.ttf.gz │ ├── materialdesignicons-webfont.64d4cf64.eot.gz │ ├── materialdesignicons-webfont.7a44ea19.woff2 │ └── materialdesignicons-webfont.7a44ea19.woff2.gz ├── img │ └── icons │ ├── android-chrome-192x192.png.gz │ ├── android-chrome-512x512.png.gz │ ├── android-chrome-maskable-192x192.png.gz │ ├── android-chrome-maskable-512x512.png.gz │ ├── apple-touch-icon-120x120.png.gz │ ├── apple-touch-icon-152x152.png.gz │ ├── apple-touch-icon-180x180.png.gz │ ├── apple-touch-icon-60x60.png.gz │ ├── apple-touch-icon-76x76.png.gz │ ├── apple-touch-icon.png.gz │ ├── favicon-16x16.png.gz │ ├── favicon-32x32.png.gz │ ├── msapplication-icon-144x144.png.gz │ ├── mstile-150x150.png.gz │ └── safari-pinned-tab.svg.gz ├── index.html.gz ├── js │ ├── Accelerometer.4a8a402b.js.gz │ ├── Accelerometer.4a8a402b.js.map.gz │ ├── GCodeViewer.95d3cd80.js.gz │ ├── GCodeViewer.95d3cd80.js.map.gz │ ├── HeightMap.a082b8e6.js.gz │ ├── HeightMap.a082b8e6.js.map.gz │ ├── ObjectModelBrowser.0b9b2798.js.gz │ ├── ObjectModelBrowser.0b9b2798.js.map.gz │ ├── OnScreenKeyboard.a880bca8.js.gz │ ├── OnScreenKeyboard.a880bca8.js.map.gz │ ├── app.24acd1b2.js.gz │ └── app.24acd1b2.js.map.gz ├── manifest.json.gz ├── precache-manifest.a4ab8f573fcc203b798fa7d11eee39d5.js.gz └── service-worker.js.gz
For more information on the SD card structure see : Firmware Overview: SD Card Structure
Troubleshooting SD Card issues
SD Card
A faulty SD card can cause a wide range of strange behaviour: inaccessible DWC, config.g not run at startup, slow downs printing, network disconnections, slow file transfer, corrupted files and almost any other problem that relies on accessing the SD card.
To test the SD card, send M122
to the Duet (via the web console, or connect via USB using YAT or similar serial terminal software) and look for the 'SD Card' entries. A normal response should look something like:
SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest block write time: 5.1ms, max retries 0
If it responds with "SD card detected" in M122, it indicates that the Card Detect pin of the SD card is working (this is also the pin whose soldering causes the most trouble; see below).
The interface speed in the same line gives an indication of whether the processor is able to communicate with the SD card at all. It should be 20Mbytes/sec on a Duet WiFi/Ethernet, 15Mbytes/sec on a Duet Maestro, and 25Mbytes/sec on Duet 3 in standalone mode. Other numbers, eg 12Mbytes/sec, are odd and suggest an issue with the SD card. If the socket or processor is faulty but the card is detected, it usually drops to 0.2Mbytes/sec.
You can run a speed test on the SD card by sending:
M122 P104 S[file size in MB]
Speeds reported should usually be between 2 and 2.5Mbytes/sec. For example, Duet 2 WiFi - 2.23Mbytes/sec, Duet Maestro 2.42Mbytes/sec for a 10MB file.
Stuttering during printing can be caused by the SD card not supplying the motion planner with data quickly enough, another sign that the SD card may be under-performing. Run M122
from the console, and look for "underruns" on this line:
=== DDARing === Scheduled moves: 1295584, completed moves: 1295544, StepErrors: 0, LaErrors: 0, Underruns: 80, 300
The first value isn't a warning, just an indication that the lookahead function couldn't do something with the time given. It doesn't slow down the print, but is likely not ideal. The second number is a 'prepare move' underrun, which means that the move could not be prepared in time and so the movement must wait. This is much worse than the first one. Try replacing the SD card if you get these.
If those tests do not work, you can also attempt to force the SD card to unmount and mount. Any error message generated may be helpful in determining if the card is being read at all or not.
M22 to unmount, M21 to mount.
SD Card Diagnostic Test
You can run a diagnostic test on your SD card using H2Testw (Windows only).
https://www.heise.de/download/product/h2...
Warning: Only 4461 of 7428 MByte tested. The media is likely to be defective. 4.3 GByte OK (9136127 sectors) 0.5 KByte DATA LOST (1 sector) Details:0 KByte overwritten (0 sectors) 0 KByte slightly changed (< 8 bit/sector, 0 sectors) 0.5 KByte corrupted (1 sector) 0 KByte aliased memory (0 sectors) First error at offset: 0x000000008123ff80 Expected: 0x04c122acee44af80 Found: 0x27a7a1cd8943af80 Reading speed: 66.8 MByte/s
SD Card Socket
Some boards have poorly soldered SD cart sockets, with the pins on the back of the socket making poor or no contact, causing erratic behaviour or unable to read the SD card at all. Boards with this issue will be replaced under warranty. The picture below shows the pins on the right are not making contact.
Check if the SD card socket is getting hot. This can be caused by a short from VIN (12 or 24V) to the 5V or 3.3V rail or a failure of the 5V or 3.3V regulator. This is usually terminal for the Duet, as the WiFi board (if fitted) and main processor may also be getting hot, due to over-voltage short circuit damage. The SD card may also be damaged, and the Duet will likely be unresponsive. See What to do if your Duet won't respond and How to destroy your Duet 2
10 Comments
Good day!
The SD card in PanelDue does not work for me. The cable from the panel to the board is OK. The tester has checked the connection from the SD card connector to the processor. Firmware version 3.3. What to do?
Roman
Roman Vasylevskyi - Reply
The PanelDue SD card only works with the ribbon cable plugged in; it doesn’t work with the 4-wire cable. See the PanelDue documentation.
For further support, please use the forum: https://forum.duet3d.com/
Post your M122 response and config.g on the forum for a quicker and more accurate response.
Ian A-S -
I have recently bought a brand new DUET2 wifi board. I am having an issue with the wifi connection being lost every time a end stop switch is triggered. It will not reconnect until the motor is manually moved and the switch changes state. The end stop switch are wired NC, and opened on contact. Can u advice me on what to do to fix this. thanx Chis
fire fli - Reply
it sounds like your endstop is wired incorrectly and shorting. Check your wiring and consult the endstop wiki entry. If you require further assistance please create a forum thread where it's easier to provide 1 on 1 help.
Jason Znack -
Warning: Cards larger than 32 GB will automatically and without warning be formatted with ExFat by the SD Card Formatter !!!
Took some time to figure out, but luckily everything works after partitioning them.
Yves Depreitere - Reply