Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Official MicroPython port, and also a CircuitPython port?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Official MicroPython port, and also a CircuitPython port?

by LCDIntegrator on Wed Mar 10, 2021 1:02 pm

SparkFun seems to differ in supporting MicroPython but you describe things as "CircuitPython/MicroPython code storage". So your product does support MicroPython despite your main focus being on CircuitPython?

At the time of launch, there is no Arduino core support for this board. There is great C/C++ support, an official MicroPython port, and a CircuitPython port!

So the CircuitPython version that Adafruit works on is unofficial? Simply because they are not Raspberry Pi or for other reasons? Why doesn't SparkFun seem to support CircuitPython at all? They say "The RP2040 is supported with both C/C++ and MicroPython cross-platform development environments" but do not mention anything about CircuitPython in their main product description and in their Features tab, it only says [s]upported programming languages are MicroPython and C/C++ and that's it, except it also technically supports a very limited amount of assembly as well.

So there is an official MicroPython but the CircuitPuthon is more secondary, despite it being an Adafruit item? Not quite following yet and even more confused with the documentation (product description) provided on the Feather RP2040 product page.

Also, seriously, why were you intending to go with 4 MB of memory for the Feather RP2040 to begin with and only swapped to 8 MB when the 4 MB wasn't working? SparkFun is going with 16 MB. $12 vs $16? Can't be that big of a difference here.

LCDIntegrator
 
Posts: 55
Joined: Sat Sep 27, 2014 1:23 am

Re: Official MicroPython port, and also a CircuitPython port

by dastels on Wed Mar 10, 2021 1:55 pm

CircuitPython is a fork of MicroPython: the bulk of the language and runtime is identical.The CircuitPython extensions have mostly to do with hardware support and ease of use features.

Adafruit has ported CircuitPython to the RP2040. I am assuming that "official" just means "endorsed by Raspberry Pi".

CircuitPython is an Adafruit endeavor, so there's no reason for Sparkfun to support it... they have their own projects.

Sparkfun's Feather format board has components on both sides, which I assume can only be more expensive to make as does the bigger flash chip. Hence it sells at a higher price. Every company makes it's decisions and tradeoffs when designing products, for their own reasons.

Dave

dastels
 
Posts: 6129
Joined: Tue Oct 20, 2015 3:22 pm

Re: Official MicroPython port, and also a CircuitPython port

by LCDIntegrator on Wed Mar 10, 2021 5:03 pm

Regarding the more complicated version of SparkFun's premium version of their new RP2040 product, we know. Just see the Feather RP2040 as what appeared to be the highest from a hardware perspective in terms of potential options that Adafruit is currently offering and it cut corners is all there, at least compared to some of the other competitive products out there. To a degree, Arduino is doing something equally odd which is only sell their $100 version and nothing lower end. Just seems a bit odd is all.

That makes sense at least about the CircuitPython vs MicroPython. We assumed they were more or less the same. Not quite clear how easy it is to migrate Python code over to them yet. Mostly been doing C/C++ and maybe some Assembly as a preference. Sort of waiting for Arduino to finish releasing their new not beta version of their new IDE and also join up RP2040 ability as well but it's certainly taking them a while to do so is all and even their beta release does not include any RP2040 support either. Despite releasing a beta of their new software and talking about how they were going to support it back in January and nothing has been talked about since nor been included is the slightly odd part there.

https://forum.arduino.cc/index.php?topic=730193.0

LCDIntegrator
 
Posts: 55
Joined: Sat Sep 27, 2014 1:23 am

Re: Official MicroPython port, and also a CircuitPython port

by tannewt on Wed Mar 10, 2021 9:55 pm

LCDIntegrator wrote:SparkFun seems to differ in supporting MicroPython but you describe things as "CircuitPython/MicroPython code storage". So your product does support MicroPython despite your main focus being on CircuitPython?

At the time of launch, there is no Arduino core support for this board. There is great C/C++ support, an official MicroPython port, and a CircuitPython port!


MicroPython will run but they've only released support for the Pico board. So, the flash will be treated as 2mb instead of 8mb. I have an open issue for this here: https://github.com/micropython/micropython/issues/6987

LCDIntegrator wrote:So the CircuitPython version that Adafruit works on is unofficial? Simply because they are not Raspberry Pi or for other reasons?


Ya, in this case "official" means Raspberry Pi supported. They funded the MicroPython work for the Pico and support it through their forum.

If you'd like them to consider CircuitPython "official" please let them know. We're officially supporting it so it should be simple.

LCDIntegrator wrote:Why doesn't SparkFun seem to support CircuitPython at all? They say "The RP2040 is supported with both C/C++ and MicroPython cross-platform development environments" but do not mention anything about CircuitPython in their main product description and in their Features tab, it only says [s]upported programming languages are MicroPython and C/C++ and that's it, except it also technically supports a very limited amount of assembly as well.


