SD Card Not Found Mystery

I’m having an issue with a build in which the Proffieboard is intermittently not finding the SD card on bootup?

Perhaps four out of five boots are fine, but the fifth boot I get the “SD card not found” message.

There’s a fair bit of space under the board so the wires aren’t bunched up or crowded against the holder particularly.

Battery is fully charged and showing 4.14 volts at battery when it’s removed from the hilt. Also showing 4.14 volts at Batt- and Batt+ pads when the kill key is pulled, both when the saber boots normally and when the SD error is thrown. 3.3 volt pad is also showing correct voltage in both scenarios (well, 3.29 volts).

Stuff I’ve tried:

  • A different SD card;
  • Kapton tape (thin) on the back of the card;
  • Electrical tape (thicker) on the back of the card;
  • Reflashed the board;
  • Formatted cards with the recommended SD formatter.

Specs are:

Proffie 2.2 (selected in Boards Manager and config);

ProffieOS 6.6

Plugin 3.6.0

2.1mm charge port

Any thoughts welcome.



My gut says it’s the SD getting loose once in a while. Maybe even just one of the contacts is slightly looser? I have a board where that happens during duelling so a bit of blu tak holds it firm.

That was my first thought, hence the tape on the back of the SD card to make it a tighter fit and push the contacts harder against each other, but no joy. The hilt doesn’t even have to move to exhibit different outcomes:
Pull the kill key - it boots normally - replace the kill key;
Pull the kill key again a few seconds later having not even breathed on the hilt - SD card error…
…sometimes.

Do you happen to have Mass Storage selected in USB Type in Arduino? If so are you maybe forgetting to Eject?

No, I don’t spec mass storage for customer’s hilts in case they do exactly that - forget to eject which I know can cause problems.
I only set it up with Serial + WebUSB.

Here’s a video showing how random it is:
(The multiple “directory not founds” are because I have shared Boot, Force Effects and Functions folders on most fonts).

That’s odd, anything in the Serial Monitor?

The problem still exists whether I power it from USB or from the battery.
This is what Serial Monitor said: two good boots, one failed one, then another good one. (I’ve added the line spacing for clarity).

14:41:27.303 → Welcome to ProffieOS ProffieOS 6.6. Sabersense Config. Harry Edmanson Thrawn Hunter, Single Button. Long hilt v4… Type ‘help’ for more info.
14:41:27.833 → I2C init…
14:41:27.833 → Motion chip … 105 found.
14:41:32.810 → Amplifier off.
14:41:33.791 → Unmounting SD Card.

14:41:39.336 → Welcome to ProffieOS ProffieOS 6.6. Sabersense Config. Harry Edmanson Thrawn Hunter, Single Button. Long hilt v4… Type ‘help’ for more info.
14:41:39.899 → I2C init…
14:41:39.899 → Motion chip … 105 found.
14:41:42.655 → Amplifier off.
14:41:43.636 → Unmounting SD Card.

14:41:50.366 → Welcome to ProffieOS ProffieOS 6.6. Sabersense Config. Harry Edmanson Thrawn Hunter, Single Button. Long hilt v4… Type ‘help’ for more info.
14:41:51.090 → Failed to mount SD card.
14:41:52.080 → Failed to mount SD card.
14:41:53.074 → Failed to mount SD card.
14:41:54.068 → Failed to mount SD card.
14:41:55.095 → Failed to mount SD card.
14:41:55.863 → Saving Global State
14:41:55.863 → Failed to mount SD card.
14:41:55.863 → Failed to mount SD card.
14:41:55.863 → Amplifier off.
14:41:56.080 → Failed to mount SD card.

14:42:03.411 → Welcome to ProffieOS ProffieOS 6.6. Sabersense Config. Harry Edmanson Thrawn Hunter, Single Button. Long hilt v4… Type ‘help’ for more info.
14:42:03.661 → I2C init…
14:42:03.661 → Motion chip … 105 found.
14:42:04.348 → Amplifier off.
14:42:05.305 → Unmounting SD Card.

If it’s not the SD card maybe there’s an issue with the card reader itself. May need profezzorn’s thoughts.

1 Like

Random hypothesis. Do you have #define DISABLE_DIAGNOSTIC_COMMANDS active?
If so, does the problem go away when you comment it out?

No I don’t use that disable define. I like to run sdtest on the loose board with the card once it’s loaded up and flashed in an effort to show up any issues before I start soldering., and obviously that disable prevents that working. The line is in the config in case I have setup where I need the extra space, but it is indeed commented out.

Config extract here:

#define ENABLE_SD
#define ENABLE_SERIAL
//  #define DISABLE_DIAGNOSTIC_COMMANDS
//  #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
#define NO_REPEAT_RANDOM
#define FEMALE_TALKIE_VOICE

It could be a problem with the board, it could also be a problem with the SD card. Either way, giving the SD card a little bit more time to start up might help. To do that, add a define like this to your config file:

#define CONFIG_STARTUP_DELAY 500

