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 MB6HC
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
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.
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.
- Preferred Method
- Use theconfig tool to create a config for your printer.
- download the configuration and place in /sys/ on the sd card. 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.
- old method
- Note this image of the SD card will not be compatible with all versions of RepRapFirmware, which why it is no longer the preferred method.
- Download "SD_Card_Contents.zip" from https://github.com/Duet3D/Duet-2-Hardwar...
- Unzip this (but not all the enclosing files) and copy the structure to the SD card
- 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:
├── gcodes ├── macros ├── sys │ ├── DuetWiFiServer.bin │ ├── bed.g │ ├── cancel.g │ ├── config.g │ ├── homedelta.g │ ├── iap4e.bin │ ├── pause.g │ ├── resume.g │ ├── sleep.g │ ├── stop.g │ ├── tfree0.g │ ├── tpost0.g │ └── tpre0.g └── www ├── css │ ├── Lumen.theme.css.gz │ ├── Sandstone.theme.css.gz │ ├── Slate.theme.css.gz │ ├── Superhero.theme.css.gz │ ├── United.theme.css.gz │ ├── bootstrap.theme.css.gz │ └── dwc.css.gz ├── favicon.ico.gz ├── fonts │ ├── glyphicons.eot.gz │ ├── glyphicons.svg.gz │ ├── glyphicons.ttf.gz │ ├── glyphicons.woff.gz │ └── glyphicons.woff2.gz ├── html404.htm ├── js │ └── dwc.js.gz ├── language.xml.gz └── reprap.htm.gz
- Edit config.g to enable your networking. See 1.) Getting Connected to your Duet
- Update firmware and DWC as necessary. See: Installing and Updating Firmware
- You may need additional files in the 'sys' folder to update the firmware for your Duet. IAP (In App Programmer) files are used during firmware updates, and are specific to each Duet type. These are usually available in each firmware release. See: https://github.com/dc42/RepRapFirmware/r...
- Copy your existing 'sys' files to the SD card, or create a new set specific for your machine using the RepRapFirmware config tool: https://configtool.reprapfirmware.org/St...
For more information on the SD card structure see : Firmware Overview: SD Card Structure
Troubleshooting SD Card issues
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).
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