With much (social) media attention on the Raspberry Pi Zero this week I wonder if anyone has considered how challenging it would be to run micropython on the bare metal on one. The cost compared to a pyboard is a significant saving, and of course there are many standard "Pi" hats/accessories that will extend the capability quickly...

I love the idea behind the PyBoard but if I was looking to make several devices the costs would soon rack up... conceptually the Pi Zero serves a similar function - and if there was no "Linux OS" overhead it would be faster than needed for most applications too. Obviously if there was some sort of internet connection (hard or wifi) it would be a potentially huge IoT development platform.

Implementing MicoPython on a bare metal Raspberrey Pi can be challenging and big fun, also can serve self education but I do not see practical reasons on a system with 512MByte RAM and a powerful CPU. In such environment MicroPython limitations would be a pain, I would use cPython instead.

If your concern is Linux overhead, you can use piCore Linux which is only 10MByte, runs entirely in RAM without any physical mass storage by default so you can pull the power cord without any corruption and many other features. BTW, MicroPython is part of this
system. It is the Unix port and machine specific MicroPython modules to handle GPIO, I2C, etc. not yet implemented, it will come.

Just a private view of course, a bare metal version is appreciated. If you have something to test, I'm ready.

You make a very valid point about just running python inside Linux. For most applications even the overhead of raspian isn't going to have any impact it just seems perverse to run an entire Linux system for very simple projects. I realise you could extend that logic to saying it's a waste to use 512MB and a 1GHz processor for such tasks.

Let's ask the issue a different way, what are the prospects of getting a micropython compatible board for £3 / $5 each?

I do not see practical reasons on a system with 512MByte RAM and a powerful CPU

I do. Linux uses pre-emptive multi tasking which imposes significant limitations on the realtime performance of applications running under it: a Python program can experience interruptions of many milliseconds. If you need guaranteed fast response to external events, bare metal wins hands down.

Let's ask the issue a different way, what are the prospects of getting a micropython compatible board for £3 / $5 each?

I'd estimate 1 man-month of good specialist should be enough to make a basic usable port of MicroPython to any board (not to cover all board features, that can easily take a year, just basic useful level). So, at yearly salary of $120,000, the prospect you're asking about is $10000. It's just if your board costs $5, you have harder time paying that.

Pfalcon, thanks for that insight. That's a useful way of thinking about it. Presumably a board that used the same processor as something proven would simplify that? I'm not sure what the BOM looks like for the current boards or how that would scale with volume (that may be in the public domain but I would understand if it was not).

If you use such chip you would want to use USB devices, a display and more. MicroPython can't do that, but Python on Linux can. Also Raspberry Pi Foundation isn't interested in profit or commercial devices, and also Broadcom is hard to talk to (Hardkernel Broadcom boards where hard to make ) ESP8266 and it successor seems more practical for MicroPython.

poly wrote:Pfalcon, thanks for that insight. That's a useful way of thinking about it. Presumably a board that used the same processor as something proven would simplify that? I'm not sure what the BOM looks like for the current boards or how that would scale with volume (that may be in the public domain but I would understand if it was not).

Yes, so the main insight should be that MicroPython boards price of course includes MicroPython price, that's how it's developed further. And here's my insight. I'm personally got used to the fact that most Kickstarter projects are inactive half-year after the campaign end (like, you can't buy a product), and dead after a year (like, forum gone, site is placeholder). Well, as you know MicroPython feels well, there're new version almost every month with bug fixes and improvements to Python compatibility. But some time ago Damien (author of MicroPython) posted this patch: https://github.com/micropython/micropython/pull/1516 . It effectively adds real-time processing capabilities for single-precision floats. I (#2 contributor per https://github.com/micropython/micropyt ... ntributors) asked: "But it's niche feature, why spend time on that?". He answered "PyBoard needs it". You see, I love well-supported products (and know few), and spend time to make MicroPython better myself. But even I was surprised that 2 years after the release, PyBoard gets update of such level. Bottom line: official MicroPython boards are worth every penny.

I'm not sure what the BOM looks like

BOM is not in public domain, it's under copyright, but is available under open-source/hardware license.

But if you don't know how that stuff works though, I suggest you trace existing project's history first. There was a project to make a $5 ARM board, started in 2011, called McHck: https://github.com/mchck/mchck . In 2013 they achieved their aim. Exact achievements are:

Let me quote the last doc: "Kit cost is $60 including PayPal fee and international shipping." So yes, you can have your $5 ARM board. And of course, you can have it for $5 e.a. too - just invest $50000.

But that's not the main point. Main point is that their site https://mchck.org/ isn't being updated since 2013. Indeed, why - mission accomplished, "because we can" worked, and noone in their right mind would spend their time on $5 thing, there're so many interesting things in the world (and sometimes you need to pay bills too). And there's of course software needed to use board - it's half-finished. Because it's easy to make hardware (just spend weekends on it for 2 years). But software... what, 2 more years?.. No-o-o-o!

I write above not deter someone, just to set expectations right. If you're serious about doing something like above, then we're eagerly looking for someone to organize ESP8266 MicroPython port Kickstarter campaign, to finish the port for it. It won't be $5 though (or feel free to make it $5 and finish port yourself, just please kindly do it right - like original Kickstarter benefited not just PyBoard, but the whole community, please try to do the same).