You are reading a single comment by @asez73 and its replies. Click here to read the full conversation.
  • Hi,

    So, I pushed some changes to NUCLEOF401RE.py that do it for save(). There is no need to update the libraries and yes, I think that would be a lot of rewrites for the substantially little or none benefits.
    Now save() resists even if you reflash Espruino interpreter itself. That's because the save() is done to the last page of the flash memory. This page is not erased when you flash the firmware.

    In order to use a lower flash size F4 series you just have to follow my comments in this file.
    On the other hand, flashing a NUCLEOF411RE would imply deeper changes because it has 192 Kbytes of RAM separated in 2 non adjacent memory areas.

    Now I am trying to see how to have setWatch work:

    >reset()
    =undefined
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v71 Copyright 2014 G.Williams
    >ÿ
    =undefined
    Uncaught SyntaxError: Got ?[255] expected EOF
     at line 1 col 1
    ÿ
     ^
    >dump()
    =undefined
    >load()
    =undefined
    Loading from flash...
    >þ
    =undefined
    Uncaught SyntaxError: Got ?[254] expected EOF
     at line 1 col 1
    þ
     ^
    >dump()
    =undefined
    >load()
    =undefined
    Loading from flash...
    >dump()
    function buttonWatcher() {
      console.log("Pressed");
      digitalWrite(LED1, Math.random()>0.5);
    }
    setWatch(buttonWatcher, "C13", { repeat:true, edge:'both', debounce : 100 });
    =undefined
    >process.memory();
    ={ "free": 5320, "usage": 56, "total": 5376, "history": 31,
      "stackEndAddress": 536958516, "flash_start": 134217728, "flash_binary_end": 134442916, "flash_code_start": 134610944, "flash_length": 524288 }
    >process.env
    ={
      "VERSION": "1v71",
      "BUILD_DATE": "Nov  6 2014",
      "BUILD_TIME": "09:23:40",
      "GIT_COMMIT": "f8d8135ec74c5539669ca594165876cfba03b66f",
      "BOARD": "NUCLEOF401RE",
      "CHIP": "STM32F401RET6",
      "CHIP_FAMILY": "STM32F4",
      "FLASH": 524288, "RAM": 98304,
      "SERIAL": "56005b00-0b513333-37343534",
      "CONSOLE": "Serial2"
     }
    >digitalRead(C13);
    =1
    >digitalRead(C13);
    =0
    >setWatch(buttonWatcher, BTN, {edge:"both", repeat:true, debounce: 100});
    =2
    >clearWatch(2);
    =undefined
    >clearWatch(1);
    =undefined
    >dump()
    function buttonWatcher() {
      console.log("Pressed");
      digitalWrite(LED1, Math.random()>0.5);
    }
    =undefined
    >buttonWatcher()
    Pressed
    =undefined
    >buttonWatcher()
    Pressed
    =undefined
    >buttonWatcher()
    Pressed
    =undefined
    >buttonWatcher()
    Pressed
    =undefined
    > save()
    =undefined
    Erasing Flash....
    Programming 86016 Bytes.......................................................................................
    Ãhecking...
    Done!
    >þ
    =undefined
    Uncaught SyntaxError: Got ?[254] expected EOF
     at line 1 col 1
    þ
     ^
    > 
    

    I just pressed and hold down button BTN1 between last 2 digitalRead(C13)...
    Apparently, the setWatch is correctly recorded when defined, dumped correctly but never launched.

    This code was loaded from flash and so the answer when defining setWatch is 'undefined' but actually, it return the integer number that identifies the setWatch for the clearWatch.
    As shown, buttonWatcher does its job correctly, the led changes randomly.
    So both of those functions works but the interrupts are not generated.

    Arduino's pin renaming is still in progress.

    There is a parasitic character in the input buffer after a reset(), a save() or a load(). This is not a big issue but still preventing some reloads or reset before programming from the web IDE. Its code is 0xFE or 0xFF.

    Also, I expect some difficulties with UART6 which I intend to use one day. There is FIXME somewhere is the code about it.

    Have a nice day and congratulation for the Espruino Pico, you not so far away to get £50000 founding level.

About

Avatar for asez73 @asez73 started