This is a question for SparkFun. I've encouraged them to add board definitions for their RP2040 boards to CircuitPython but they are currently busy with other things. They did allocate USB PIDs for them running CircuitPython so others could do the definition too. (Tracking here: https://github.com/adafruit/circuitpython/issues/4042 )

LCDIntegrator wrote:So there is an official MicroPython but the CircuitPuthon is more secondary, despite it being an Adafruit item? Not quite following yet and even more confused with the documentation (product description) provided on the Feather RP2040 product page.


We recommend using CircuitPython on all of our RP2040 boards. It is *Adafruit* officially supported even if it isn't by the Raspberry Pi folks.

LCDIntegrator wrote:Also, seriously, why were you intending to go with 4 MB of memory for the Feather RP2040 to begin with and only swapped to 8 MB when the 4 MB wasn't working? SparkFun is going with 16 MB. $12 vs $16? Can't be that big of a difference here.


Ya, cost adds up. It's all a trade-off as dastels says.

LCDIntegrator wrote:Regarding the more complicated version of SparkFun's premium version of their new RP2040 product, we know. Just see the Feather RP2040 as what appeared to be the highest from a hardware perspective in terms of potential options that Adafruit is currently offering and it cut corners is all there, at least compared to some of the other competitive products out there. To a degree, Arduino is doing something equally odd which is only sell their $100 version and nothing lower end. Just seems a bit odd is all.


Having options is good. :-) If you want to use boards from other manufacturers with CircuitPython we'd love to see pull requests adding support. A tutorial for that is here: https://learn.adafruit.com/how-to-add-a ... cuitpython

LCDIntegrator wrote:That makes sense at least about the CircuitPython vs MicroPython. We assumed they were more or less the same. Not quite clear how easy it is to migrate Python code over to them yet. Mostly been doing C/C++ and maybe some Assembly as a preference.


While they both are the Python language, they are quite different. CircuitPython has a simpler workflow (it shows up as a USB drive rather than needing a host-side app) and uniform hardware API across all ports. The CP hardware API has allowed us to write 300+ libraries that work across different CP ports and single board computers via the Blinka Python library.

We recommend starting with CircuitPython.

LCDIntegrator wrote:Sort of waiting for Arduino to finish releasing their new not beta version of their new IDE and also join up RP2040 ability as well but it's certainly taking them a while to do so is all and even their beta release does not include any RP2040 support either. Despite releasing a beta of their new software and talking about how they were going to support it back in January and nothing has been talked about since nor been included is the slightly odd part there.

https://forum.arduino.cc/index.php?topic=730193.0


This is a question for Arduino. Us at Adafruit are only working on CircuitPython support for the RP2040.

tannewt
 
Posts: 2393
Joined: Thu Oct 06, 2016 8:48 pm

Re: Official MicroPython port, and also a CircuitPython port

by westfw on Wed Mar 10, 2021 10:35 pm

RP2040 is an interesting case.
It's not often that a chip vendor (Raspberry Pi, in this case) sell a chip with "language/environment" support for something as complex as microPython.

There are other weird things about the Pico infrastructure. While the documentation is excellent, overall, it sort-of looks like RPi hadn't been paying much attention to the "microcontroller scale" "prior art." It's got a weird SDK, build environment, and source layout; doesn't use the standard ARM CMSIS files where it can, and some other oddities.

westfw
 
Posts: 1774
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Official MicroPython port, and also a CircuitPython port

by LCDIntegrator on Wed Mar 10, 2021 11:20 pm

tannewt wrote:MicroPython will run but they've only released support for the Pico board. So, the flash will be treated as 2mb instead of 8mb. I have an open issue for this here: https://github.com/micropython/micropython/issues/6987


Thank you for that. I was sort of thinking that would not be an issue to begin with but there are literally 930+ issues for on Micropython at the moment and we bought several of these so we sort of want more than 2 MB of memory that is part of the hardware to, well, work. Should at some point but we also would ideally want Arduino IDE to work too so we can migrate the dozens of already written code over to it but that's a separate issue. Assuming that CircuitPython does not have the same issue?

tannewt wrote:This is a question for SparkFun. I've encouraged them to add board definitions for their RP2040 boards to CircuitPython but they are currently busy with other things. They did allocate USB PIDs for them running CircuitPython so others could do the definition too. (Tracking here: https://github.com/adafruit/circuitpython/issues/4042)


We asked SparkFun. Talking with them is challenging. They literally do not answer their phones right now. They rarely seem to post to the forums. I was able to finally hear back via email recently that took a while and after posting and not getting much of a response other than "don't ask more than a question or two" even when it is regarding cutting edge RP2040 items that there is only so much we can answer on our own. Hopefully they add the board definitions but I do get how they are sort of oddly competitive but also collaborative as well.

tannewt wrote:We recommend using CircuitPython on all of our RP2040 boards. It is *Adafruit* officially supported even if it isn't by the Raspberry Pi folks.

Ok, will do.

tannewt wrote:Ya, cost adds up. It's all a trade-off as dastels says.

We figured but would also be willing to pay more for the one premium product. Yes, it is a microcontroller but honestly we buy more of the MEGA 2560 side than the Chinese knockoff Arduino products although in the grand scheme of things it would be nice for Arduino to be a bit more reasonable price wise moving forward is all.

tannewt wrote:Having options is good. :-) If you want to use boards from other manufacturers with CircuitPython we'd love to see pull requests adding support. A tutorial for that is here: https://learn.adafruit.com/how-to-add-a ... cuitpython


Sounds good. We are sort of oddly using both SparkFun and Adafruit hardware here during initial testing plus some official RP2040 as well. Nice to see both CircuitPython and MicroPython but just trying to find one and stick to it rather than them start to diverge enough. Or maybe we stick with C/C++ and move to some of the limited Assembly? Do see the Python type at least being a bit easier to work with although honestly some code access would work faster and more broadly with a better version of something like Scratch 3.0 but with the means of being a bit more robust as well if that makes sense. Maybe something longer term but not everyone does hardware and software and programming and development and marketing and so on all together and things like Stemma QT / Qwiic already helps the testing and development process a fair amount.

tannewt wrote:We recommend starting with CircuitPython.

Makes more sense now, thank you for the clarification. Still think Circuitpython has a better logo / character anyway.

tannewt wrote:This is a question for Arduino. Us at Adafruit are only working on CircuitPython support for the RP2040.

Got it. Arduino isn't exactly giving much detail at all about RP2040 at the moment unfortunately.
https://forum.arduino.cc/index.php?topic=730193.0

No new news on the Arduino support for the RP2040 and Pico that I'm aware of since the announcement blog post. There is full support for Arduino boards platforms on both the classic and 2.0 Arduino IDE, as well as Arduino CLI, so as soon as Arduino releases it, it will be supported on all three.


Hopefully they will finish the beta IDE launch and then include support then? No idea why there is no support inside the beta though. Arduino's only current approach seems to be prepare their $100 RP2040 chip so we will have to see since we have used their items for years but are ready to move forward with something as it is starting to show it's age in a number of ways.

LCDIntegrator
 
Posts: 55
Joined: Sat Sep 27, 2014 1:23 am

Re: Official MicroPython port, and also a CircuitPython port

by LCDIntegrator on Thu Mar 11, 2021 12:43 am

Might be worth pointing out that https://core-electronics.com.au/tutoria ... ences.html is pretty helpful as well as https://circuitpython.readthedocs.io/en ... icropython.

Though documentation about the RP2040 is a bit missing some in the above links. https://learn.adafruit.com/adafruit-fea ... cuitpython does seem to go into it a fair bit at least.

Probably also worth pointing out the CircuitPython PIO documentation as well. https://learn.adafruit.com/intro-to-rp2 ... cuitpython

LCDIntegrator
 
Posts: 55
Joined: Sat Sep 27, 2014 1:23 am

Re: Official MicroPython port, and also a CircuitPython port

by tannewt on Thu Mar 11, 2021 12:59 pm

westfw wrote:There are other weird things about the Pico infrastructure. While the documentation is excellent, overall, it sort-of looks like RPi hadn't been paying much attention to the "microcontroller scale" "prior art." It's got a weird SDK, build environment, and source layout; doesn't use the standard ARM CMSIS files where it can, and some other oddities.


This all depends on where you are coming from and your thought that it is "normal". I find many vendor HALs weird.

I did find lack of CMSIS weird too but I suspect it's because the device is dual core. So, if you could do direct interrupt handling for instance, then you could get errors when both cores try to service it.

LCDIntegrator wrote:Thank you for that. I was sort of thinking that would not be an issue to begin with but there are literally 930+ issues for on Micropython at the moment and we bought several of these so we sort of want more than 2 MB of memory that is part of the hardware to, well, work. Should at some point but we also would ideally want Arduino IDE to work too so we can migrate the dozens of already written code over to it but that's a separate issue. Assuming that CircuitPython does not have the same issue?


CircuitPython already has separate board definitions for the RP2040 and a stop gap for different flash sizes. It doesn't have ideally settings for different flash chips yet though. I'm actively working on that. Boards are defined here: https://github.com/adafruit/circuitpyth ... ypi/boards

LCDIntegrator wrote:Hopefully they add the board definitions [...]

