• Re: Pico - issue with interrupts and sleep??

    From Mike Scott@3:770/3 to David Taylor on Wed Aug 16 18:44:17 2023
    On 14/08/2023 15:56, David Taylor wrote:
    On 14/08/2023 14:12, Mike Scott wrote:
    I have now.

    I was running rp2-pico-w-20230422-unstable-v1.19.1-1019-g9e6885ad8.uf2
    which I've replaced with rp2-pico-20230426-v1.20.0.uf2 which seems to be
    the latest for the plain pico.

    That fails as well.

    Likewise rp2-pico-w-20230426-v1.20.0.uf2 (the latest picoW) fails.


    Is there anywhere to report this sort of bug? I'm hoping it's a
    micropython software issue, not a board fault.

    I have these:

      pimoroni-picow-v1.20.3-micropython.uf2
      pimoroni-pico-v1.20.3-micropython.uf2

    ...
    Thanks for the info.

    I've now tried pimoroni-picow-v1.20.4-micropython - that's worse than
    ever, crashing much sooner for the problem range. (I notice the file is significantly larger than 1.19.1 or 1.20.0)

    On the bright side, it does suggest the issue is in the micropython
    rather than being a chip problem.

    I've found the following; the number indicates the number of loops of my
    test rig recorded either at failure or when my patience ran out.
    # these times for firmware 1.19.0 or 1.20.0 (mixed)
    # no dlay good to 138200
    # 1 us good to 188000
    # 5 us good to 395200
    # 7 us good to 335146
    # 10 us fails 14410
    # 15 us fail 14010
    # 20 us fails 26600
    # 30 fails 261893
    # 32 fails 42430
    # 35 us good to 421110
    # 40 us good to 378478
    # 50 good to 572000
    # 100 us good to 372000

    There really does seem to be a window when sleeping from just under 10
    to just under 35 us where interrupts seem to fail eventually.

    Weird.

    I'll see if I can get to grips with the github bug reporting.

    --
    Mike Scott
    Harlow, England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Mike Scott@3:770/3 to Mike Scott on Thu Aug 17 14:34:42 2023
    On 16/08/2023 18:44, Mike Scott wrote:
    ....
    There really does seem to be a window when sleeping from just under 10
    to just under 35 us where interrupts seem to fail eventually.

    Weird.

    What's more, it only seems to affect the picoW.

    I've tried two W's now, and one without the wifi.

    Both W's fail the same way; I've not seen the plain one fail.

    Can anyone replicate this please?



    I'll see if I can get to grips with the github bug reporting.

    --
    Mike Scott
    Harlow, England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From David Taylor@3:770/3 to Mike Scott on Thu Aug 17 19:19:42 2023
    On 17/08/2023 14:34, Mike Scott wrote:
    On 16/08/2023 18:44, Mike Scott wrote:
    ....
    There really does seem to be a window when sleeping from just under 10
    to just under 35 us where interrupts seem to fail eventually.

    Weird.

    What's more, it only seems to affect the picoW.

    I've tried two W's now, and one without the wifi.

    Both W's fail the same way; I've not seen the plain one fail.

    Can anyone replicate this please?



    I'll see if I can get to grips with the github bug reporting.


    Can you point to some test code, and brief instructions, please?
    --
    Cheers,
    David
    Web: https://www.satsignal.eu

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Mike Scott@3:770/3 to David Taylor on Fri Aug 18 09:12:49 2023
    On 17/08/2023 19:19, David Taylor wrote:
    On 17/08/2023 14:34, Mike Scott wrote:
    On 16/08/2023 18:44, Mike Scott wrote:
    ....
    There really does seem to be a window when sleeping from just under 10
    to just under 35 us where interrupts seem to fail eventually.

    Weird.

    What's more, it only seems to affect the picoW.

    I've tried two W's now, and one without the wifi.

    Both W's fail the same way; I've not seen the plain one fail.

    Can anyone replicate this please?



    I'll see if I can get to grips with the github bug reporting.


    Can you point to some test code, and brief instructions, please?

    Test code is two articles up-thread.

    I've also posted to the raspberry pi forum. Thread is at https://forums.raspberrypi.com/viewtopic.php?t=355111

    (which also includes the test code minus the python indents)

    with another's notes at
    https://forums.raspberrypi.com/viewtopic.php?t=312874
    (including his test rig)

    It seems a problem in micropython has been known about for a couple of
    years, but hasn't been fixed.

    For completeness though, I've tried again running the code on a plain
    pico. It did fail this morning, but ran for maybe 20x more interrupts
    than the picoW before hanging.

    Frankly, I'm saddened. So much promise. The board is great, but firmware
    that "usually works" is IMO broken and not to be trusted. So I guess
    it's the bin for micropython, and I'll have to see about a replacement, probably C++, SDK. Maybe more luck there.


    --
    Mike Scott
    Harlow, England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From David Taylor@3:770/3 to Mike Scott on Fri Aug 18 10:13:24 2023
    On 18/08/2023 09:12, Mike Scott wrote:
    Test code is two articles up-thread.

    I've also posted to the raspberry pi forum. Thread is at https://forums.raspberrypi.com/viewtopic.php?t=355111

    (which also includes the test code minus the python indents)

    with another's notes at
    https://forums.raspberrypi.com/viewtopic.php?t=312874
    (including his test rig)

    It seems a problem in micropython has been known about for a couple of
    years, but hasn't been fixed.

    For completeness though, I've tried again running the code on a plain
    pico. It did fail this morning, but ran for maybe 20x more interrupts
    than the picoW before hanging.

    Frankly, I'm saddened. So much promise. The board is great, but firmware
    that "usually works" is IMO broken and not to be trusted. So I guess
    it's the bin for micropython, and I'll have to see about a replacement, probably C++, SDK. Maybe more luck there.

    Downloaded and testing with firmware 1.20.4 from:

    https://github.com/pimoroni/pimoroni-pico/releases/tag/v1.20.4

    With a 15 us sleep delay, the program stopped running at 3902. LED continuously lit, no error message printed.

    Second run: 5203, LED dark. Device warmer, perhaps?

    Third run: 2601, LED dark.

    All these are near multiples of 1300, aren't they. Chance, or....

    Fourth run: 3601, LED lit, so not 1300!

    --
    Cheers,
    David
    Web: https://www.satsignal.eu

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to Mike Scott on Fri Aug 18 10:43:04 2023
    On 18/08/2023 09:12, Mike Scott wrote:
    On 17/08/2023 19:19, David Taylor wrote:
    On 17/08/2023 14:34, Mike Scott wrote:
    On 16/08/2023 18:44, Mike Scott wrote:
    ....
    There really does seem to be a window when sleeping from just under 10 >>>> to just under 35 us where interrupts seem to fail eventually.

    Weird.

    What's more, it only seems to affect the picoW.

    I've tried two W's now, and one without the wifi.

    Both W's fail the same way; I've not seen the plain one fail.

    Can anyone replicate this please?



    I'll see if I can get to grips with the github bug reporting.


    Can you point to some test code, and brief instructions, please?

    Test code is two articles up-thread.

    I've also posted to the raspberry pi forum. Thread is at https://forums.raspberrypi.com/viewtopic.php?t=355111

    (which also includes the test code minus the python indents)

    with another's notes at
    https://forums.raspberrypi.com/viewtopic.php?t=312874
    (including his test rig)

    It seems a problem in micropython has been known about for a couple of
    years, but hasn't been fixed.

    For completeness though, I've tried again running the code on a plain
    pico. It did fail this morning, but ran for maybe 20x more interrupts
    than the picoW before hanging.

    Frankly, I'm saddened. So much promise. The board is great, but firmware
    that "usually works" is IMO broken and not to be trusted. So I guess
    it's the bin for micropython, and I'll have to see about a replacement, probably C++, SDK. Maybe more luck there.



    You do eliminate at least one more layer of uncertainty with C, in that
    you can see (sic!) exactly what the assembler code is doing.
    I know from experience it is all to easy to write a bit of 'code that
    must not be interrupted' and not realise it needs to be surrounded by a
    pair of 'disable/enable interrupt' instructions...and it is just things
    like timers that get interrupted by timer interrupts that are likely to
    blow things up.



    --
    In a Time of Universal Deceit, Telling the Truth Is a Revolutionary Act.

    - George Orwell

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)