You are reading a single comment by @asez73 and its replies. Click here to read the full conversation.
  • Congratulations: Now BTN1 and setWatch do work!!!

    Connected
    >
    =undefined
    >echo(0);
    Uncaught [object Object]
     at line 1 col 9
    console.log("<<"+"<<<"+JSON.stringify(process.env)+">>>"+">>...
             ^
    =undefined
    >
    =undefined
    >reset(!;
    =undefined
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v71 Copyright 2014 G.Williams
    >ÿecho(0);
    =undefined
    Uncaught SyntaxError: Got ?[255] expected EOF
     at line 1 col 1
    ÿecho(0);
     ^
    >function buttonWatcher() {
    :  console.log("Pressed at "+getTime());
    :  digitalWrite(LED1, Math.random()>0.5);
    :}
    =function () { ... }
    =undefined
    >setWatch(buttonWatcher, BTN, {edge:"both", repeat:true, debounce: 0});
    =1
    >echo(1);
    =undefined
    Pressed at 31.86450067857
    Pressed at 32.05031824999
    Pressed at 33.17640026190
    Pressed at 33.34058927380
    >dump()
    function buttonWatcher() {
      console.log("Pressed at "+getTime());
      digitalWrite(LED1, Math.random()>0.5);
    }
    setWatch(buttonWatcher, "C13", { repeat:true, edge:'both' });
    digitalWrite(A5,1);
    =undefined
    >a=3
    =3
    >save()
    =undefined
    Erasing Flash....
    Programming 86016 Bytes.......................................................................................
    Checking...
    Done!
    >reset()
    =undefined
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v71 Copyright 2014 G.Williams
    >dump()
    =undefined
    >load()
    =undefined
    Loading from flash...
    >dump()
    function buttonWatcher() {
      console.log("Pressed at "+getTime());
      digitalWrite(LED1, Math.random()>0.5);
    }
    var a = 3;
    setWatch(buttonWatcher, "C13", { repeat:true, edge:'both' });
    digitalWrite(A5,1);
    =undefined
    > 
    

    The remaining problems are now:

    1. a parasitic character in the input buffer. Which creates those strange errors "Uncaught SyntaxError: Got ?[255] expected EOF"
    2. I have to check UART6 and more details on I/O.

    Just a complement about Nucleo boards:
    A- port A: the ST-LINK/V2-1 is using some of its pins to debug and program as mbed needs it.

    1. PA2 and PA3 are the USART2 console TX/RX.
    2. "PA13 and PA14 share with SWD signals connected to ST-LINK/V2-1, it is not recommend to
      use them as IO pins if ST-LINK part is not cut."

    B- power supplied from USB port: there is the negotiation between the host and the Nucleo that happens at boot time. If there is no agreement from the host, the Nucleo will only use 100 mA from the USB port. This happens when the Nucleo is powered from an USB power supply. The jumper JP1 determines that (manual UM1724 page 17/54). This could also be a trap when more power is required at boot time or later.

    C- various default solder bridges change a lot of details around the pins potential usage.

    Again thank you for supporting an "unofficial board".

About

Avatar for asez73 @asez73 started