Strange issue uploading code to Flash in MDBT

Posted on
  • Hello,

    I found an issue when uploading code to MDBT42Q. I used the espruino web ide, the device has the firmware version number 2.11.


    | |_ ___ ___ _ ||___ ___
    | |_ -| . | _| | | | | . |
    |
    |_| || |_|||_|_|

         |_| espruino.com
    

    2v11 (c) 2021 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate

    I've upload the code (attached here) to flash memory, to maintain it after power off. After sucessfully code upload the device sends me this message:


    | |_ ___ ___ _ ||___ ___
    | |_ -| . | _| | | | | . |
    |
    |_| || |_|||_|_|

         |_| espruino.com
    

    2v11 (c) 2021 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate

    Uncaught Error: Unable to find or create file
    at line 1 col 1144
    ...;\n setupFan();\n}",0,1967);

                              ^
    

    Uncaught Error: Unable to find or create file
    at line 2 col 1031
    ...------\");\n}, 1000);",1024);

    Few minutes later the espruino seems to restart itself disconnecting the bluetooth conection from the laptop.

    The most curious part is that if I copy and paste the source code directly to the terminal on the same Espruino web ide, it works perfectly.

    I would like some help to understand the cause of this behaviour.

    Thank you,


    1 Attachment

  • looks like some minification bug, try to change minification settings

  • Hello,

    I used the default configuration settings for compile and send the code.

    I moved back to Espruino 2v10 and it has worked perfect!

    Thanks,

  • I would like some help to understand the cause of this behaviour.

    I was thinking the code was minified improperly (guessing from " line 1 col 1144", " line 2 col 1031" = just a few of very long lines) however it can be also that the storage is corrupted - "Uncaught Error: Unable to find or create file .. ,0,1967);"
    There were some fixes related to possible storage corruption recently so with older versions it may go undetected.

    I'd suggest to update to latest version and erase everything via require("Storage").eraseAll() and reupload again. Even if it looks fine with 2.10 there may be hidden issue that might bite you later.

  • Hello,

    I've changed the minification parameters but the issue still been happening.

    I will try your last suggest today.

    Thanks

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

Strange issue uploading code to Flash in MDBT

Posted by Avatar for lluisrovira @lluisrovira

Actions