Raspberry Pi Zero

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.
poly
Posts: 5
Joined: Thu Nov 26, 2015 9:07 pm

Raspberry Pi Zero

Post by poly » Thu Nov 26, 2015 9:20 pm

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.

User avatar
danicampora
Posts: 342
Joined: Tue Sep 30, 2014 7:20 am
Contact:

Re: Raspberry Pi Zero

Post by danicampora » Thu Nov 26, 2015 9:50 pm

How easy is to get proper docs for that Broadcom chipset? or an SDK with peripheral libraries....?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Raspberry Pi Zero

Post by dhylands » Thu Nov 26, 2015 10:13 pm

https://www.raspberrypi.org/documentati ... herals.pdf

I worked with the chip when I worked at Broadcom (I wasn't working on the Pi, we were using the chip for video conferencing). And of course, the full kernel sources are available.

I also came across this: https://github.com/jameswalmsley/RaspberryPi-FreeRTOS
and: http://www.stevebate.net/chibios-rpi/Ge ... arted.html

User avatar
bmarkus
Posts: 111
Joined: Tue Oct 21, 2014 5:58 am

Re: Raspberry Pi Zero

Post by bmarkus » Fri Nov 27, 2015 7:19 am

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. :)

See TC home page http://tinycorelinux.net/ and RPi section of TC Forums.
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)

poly
Posts: 5
Joined: Thu Nov 26, 2015 9:07 pm

Re: Raspberry Pi Zero

Post by poly » Sat Nov 28, 2015 10:48 am

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?

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

Re: Raspberry Pi Zero

Post by pythoncoder » Sat Nov 28, 2015 11:16 am

@bmarkus
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.

A Pi port would be awesome ;)
Peter Hinch
Index to my micropython libraries.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Raspberry Pi Zero

Post by pfalcon » Sat Nov 28, 2015 11:44 am

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.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

poly
Posts: 5
Joined: Thu Nov 26, 2015 9:07 pm

Re: Raspberry Pi Zero

Post by poly » Sat Nov 28, 2015 1:49 pm

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).

riklaunim
Posts: 32
Joined: Fri Aug 22, 2014 5:42 pm

Re: Raspberry Pi Zero

Post by riklaunim » Sat Nov 28, 2015 4:21 pm

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.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Raspberry Pi Zero

Post by pfalcon » Sat Nov 28, 2015 6:06 pm

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).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply