Storage: File already written with different data

Posted on
  • I run a example in STM32F4DISCOVERY board.
    It's about Storage.
    I copy codes into right-side IDE like this:

    var s = require("Storage");
    s.write("hwll","ddd");
    

    then I send and save into board.
    But it make error like this

    Uncaught Error: File already written with different data
    at line 1 col 21
    s.write("hwll","ddd");

    What's wrong with it?

  • What you're doing looks fine. What firmware are you using? I know that problem was present on older firmwares.

  • I cloned the project from github, and build myself, version is 2v04. I deleted some modules which I don't want in the build file. But Storage module still there.

  • If you had previous firmware, the storage module changed to allow longer file names. Completely erasing flash, or issuing a require("Storage").eraseAll() should fix the issue.

  • You are right, Thank you again!

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

Storage: File already written with different data

Posted by Avatar for user109783 @user109783

Actions