@profezzorn, FYI I have heard several reports of this random SD card not found, and in the most recent case that I worked on with a guy, it seemed that reverting to 5.9 fixed it, and same config in OS6 broke it. Initially it seemed that omitting DISABLE_DIAGNOSTIC_COMMANDS fixed it, but that doesn’t really make much sense, right?
If someone experiencing it could help narrow it down with some troubleshooting, maybe there’s something to track down with OS6 update?

Indeed.
I don’t remember doing any major changes to SD card stuff between 5.x and 6.x, so whatever is causing this must be some sort of buffer overflow or something. That could also explain why changing seemingly unrelated features causes it to work/not work.

Thanks both.
I’ve tried swapping the SD card out but it makes no difference. Obviously not tried replacing the board yet.
But it’s interesting to hear I’m not the first person to have had this. So yes, happy to help track the issue down if I can.
When I get home today, I’ll try the delay line above to begin with and report back. Beyond that, I’m in your hands. Let me know what you want me to do and we’ll try and nail this particular gremlin, or at least nail down whether it’s a software or hardware thing.
:slight_smile:

OK, I added that startup delay line, but unfortunately no change.
:confused:
Out of ten boots, the second and ninth boot didn’t find the SD card. All other boots OK.

Just tried going back to ProffieOS 5.9 with the same config minus the OS specific defines.
Just did 20 boots straight and they were all good. So it seems there is something in OS 6.6 causing the hiccup.
In case it’s useful, below are the two define sections to compare. As mentioned, Eeverything else in the configs was a straight cut and paste, so identical. I believe the only changes are ones that 5.9 wouldn’t recognise, but maybe there’s a clue in there somewhere:

**PROFFIE-OS 6.6**
#ifdef CONFIG_TOP
#include "proffieboard_v2_config.h"
#define NUM_BLADES  2
#define NUM_BUTTONS 1
#define VOLUME 1700
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 8.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define ENABLE_SERIAL
//  #define DISABLE_DIAGNOSTIC_COMMANDS
//  #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
#define CONFIG_STARTUP_DELAY 500
#define NO_REPEAT_RANDOM
#define FEMALE_TALKIE_VOICE
#define DYNAMIC_BLADE_LENGTH
#define DYNAMIC_CLASH_THRESHOLD
#define SAVE_CLASH_THRESHOLD
#define SAVE_STATE
#define FILTER_CUTOFF_FREQUENCY 100
#define FILTER_ORDER 8
#define IDLE_OFF_TIME 15 * 60 * 1000
//  Minutes multiplied by seconds multiplied by milliseconds. (15 * 60 * 1000 = 15 minutes).
#endif
#ifdef CONFIG_PROP
#include "../props/saber_sa22c_buttons.h"
#endif
**PROFFIE-OS 5.9.**
#ifdef CONFIG_TOP
#include "proffieboard_v2_config.h"
#define NUM_BLADES  2
#define NUM_BUTTONS 1
#define VOLUME 1700
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 3.9
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define NO_REPEAT_RANDOM
//  #define DISABLE_DIAGNOSTIC_COMMANDS
//  #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
#define SAVE_STATE
#define IDLE_OFF_TIME 15 * 60 * 1000
//  Minutes multiplied by seconds multiplied by milliseconds. (15 * 60 * 1000 = 15 minutes).
#endif
#ifdef CONFIG_PROP
#include "../props/saber_sa22c_buttons.h"
#endif

It’s odd that it’s random though.
I mean, this is early in the startup cycle, and it doesn’t depend on any user input, so it really ought to behave the same every time.

Why do you have ENABLE_SERIAL in the OS6 config but not OS5?
Did you add a bluetooth module?

Ahh, that must be a hangover from a build with bluetooth I did previously (which the hilt in question doesn’t have). Forgot to take it out.
Want me to delete that line and try os-6 again without it?

Just tried losing that serial line with 6.6 and the problem is back. Couldn’t find SD on the third attempt.

**PROFFIE-OS 6.6.**
#ifdef CONFIG_TOP
#include "proffieboard_v2_config.h"
#define NUM_BLADES  2
#define NUM_BUTTONS 1
#define VOLUME 1700
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 8.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
//  #define ENABLE_SERIAL
//  #define DISABLE_DIAGNOSTIC_COMMANDS
//  #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
#define CONFIG_STARTUP_DELAY 500
#define NO_REPEAT_RANDOM
#define FEMALE_TALKIE_VOICE
#define DYNAMIC_BLADE_LENGTH
#define DYNAMIC_CLASH_THRESHOLD
#define SAVE_CLASH_THRESHOLD
#define SAVE_STATE
#define FILTER_CUTOFF_FREQUENCY 100
#define FILTER_ORDER 8
#define IDLE_OFF_TIME 15 * 60 * 1000
//  Minutes multiplied by seconds multiplied by milliseconds. (15 * 60 * 1000 = 15 minutes).
#endif
#ifdef CONFIG_PROP
#include "../props/saber_sa22c_buttons.h"
#endif

One last little curve ball that I forgot to add - the hilt ehibiting the problem under 6.6 is one of a pair of Thrawn Hunters. Since each hilt has a different length blade, I’ve used identical configs except for the pixel count in the blade array. What’s weird is that the SD card problem existed on one hilt (the longer one) but never on the shorter one.
But under 5.9, the problem doesn’t exist on either.
:confused: