I'm asking the question this time because I originally thought I'd found a bug in uPython and create
a post in their forum. You will need to look there for the details but the net is that Thonny 4.0.1 seems to incorrectly report the error on BOOT.PY when the actual error is in BOOT_X_PARAMS.PY to import levels down.
In Thonny when I run BOOT.PY the reported in the SHELL is
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
ImportError: can't import name boot_x
>>>
The problem is with boot_x as shown below.
When using the uPython utility mpremote the results from a soft_reset are:
$ mpremote
Connected to MicroPython at /dev/ttyACM0
Use Ctrl-] or Ctrl-x to exit this shell
>>> import machine
>>> machine.soft_reset()
MPY: soft reboot
Traceback (most recent call last):
File "boot.py", line 3, in <module>
File "boot_x.py", line 3, in <module>
File "boot_x_params.py", line 4, in <module>
NameError: name 'params' isn't defined
MicroPython 699477d on 2023-01-16; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
Now, when I run the above mpremote steps in the shell window of Thonny I get the same results so the problem only seems to occur running the program from the IDE window
MicroPython 699477d on 2023-01-16; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
>>> import machine
>>> machine.soft_reset()
MPY: soft reboot
Traceback (most recent call last):
File "boot.py", line 3, in <module>
File "boot_x.py", line 3, in <module>
File "boot_x_params.py", line 4, in <module>
NameError: name 'params' isn't defined
>>>
So am I doing something wrong running from the Thonny IDE?