Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Either Initilizing, Writing or Reading a String from Flash Storage bricks Seeeduino XIAO. #56

Open
brdane opened this issue Jan 9, 2024 · 1 comment

Comments

@brdane
Copy link

brdane commented Jan 9, 2024

I cannot quite pinpoint it to either one, but when a string is either initilized, written, or read from a XIAO's flash memory, the next time it is power cycled, there is essentially no communication to the PC it connects to. Not only this, but there is not even an attempt (no Windows 'device connected' sound effect that one normally gets.). The XIAO is bricked to the point to where jumping the reset pins does not even trigger a reset, so that makes me think the processor itself is bricked and can't even initilize/boot anymore.

I used a byte for FlashStorage as well, but I followed plenty of public examples to ensure I did the right steps to utilize it.

Initialization code used (along with some other variables used):

String deviceName = "DAP - 16 Knob Controller";

FlashStorage(d_name, String);
FlashStorage(writeflag, byte);

Reading Code Used:

inline void FetchDeviceName()
{
      char charBoi[32];

      byte nb = writeflag.read();

      if (nb != 69)
        return;


      deviceName = d_name.read();
        
}

Writing Code Used:

inline void WriteDeviceName(String newName)
{
  if (newName == "")
  return;

  d_name.write(newName);
}

Normally, I would do process of elimination and test each of the three functions seperately, but I do not want to risk keep bricking XIAO's.

@brdane
Copy link
Author

brdane commented Jan 11, 2024

I took a risk with another XIAO, and tried some modified code. Instead of trying to store a string, I stored a struct that simply had a 32-char array... like so:

struct name
{
char actual_name[32];
};

FlashStorage(deviceName, name);

I write and read as normal using the existing read() and write() functions... works like a charm! I can write stuff, power cycle the XIAO, and read what I wrote upon powering it back on! I hope this post helps more people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant