MicroPython in piCore Linux

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
bmarkus
Posts: 111
Joined: Tue Oct 21, 2014 5:58 am

MicroPython in piCore Linux

Post by bmarkus » Fri Sep 11, 2015 7:36 am

piCore is a Raspberry Pi port of TC (Tiny Core Linux). TC is a Linux toolkit to build custom system. It is cca. 10 Mbyte and runs in RAM. There are no traditional installation, extensions (packages) are squash compressed read-only archives of files added to file system during startup. It requires processing of many lists, dependencies, ... Currently all is written in shell, awk and all other shall magic. While it works perfectly, code hard to read, maintain and shall lacks modern data structures.

I added MicroPython to the new version, piCore 7.0 in alpha test phase and rewrote the startup extension loader and mounter in MicroPython. Now code is much cleaner and startup time is only 60% of the original using only one CPU core.

Additional to MicroPython executable libffi, os module added together with a TC/RPi specific local module. Size increase is relative big in TC terms, but it pays back.

According to user tests MicroPython works fine for GPIO manipulation on the RPi providing faster port manipulation than shell or cPython.

So I decided to keep MicroPython in the final version of piCore 7.0 and use it more cases.

Conclusion you can consider MicroPython not only in various boards as the 'Operating System' but in Linux as a fast, low resource footprint generic scripting language also.

For more info on TC see http://tinycorelinux.net
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)

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

Re: MicroPython in piCore Linux

Post by dhylands » Fri Sep 11, 2015 8:09 am

Nice. This will definitely be on my list of things to look at.

phsdv
Posts: 12
Joined: Wed Apr 22, 2015 2:36 pm

Re: MicroPython in piCore Linux

Post by phsdv » Fri Sep 11, 2015 9:35 am

Very interesting. One question, will piCore with micro python support GPIO directly, like the RPi.GPIO module: https://pypi.python.org/pypi/RPi.GPIO?

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

Re: MicroPython in piCore Linux

Post by bmarkus » Fri Sep 11, 2015 12:18 pm

It was tested using the /sys/class/gpio interface, see discussion at

http://forum.tinycorelinux.net/index.ph ... 778.0.html

It is easy to make an RPi GPIO module in MicroPython however it is not done yet. This tutorial may help:

https://sites.google.com/site/semillero ... rials/gpio
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)

Post Reply