Creating new port / Adapting port

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
User avatar
dbrazil
Posts: 14
Joined: Mon Apr 26, 2021 5:52 pm

Creating new port / Adapting port

Post by dbrazil » Sat Sep 25, 2021 7:33 pm

Hi guys,

There's a devkit microcontroller that I would like to use, however it's not yet available as a port of MicroPython.

The devkit is made by Adafruit, so it has CircuitPython compatibility. The microcontroller is the ATSAME51 from Atmel.

What's the best strategy here, try to port the CircuitPython to MicroPython, or just create a port for the device itself?
Where do I start with this?

Thanks!

Links:
https://github.com/adafruit/circuitpyth ... her_m4_can
https://www.adafruit.com/product/4759

ericwertz
Posts: 3
Joined: Sat Jan 13, 2018 11:58 pm

Re: Creating new port / Adapting port

Post by ericwertz » Sun May 15, 2022 12:09 am

You didn't specify which M4 product of Adafruit that you're referring to, but I see that there's now a nightly build for the ItsyBitsy M4 on the Downloads page. Given that that's been done, it would seem to be relatively easy to tailor the port descriptor for the Feather M4 and build similar images, assuming that you're interested and able to do the same.

It's not clear to me how different the build systems are between MP and CP, but there might be some latent help living in the Adafruit build tree for "your" M4.

regards and good luck,
-e

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Creating new port / Adapting port

Post by Roberthh » Sun May 15, 2022 6:29 am

CircuitPython cannot be ported to MicroPython, because CircuitPython used the MicroPyhton core and adds it's own I/O layers. That means, you can use CircuitPython for your needs, if there is an existing port for the board. Besides that, it is quite easy to add board files to MicroPython. The file structure in the respective board files is pretty obvious. And I simplified it even with my port changes. The only file that require extensions is pins.c. All other files just have to reflect the different product name. For a first compile, build & run exercise, you can use the ITSYBITSYM4 board. That should give you a working firmware with REPL.

Only the MicroPython port for SAMD devices is pretty basic at the moment. I'm working at extending it since a few weeks, but the PR is dangling around without being reviewed (see viewtopic.php?f=12&t=7965&p=67357#p67357)

Post Reply