We don't need them to add them. Since they are open source, someone from the CircuitPython community can add them instead. They were nice enough to allocate their USB PIDs for it. That is usually a blocker for board defs.

LCDIntegrator wrote:honestly some code access would work faster and more broadly with a better version of something like Scratch 3.0 but with the means of being a bit more robust as well if that makes sense. Maybe something longer term but not everyone does hardware and software and programming and development and marketing


Take a look at EDU Blocks. It is a block based editor with support for CircuitPython's APIs. https://edublocks.org/circuitpy.html

LCDIntegrator wrote:Hopefully they will finish the beta IDE launch and then include support then? No idea why there is no support inside the beta though. Arduino's only current approach seems to be prepare their $100 RP2040 chip so we will have to see since we have used their items for years but are ready to move forward with something as it is starting to show it's age in a number of ways.


This is why I'd recommend CircuitPython. We've been rapidly adding support for RP2040 and do it in a public way.

tannewt
 
Posts: 2393
Joined: Thu Oct 06, 2016 8:48 pm

Re: Official MicroPython port, and also a CircuitPython port

by LCDIntegrator on Wed Mar 17, 2021 11:30 pm

https://github.com/adafruit/circuitpyth ... ypi/boards

Is now showing SparkFun Thing Plus RP2040 and SparkFun Pro Micro RP2040. Any chance we will see their SparkFun MicroMod RP2040 Processor at some point?

SparkFun Thing Plus – RP2040 (SparkFun USB PID: 0x0025)
SparkFun MicroMod RP2040 Processor (SparkFun USB PID: 0x0024)
SparkFun Pro Micro – RP2040 (SparkFun USB PID: 0x0026)

LCDIntegrator
 
Posts: 55
Joined: Sat Sep 27, 2014 1:23 am

Re: Official MicroPython port, and also a CircuitPython port

by tannewt on Thu Mar 18, 2021 2:04 pm

We just need someone to add it! The other two were contributed by community members. Instructions for adding a board are here: https://learn.adafruit.com/how-to-add-a ... cuitpython

Here is a PR for adding the nrf52840 micromod. The one for the RP2040 should be pretty similar: https://github.com/adafruit/circuitpython/pull/4350

tannewt
 
Posts: 2393
Joined: Thu Oct 06, 2016 8:48 pm

Re: Official MicroPython port, and also a CircuitPython port

by LCDIntegrator on Thu Mar 18, 2021 2:56 pm

At least someone actually does it here. Compared to SparkFun whose updates to their MicroPython are not exactly as up to date as the CircuitPython. By quite a bit actually. There's literally 8 times as many authors at Adafruit. They changed 41 files in the last week. You changed 1,822 in the last week.

https://github.com/micropython/micropython/pulse

March 11, 2021 – March 18, 2021

Excluding merges, 3 authors have pushed 16 commits to master and 16 commits to all branches. On master, 41 files have changed and there have been 1,114 additions and 1,099 deletions.

Compared to Adafruit's CircuitPython:

https://github.com/adafruit/circuitpython/pulse

March 11, 2021 – March 18, 2021

Excluding merges, 24 authors have pushed 89 commits to main and 89 commits to all branches. On main, 1,822 files have changed and there have been 34,343 additions and 25,950 deletions.

Will look into it but probably not something we can do immediately. Still would need to pickup some of that specific hardware to do hardware testing on as well. Still waiting for the RP2040 to start to be a bit more widely available and not turn into the Pi Zero that is still low in stock 4 years after release!

LCDIntegrator
 
Posts: 55
Joined: Sat Sep 27, 2014 1:23 am

Re: Official MicroPython port, and also a CircuitPython port

by tannewt on Fri Mar 19, 2021 3:33 pm

Note that commit count isn't a very fair comparison because MicroPython does squashes more often than we do. (We do merges with potentially many commits.)

Some of the authors are also only translators so account for that as well.

tannewt
 
Posts: 2393
Joined: Thu Oct 06, 2016 8:48 pm

Re: Official MicroPython port, and also a CircuitPython port

by LCDIntegrator on Fri Mar 19, 2021 7:59 pm

I do understand it is a bit more large of a difference in some nuances. I just have habitually seen or been told about SparkFun basically not responding to emails sometimes at all or days later or even answer their phone. Or support some of the hardware they sell, among other things. Would not be surprised if they are not updating their MicroPython code as much as CircuitPython code is being updated given at least what we are seeing. Which isn't a bad thing, just an observation. Still want Adafruit to make a dual sided high end RP2040 product though. Also Adafruit sold well over $3,500 worth of RP2040 products today alone so nice job there and was only offering two per customer as well. Sheesh these things are getting popular!

LCDIntegrator
 
Posts: 55
Joined: Sat Sep 27, 2014 1:23 am

Please be positive and constructive with your questions and comments.


cron