General (and 1 specific) memory/TFS issue

Hello,

I would like little info about memory management and potential answers on actual issues.

  • I was previously on .Net Micro G400 and had few crashes of the SD card file system
  • Now on TinyCLR ( Board FezDuino SC20100) I get random file with clearly none ASCII characters created randomly in memory at some point when transferring to TinyFileSystem (through FTP).
  • Also very recently my board just doesn’t run ANY soft using TinyFileSyst - quite weird situation because even after reboot and “erase all” in tiny config i get the same error when running not building -
17:18:01:859 #### Exception System.Exception - CLR_E_WRONG_TYPE (1) ####
17:18:01:859 #### Message:
17:18:01:859 #### System.Text.UTF8Encoding::GetChars [IP: 0000] ####

Error that i don’t get using another fezduino (sc20100 ) … so I think the memory is corrupted/ dead and the “UTF-8” in the error msg make me think to the previous error of random files with random names.

Does anyone have encountered some related issues ?
Is there known issues that are being tackled regarding the file system?
And last concerning my “maybe dead” board, is there another solution then “erase all” to clean memory?

Thx !

You have multiple questions/concerns. Can we please focus on one thing so we can try to help you better?

Lets start with “dead board”. Go to TinyCLR config tool and erase all then reload the firmware. Then go to visual studio and start a new project.

Yes, true, little too general, I was just concerned if they were global issues about it.
For the dead board, wasn’t dead after all, I could recover it and found the issue :
I had tried the “erase all” function + firmware update from TinyCLR Config but apparently it doesn’t format all the external memory.

  • on all the soft that I ran i was actually using the example code of TFS on the Documentation
      if (!TFS.CheckIfFormatted())
        {
            //Do Format if necessary 
            TFS.Format();
        }
        else
        {
            // Mount tiny file system
            TFS.Mount();
        }

and it was not going in the format branch.
So forcing a TFS.format() on a basic soft actually cleaned the external flash so now any soft using TFS work fine.

My question would be is there a clue why the external flash crashed at the first place, with the same code usually running fine.

Thx

  1. When you use Erase all, it doesn’t erase external memory (here is QSPI), this is normal behavior, because QSPI is not a part of system yet.

To get Erase All erase external memory, you need to enable external deployment, now QSPI becomes a part of system then system will erase the external memory.

We need to know what code/what setup.

Thx for the explanation,
The code base is quite big but the pb come when using the TFS.
The setup is a FezzDuino (SC20100).
To be a bit more clear, some board all fezzduino (that usually work fine with same code) sometime make it impossible to access memory without formatting. Which for embedded is quite inconvenient because we can’t access it remotely anymore with FTP. I can’t give you a specific code because the actual moment the memory get corrupted doesn’t make the code crash, we are just writing in memory.