Upload of large code (15 kb fails)

Posted on
  • I've a pretty large application consisting of 5 modules (loaded with require) and a main.
    I've enabled "Save on Send" and set "Minification" as well as "Module Minification" to "Closure Simple".

    The upload kind of succeeds but the execution fails with

    >Uncaught InternalError: NRF ERROR 9
     at line 1 col 7573
    ...bounce:50,repeat:!0})});\n");load();
    

    Further more the saved code is garbage:

    dump();
    // Code saved with E.setBootCode
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ...
    
    require("Storage").read(".bootcde");
    ="\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF....
    

    If reduce my code size by deleting functions, everything turns back to normal.

    Can this be fixed? I'm also happy with a solution where I upload the modules and the main separately.

  • Are you using firmware 1v98? and on Puck.js?

    Which IDE are you using? The Windows Native one? The IDE should be splitting those writes into a series of function calls, but it doesn't appear to be (I guess it might be an old one, or maybe I didn't update the Windows Native IDE).

    It looks like the flash write fails because of the write size being greater than 4k though - I'll fix that in the firmware (but with the right IDE it shouldn't be an issue anyway).

  • I'm using a Mac, WebIDE version is 0.68.6 and a Puck with the latest travis build 1v98+1.

  • Ahh - if you try just espruino.com/ide in the browser then it'll probably work. I'll release a Chrome App update soon and that should fix it.

    However if you use one of the travis builds it should now be fixed in the firmware as well.

  • It works now - thank your for resolving the issue so quickly.

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

Upload of large code (15 kb fails)

Posted by Avatar for AntiCat @AntiCat

Actions