Problem with all apps deleting

Posted on
  • Sometimes when I upload code to my Bangle.js in the web ide in it gives this error in the terminal:

    Storage is corrupt.
    Erasing Storage Area...
    Erase complete.
    

    When it displays that message it starts erasing all my apps including the clock and app launcher.
    I am able to reinstall my apps afterword with the app loader, but it takes a while for me to upload the apps and organize them.
    Why is this happening?

  • Sat 2021.08.21

    Hi @Ronin0000  although I might not have the exact response you are seeking, there are a few questions that others may need to get you back on track.

    Let's start with the version of software that is installed.

    Please post the results of process.env

    https://www.espruino.com/Reference#t_l_p­rocess_env

  • Hi @Robin thanks for replying. Here are the results from "process.env".

    >process.env
    ={
      VERSION: "2v09",
      GIT_COMMIT: "7247a2c4",
      BOARD: "BANGLEJS",
      FLASH: 524288, SPIFLASH: 4194304, STORAGE: 4194304, RAM: 65536,
      SERIAL: "714c1740-b54c335f",
      CONSOLE: "Bluetooth",
      MODULES: "Flash,Storage,hea" ... "tensorflow,locale",
      EXPTR: 536882372 }
    > 
    
  • Okay thanks, near latest version available.

    Sometimes when I upload code

    Before you upload any code @Ronin ,   has an attempt been made to determine what Espruino 'thinks' is the amount of available memory, before the corruption is detected?

    require("Storage").getFree()

    http://www.espruino.com/Reference#l_Stor­age_getFree

    Having an idea of what is available before each app upload, might provide a clue as to which app might be problematic. Should this be repeatable, please post a list by name and in order of upload with available storage and memory should provide additional clues.

  • This process.memory() might also be of some help?

    http://www.espruino.com/Reference#t_l_pr­ocess_memory

  • and another thought. . . .

    Sometimes when I upload code

    By chance is the code that is being uploaded, something of your creation, such as using:

    require("Storage")

    or is the reference to just an app(s) or a proven tutorial perhaps? If so, please post links and/or the code snippet using the 'Storage' module.

  • Hi @Robin the error only happens when I upload my own program, but it doesn't happen every time even though the code is the same. The latest version of the program uses require("Storage") but earlier versions didn't, and I am fairly sure I saw the error as well then. Here is the current outputs (I have not reloaded any apps):

    process.memory()
    ={ free: 2044, usage: 56, total: 2100, history: 9,
      gc: 0, gctime: 3.0517578125, blocksize: 16, stackEndAddress: 536922336, flash_start: 0,
      flash_binary_end: 457148, flash_code_start: 1610612736, flash_length: 524288 }
    >require("Storage").getFree()
    =4194304
    

    I have uploaded my program and did not encounter the failure. Each time I upload my program I will run these commands first to capture this information in case it happens again.

  • Sat 2021.08.21

    the error only happens when I upload my own program

    Thank you @Ronin for acknowledging, . . . . that confirms my hunch.


    Each time I upload my program I will run these commands first

    That would be a good idea, and should a pattern be observed, it would be nice if you would post those observations here so that others may benefit.

    It's not clear of the data size that is being stored via the Storage module, so I'm uncertain of possible overhead that should be taken into account for each packet store event.

  • but earlier versions didn't

    Running process.memory() or process.memory().free before each app upload might also provide a clue. Although the value will be different for each device based on the actual apps loaded, my experience is that when approaching a value around 150 JsVars or less, one may start to notice issues. Versions of Espruino after 1V95 or thereabouts did start reporting LOW MEMORY warnings.

  • Ok, Thanks @Robin!

  • Hi @Ronin,

    Sorry you're having issues. Please could you try upgrading your Bangle to firmware version 2v10?

    Version 2v09 did have an issue where if you completely filled up your Bangle's storage, and then restarted, it would think that storage was corrupted and would erase it. So I guess if you did manage to completely fill up the 4MB then that could be what you're seeing?

    However, if you're still having issues, would it be ok for you to post your code up with some instructions to reproduce? If you can reliably get storage corrupted I'd love to be able to do it here so I can get the issue fixed.

    Also, not sure what everyone thinks, but how do you feel about Storage Corrupt, erasing...? Obviously it's really annoying when it happens, and it's possible that if storage wasn't erased, some data could be recovered. However, it shouldn't really happen at all - and if storage did get corrupt, it's better to know about it than for the Bangle to just keep crashing and maybe get into a reboot loop.

  • Ok, Thanks @Gordon, I will update my firmware to 2v10.

  • Also, not sure what everyone thinks, but how do you feel about Storage Corrupt, erasing...?

    Storage Corrupt - Yes. Not so sure about the erasing but once the corruption is deteced its needs to be pointed out regularly so that its not missed. Maybe some sort of crash dump analysis file could be generated that could be retained, uploaded, then manually deleted. This could record the answers to common questions like - what apps were installed, what was the config, mem size at the time. I'm not talking a full system image but some useful debug info that might help nail the problem down / eliminate possibilities.

  • I guess potentially there's room for an 'Imager' app that just writes all of storage to a file and optionally restores it...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Problem with all apps deleting

Posted by Avatar for Ronin @Ronin

Actions