-
I have not been able to get MicroPython working on my Adafruit Trinket M0. It uses a SAMD21E18A part (different to the SEEED Xiao's SAMD21G18A). I can compile and program my SEEED Xiao with no problems using the firmware.uf2 file. However after compiling the Trinket board and programing it with the UF2 file I just see error messages in dmesg. My end goal is to create a new set of board files for the Adafruit QT PY, as I have more of those boards. I am not using the Xiao UF2 on the Trinket board.. I am using the UF2 file in it's board directory. Adafruit Trinket M0 does not have a hardware crystal oscillator... it should be configured for an on-die oscillator... I am not sure if that is missing from the mpconfigboard.h file. I am using this command in the micropython/ports/samd directory: I upgraded my Trinket UF2 boot loader to the latest version V3.7.0 from the Adafruit webpage and then tried to program the part with the created firmware.uf2 file. It appears to program, but I get the following error messages in dmesg.
I can program different UF2 files which were created with the starting address 0x2000 (which is the same for MicroPython's firmware.uf2 file). I believe the boot loader is working properly. Here is the output from the MicroPython compilation:
I am confident that my Trinket board is working properly as I can get other UF2 files programmed and they properly use the USB port. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Yep, ADAFRUIT_TRINKET_M0 mpconfigboard.h file was missing: This also fixed my Adafruit QT PY board (in development). |
Beta Was this translation helpful? Give feedback.
-
Thank you for the analysis. The behavior is unexpected. Clearly the line setting MICROPY_HW_DFLL_USB_SYNC is missing, but the board should start without that, especially for situations where the board is not conneceted to USB. I have to dig into the clock configuration again. |
Beta Was this translation helpful? Give feedback.
-
It appears that the recent support for Python coded USB drivers affects the clock generation on SAMD board without a crystal. These try to use the USB SOF signal as reference. But if after a while not USB connection is established, it falls back to an internal clock reference. This is as well the state when MICROPY_HW_DFLL_USB_SYNC is not set. It turns out that on SAMD21 board the clock is then far off the proper value, and USB fails. |
Beta Was this translation helpful? Give feedback.
Yep, ADAFRUIT_TRINKET_M0 mpconfigboard.h file was missing:
#define MICROPY_HW_DFLL_USB_SYNC (1)
This also fixed my Adafruit QT PY board (in development).