SCM20260N Secure Storage IsBlank Hang


I had an issue with an SCM20260N where calling SecureStorageController.IsBlank would hang the device. This happened when debugging or running independently. I would eventually get a watchdog reset and this would repeat, effectively bricking my device.

I was going back and forth between debugging and running standalone at the time and I’m not sure if this issue was introduced during a debug session, or runtime session. Once it started it happened every time, both ways.

The issue was resolved by an Erase All in TinyCLR Config.

Any advice on what could have caused this and ways to avoid? I’m especially concerned if this could have been caused by something at runtime. Would it be safer to just read and decide for myself if the storage is blank?

I use IsBlank at every startup of my program to determine whether to initialize my config data (which I store in SecureStorage). IsBlank can take time to complete, but has never hung completely on me in any config.

I know that’s a “works on my machine” response, but which TinyCLR firmware version are you using? Maybe we can figure out why you are seeing different results.

Are you sure you are not requesting a block outside the range 0 <= x < TotalSize / BlockSize?

FWIW, this is my code - I use it on various '100 and '260 boards and modules.

private bool IsBlank()
    for (uint block = 0; block < this.configStorage.TotalSize / this.configStorage.BlockSize; block++)
        if (!this.configStorage.IsBlank(block))
            return false;
    return true;
1 Like

Thanks for your response.

That issue happened with while checking IsBlank for Block 0.

I also use it a lot and haven’t had an issue other than this one time. TinyCLR Config ‘Erase All’ fixed it and that module is back to operating normally with an IsBlank check happening on startup, but I’m concerned about it happening again in the future.

Can you reproduce the issue?

It was reproducible at the time (it happened every time I started the application), but after Erase All the issue resolved and hasn’t occurred again.