• Hi,

    I am connecting through Bluetooth.
    I removed setupExternalHardware() from onInit(), but it still freezes.

    Then I started with a tiny module BG96NB1.js, adding more and more lines of code step by step.
    I ended up in just adding lines like console.out("XXXXXXXXXXXXXXXXXXX") to find out the module size that still worked, while adding just one more line of console.out made save() freeze again.

    The largest size of the overall program I could see was 12261 (0x2FE5) bytes.

    Setting up external hardware. Please wait ...
    BME280 wiring set up.
    Quectel BG96 wiring set up.
    save();
    =undefined
    Compacting Flash...
    Calculating Size...
    Writing..
    Compressed 40000 bytes to 12261
    Running onInit()...

    This makes me assume that there must be some kind of limit at about 12288 (0x3000) bytes.
    Could this actually be true?
    I can't believe why the application should fit into RAM, but not into flash.

    process.memory();
    ={ free: 1620, usage: 880, total: 2500, history: 421, gc: 0, gctime: 5.09643554687, "stackEndAddress": 536927056, flash_start: 0, "flash_binary_end": 382804, "flash_code_start": 471040,
    flash_length: 524288 }

    Found this in https://github.com/espruino/Espruino/blob/master/boards/RAK8212.py :

    chip = {
      'part' : "NRF52832",
      'family' : "NRF52",
      'package' : "QFN48",
      'ram' : 64,
      'flash' : 512,
      'speed' : 64,
      'usart' : 3,
      'spi' : 3,
      'i2c' : 2,
      'adc' : 1,
      'dac' : 0,
      'saved_code' : {
        'address' : ((118 - 3) * 4096), # Bootloader takes pages 120-127, FS takes 118-119
        'page_size' : 4096,
        'pages' : 3,
        'flash_available' : 512 - ((31 + 8 + 1 + 3)*4) # Softdevice uses 31 pages of flash, bootloader 8, FS 1, code 3. Each page is 4 kb.
      },
    };
    

    Does this mean 3 * 4096 byte only for saved code?
    Compared with the Nordic NRF52832 (https://github.com/espruino/Espruino/blob/master/boards/NRF52832DK.py) why does this have 10 pages a 4096 byte for saved code?

About

Avatar for wklenk @wklenk started