SAMD51J19 Port

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
bradstew
Posts: 41
Joined: Thu Nov 29, 2018 9:29 pm

SAMD51J19 Port

Post by bradstew » Sun Nov 08, 2020 6:51 pm

Hi,
I've been a user of uPython for a while using the STM32F405. It's a fantastic language and have used it in several industrial applications.
I've also been evaluating several of the Adafruit boards such as the Metro M4 Express using CircuitPython. Not as impressed.

The issue I have with CircuitPython is that it seems it's a language for makers and beginners and not for serious industrial use. It lacks important feature such as interrupts, asynchio, in-line assembly, and other details. Also, the code between the two systems is different enough to make life difficult. For example to output a dac value is "dac.write(val)" in uPython, and "dac.write = val" in Circuit Python. So the code is not portable. It appears that uPython is more adherent to real Python.

I noticed there is a minimal port of the SAMD51 of in the git repo. Looking at it it seems it's for the 48 pin version and not the 64 pin. But it seems that the conversion is not too difficult.
Also, Circuit Python uses a special bootloader that uses UF2 format rather than BIN, DFU, or hex.

So I have some questions.
1. Are there any instructions on building and deploying uPyhon for any of the SAMD parts (D21 or D51)? Is the build process the same as with the STM32?
2. Can you use the UF2 bootloader or is a JTAG probe required?
3. What are the major differences in the SAMD version compared to the STM32 version?
4. Any links to actual usage or reviews of SAMD running uPython?

Cheeers,

Brad Stewart

bradstew
Posts: 41
Joined: Thu Nov 29, 2018 9:29 pm

Re: SAMD51J19 Port

Post by bradstew » Sun Nov 08, 2020 7:26 pm

Want to add that the reason I want to move to the SAMD51 is it's about 1/2 the cost of the STM32 and it's wildly popular. I'm using them now with embedded C.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: SAMD51J19 Port

Post by jimmo » Mon Nov 09, 2020 7:11 am

I would love to see more work done on this port but sadly it's extremely very bare bones. The idea was to do the "hard" bit (i.e. get it to boot) and then hopefully people would be able to contribute the various drivers and Python APIs but this hasn't happened yet...
bradstew wrote:
Sun Nov 08, 2020 6:51 pm
So I have some questions.
1. Are there any instructions on building and deploying uPyhon for any of the SAMD parts (D21 or D51)? Is the build process the same as with the STM32?
It's very similar to STM32 -- make mpy-cross, then make BOARD=
bradstew wrote:
Sun Nov 08, 2020 6:51 pm
2. Can you use the UF2 bootloader or is a JTAG probe required?
Yes, the build will generate a uf2 file. Most of the board definitions currently provided are for adafruit boards, so this is convenient.
bradstew wrote:
Sun Nov 08, 2020 6:51 pm
3. What are the major differences in the SAMD version compared to the STM32 version?
Unfortunately the SAMD port is almost completely useless right now. It lacks even support for machine.Pin.

Really all that is supported is:
- USB CDC (i.e. REPL over USB)
- time.sleep

I'm pretty sure that not even a flash driver has been written for filesystem support.
bradstew wrote:
Sun Nov 08, 2020 6:51 pm
4. Any links to actual usage or reviews of SAMD running uPython?
I doubt it :( Like I said, would love to see this (I have some SAMD-based devices myself that would love to run MicroPython on) but just haven't had time to work on it (and neither has Damien it seems).

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: SAMD51J19 Port

Post by pythoncoder » Mon Nov 09, 2020 11:46 am

bradstew wrote:
Sun Nov 08, 2020 6:51 pm
...The issue I have with CircuitPython is that it seems it's a language for makers and beginners and not for serious industrial use...
That, plus your detailed observations, is spot-on. It is designed for ease of use by beginners whereas MicroPython prioritises performance and CPython compatibility. This at the expense of requiring some expertise on the part of its users.
Peter Hinch
Index to my micropython libraries.

Post Reply