Button press using setWatch causes reset

Posted on
  • Was trying to exercise a module by using a button press on my Olimex Gateway board. This board has a button, led, sd card, and Ethernet plug, a really nice board by the way. I digress, the button is connected to D34 but when I run the following code, it crashes and resets.

    igitalRead(D34);
    function buttonDown(){
      console.log("Hello");
    }
    setWatch(buttonDown,D34,{repeat:true, edge:'rising'});
    

    I have tried running this code with both espruino_1v92_esp32.bin and espruino_1v94.23_esp32.bin firmware and they both crash, although espruino_1v94.23_esp32.bin seems to handle it much better.

    I am including the core dump.

    All help is appreciated.


    1 Attachment

  • FYI, there is a "d" in front of "igitalRead", my mouse jumped.

  • Could you tell us what is the Olimex reference ? or give us the link to the schematic?

  • This is a known issue...

    https://github.com/espruino/Espruino/iss­ues/1176

    Using D0 - the inbuilt flash button, it does not crash straight away. I suspect a stsck issue, but so far increasing the stsck size has had no effect..

  • We could throw an exception if you try and watch D0 for now? it'd be easy, and might save people some trouble!

  • It fails on all pins after a while. It used to work, but it seems that recent timer changes might have effected the Irq handling on gpios. We have a similar crash with pin pulse too...

    All a work in progress.. @JumJum and I are the only ones looking at this - and this is in our spare time.

  • Yes, totally. What you two have done so far is awesome :)

  • @Wilberforce, you da man. Thank you for any and all help

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

Button press using setWatch causes reset

Posted by Avatar for miCatotonic @miCatotonic

Actions