asm_pio error when working in Thonny - Shell

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
User avatar
Barbabenno
Posts: 2
Joined: Fri Mar 19, 2021 7:45 pm

asm_pio error when working in Thonny - Shell

Post by Barbabenno » Sat Mar 20, 2021 9:20 am

I don't know if this is the right place to report this behaviour, and I also don't know if this behaviour is incorrect, but if I don't report it, it could not be fixed. ;-)
I am trying the example in the 'Get started with MicroPython on Raspberry Pi Pico' book.
When I create a program in a file, it seems to work. But if I start it using the shell, I get an error.

Code:

Code: Select all

from rp2 import PIO, StateMachine, asm_pio

@asm_pio(set_init=PIO.OUT_LOW)
def led_quarter_brightness():
    set(pins, 0) [2]
    set(pins, 1)
Error message:

Code: Select all

Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "rp2.py", line 254, in dec
File "<stdin>", line 7, in led_quarter_brightness
NameError: name '__thonny_helper' isn't defined

Software:
  • MicroPython v1.14 on 2021-03-19; Raspberry Pi Pico with RP2040
  • Thonny 3.3.6
Would it be possible to work with the @asm_pio when using the Shell?
Last edited by Barbabenno on Mon Mar 22, 2021 5:59 pm, edited 1 time in total.

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: asm_pio error when working in Thonny - Shell

Post by aivarannamaa » Sun Mar 21, 2021 6:56 am

It looks like Thonny's bug. Please report it at https://github.com/thonny/thonny/issues/new and let's continue our discussion there. Also, please tell your OS, whether you are able to run some other programs and whether you can evaluate expressions in the Shell.
Aivar Annamaa
https://thonny.org

User avatar
Barbabenno
Posts: 2
Joined: Fri Mar 19, 2021 7:45 pm

Re: asm_pio error when working in Thonny - Shell

Post by Barbabenno » Sun Mar 21, 2021 6:34 pm

Thanks for the info.
I submitted an issue with Thonny: https://github.com/thonny/thonny/issues/1718

Post Reply