How do I reset the pico?

Posted on
  • As the subject says. I think I messed up a save.

  • Also, the troubleshooting guide doesnt cover the Pico at all.

  • I worked it out, for reference: Plug the board in while holding the button so the two lights flash on and off, then use the web ide to reflash the device.

  • Thanks - I'll update the troubleshooting to cover both....

    It's basically the same, but instead of hitting the reset button you have to plug/unplug it.

    You can also reset without reflashing - you have to plug in and then press BTN1 almost immediately after it's plugged in - then you don't go into the bootloader, but your saved code isn't loaded either.

  • Interesting... may be it is out there somewhere how what the boot sequence for standard and Pico are... but it looks like that something more like a Datasheet with the essentials has to be composed from what is already out there. It would then also include a section about what is different between the two boars. Before, it was a bit easier, it was the Espruino board and all others. Now it is the two Espruino standard and pico board and the others... I know it is work and even though I did some technical writing for some time, it is really not a enjoyable strength of mine. :(

  • Hi,

    I got the same problem than Pawl i think.
    I tried to "Plug the board in while holding the button so the two lights flash on and off" but the two lights do not flash off ... Any idea ?

    Thanks, nicolas.

  • Hi Nicolas,

    Do the two lights stay on? That happens when the board has entered bootloader mode but the PC hasn't managed to make a USB connection to it

    In the case I'd try restarting your computer (maybe somehow it got confused), and then check to see if under 'Device Manager' (if in windows) you have any errors. It may be it's complaining about the driver not being installed.

    If you're using a USB extension lead it may also be that the extension lead is a bit flaky.

  • Thanks Gordon,

    I'm on OS X Yosemite, but i just restart my system, update it and my pico was detected :D
    Strange stuff. I'll post here if i get this kind of troubles again.

  • Is any chance to reset it other way?
    My Pico stock 3rd time I uploaded the code, before I unsoldered other parts and fixed it,
    now I realized that it must be something different than my quality soldering as I uploaded code over 20 times with no problem, I didn't change nothing in hardware and now Pico stoped.
    I have soldered there 3.7lion battery already, don't want to unsolder it 4th time.
    Is any way to reset Pico by hardware (this way with push button not working)?
    Or I have to wait till battery will be empty enough to stop Pico?

  • I've just unsolder the battery but still can't reset or flash Pico, no com port visible
    ...after a while
    com port is visible,
    I don't understand what happen?
    I didn't change nothing in hardware, what might be wrong,
    I am afraid about reliability of it, as when I use it for some project,
    solder the battery, add some programming connection don't want
    to take it apart but just program it.
    Any advice how to make Pico stable?
    ...again
    same story, no com port visible,
    It is really very hard to finish programming with this effort

  • Have you turned on deep sleep? That can make it more difficult to get a connection - best bet is to make sure you have a setWatch on a button that'll make it wake up.

    There's the strip of pads on the back, by the GND VCC 3.3V markings. The pad 2nd from the end (by the 3.3v marking is nRESET, and you can short that to GND to get a reset)

  • This is the code I use when Espruino stop working.
    There is some error as console log after first "wake up" print console value twice, then every next wake up it increase the number of console.log prints

    
    function OLED(){
    pinMode(A7,'output'); //A7 Mosfet Gate PIN for OLED
    digitalWrite(A7,1);
    
    I2C1.setup({scl:B6,sda:B7});
    var g = require("SSD1306").connect(I2C1);
    g.clear();
      g.flip();
      
    pinMode(B14, 'input_pulldown');
    pinMode(B15, 'input_pulldown');
    
    //variables
    var BTN22 = B15;
    var BTN11 = B14;
    var screen = 0;
    var battery = analogRead(A0)*2*3.3;
    var i = true;
    
    function screens(){
      g.clear();
      g.setFontVector(15);
      g.drawString("MOTOR ON",20,20);g.flip();
    }
    
    function screens2(){
     g.clear();
     g.setFontVector(15);
     g.drawString("OLED OFF?");g.flip();
    }
    
    function screens3(){
     g.clear();
     g.setFontVector(20);
     g.drawString("" + battery.toFixed(2));
     g.flip();
    }
    
      
    setWatch(function(e) {
      if(screen === 0) screens();
      if(screen === 1) screens2();
      if(screen === 2) screens3();
        screen++;
        console.log(screen);  
      if(screen > 2) screen = 0;
    },BTN22, {repeat: true, edge: 'rising', debounce:150});
    
      
    setWatch(function(e) {
       i = !i;
     if(screen === 0) OLED();
     if(screen === 2) digitalWrite(A7,i); screen =0;
       console.log(screen);  
    },BTN11, {repeat: true, edge: 'rising', debounce:150});
    
      screens();
    }
    OLED();
    

    about reset
    do you mean about this pin?


    1 Attachment

    • Pico_diagram_Reset_pin.png
  • Yes, that's the reset pin...

    There is some error as console log after first "wake up" print console value twice, then every next wake up it increase the number of console.log prints

    I don't understand I'm afraid - can you post an example of what it prints?

  • it just prints 'screen' value in console,
    values are from 0 up to 2,
    those values correspond to details I see on the OLED display (from functions screens(), screens2() and screens3()

    If (screen === 2) and I press BTN11 then my OLED is switched off by disconnecting the VCC line, when I press BTN11 again VCC line is again connected into display and OLED() function starts. The same time I have console.log with value of 'screen'.
    When I do this sequence (screen ===2) and BTN11 press again, every time I see more console.logs in WebIDE console window, and program start to slow down, wait for all logs and then react for my button presses, after a while it stock

  • It's because you keep calling the function OLED(), which calls setWatch repeatedly.

    Each time you call setWatch it will add one more function to be called when the button is pressed, instead of replacing the last.

    Put clearWatch() right at the top of the OLED function and that should fix it - but there are probably better ways of writing your code so you don't need to do that.

    If you have some problem like this in future, please can you start a new thread for it? This is really totally unrelated to the initial post, where Pawl was wondering how to recover after he'd saved some code that he didn't want.

  • thank you, now it works, no lags,
    I'll start new posts in similar case again

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

How do I reset the pico?

Posted by Avatar for Pawl @Pawl

Actions