Wifiibo icon indicating copy to clipboard operation
Wifiibo copied to clipboard

Crashes during "Create Tag" operation (solution included)

Open ytmytm opened this issue 4 years ago • 0 comments

It's too simple for a PR, just three different lines.

I get "Fatal exception 9(LoadStoreAlignmentCause):" error whenever trying to use Create Tag option. The reason seems to be a bug inside sscanf - an unaligned memory access somewhere within sscanf function used here:

https://github.com/Xerxes3rd/Wifiibo/blob/0b2aa885afa96fafbcd204097bc8cc7450416754/examples/Wifiibo/Wifiibo.ino#L325

The solution to this is to use a one-byte buffer for the target value, that gets copied into proper place inside createNFCID

          uint8_t idbuf;
          sscanf((const char *)(idStr) + (count * 2), "%2hhx", &idbuf);
          createNFCID[count] = idbuf;

ytmytm avatar Apr 11 '21 18:04 ytmytm