Short-bus / pilomar

RaspberryPi based miniature observatory

Home Page:https://shortbus.blog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues related to CircuitPython 8.x installation on Tiny2040

Short-bus opened this issue · comments

Current recommendation is CircuitPython 7.2.0 installation.
Later versions have not been validated.
When trying to run CircuitPython 8.x some items appeared.

  • The busio.UART.read(1) method nolonger works. It fails because the nbytes parameter is not specifically named. busio.UART.read(nbytes=1) may solve this. It needs testing. I found a reference online that the underlying MicroPython and libraries changed sometime after 7.2.0 and now requires some busio.UART parameters to be named.
  • The error messages from the uarthost class can be standardised in line with the rest of the programs. Making the source of errors more clear.
  • At boot the boot_out.txt file could be passed back to the RPi to aid with problem solving. That will show what type and version of python is installed on the microcontroller.
  • Also noticed that the recommended CircuitPython uf2 filename in the archive is now different from the original documentation, the file and date appear to be the same, but the filename has subtly changed. Update the instructions.

Tested busio.UART.read(nbytes=1) on circuitpython 7.2.0, this generates an error. So have not futureproofed the function call yet.
Have left a comment in the code instead to warn that the busio.UART.read() call must change depending upon the circuitpython version.

Also changed the initialization color on the microcontroller from PINK 5 seconds, to CYAN 3 seconds. PINK is too close to the RED error color and it does not need to be displayed for very long.

circuitpython/code.py in the 2024-01-issues branch now successfully runs on the latest CircuitPython stable release for the Tiny2040.
Adafruit CircuitPython 8.2.10 on 2024-02-14; Pimoroni Tiny 2040 (8MB) with rp2040
The busio.UART.read(nbytes=1) error was misleading, the fault was elsewhere.
The program now uses a slightly different method to initialize the UART comms and to perform the read.
For CircuitPython7.2 the old code remains in use to reduce the risk of disturbing existing installations. The program chooses which solution to use at launch depending upon the CircuitPython version identified in the boot_out.txt file. Any version BEFORE 8.0 uses the original solution. Any version from 8.0 onwards uses the new solution.

Done.