MicroPython running "bare metal" in the browser via unicorn.js

Announcements and news related to MicroPython.
Damien
Site Admin
Posts: 534
Joined: Mon Dec 09, 2013 5:02 pm

MicroPython running "bare metal" in the browser via unicorn.js

Postby Damien » Wed May 24, 2017 9:34 am

Hi everyone!

We have recently developed the ability to run MicroPython "bare metal" in a web browser. This is acomplished using unicorn.js, which is an Emscripted version of unicorn, which is a stripped-down version of QEMU. We have used unicorn.js to implement a Cortex-M3 based "virtual microcontroller" that runs in the browser. And then this virtual microcontroller runs a port of MicroPython, the unicorn port.

Running this unicorn port of MicroPython will give you a good idea of what it's like running MicroPython on the bare metal of real hardware, and allows you to test stuff out quickly, and get to know (new) features of MicroPython.

Find a running version at: https://micropython.org/unicorn/
Find the source code at: https://github.com/micropython/micropython-unicorn

At the moment the port is pretty minimal and doesn't have many features enabled. Plans for the future include different builds of unicorn MicroPython to show-case size vs features, as well as modules such as "machine".

Enjoy!

Damien // George Robotics.

User avatar
marfis
Posts: 139
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: MicroPython running "bare metal" in the browser via unicorn.js

Postby marfis » Thu Aug 17, 2017 9:48 pm

Just saw that the link has been updated with examples to select/test virtual LEDs, Servos and ADC in the browser.

Awesome.

User avatar
pythoncoder
Posts: 1790
Joined: Fri Jul 18, 2014 8:01 am

Re: MicroPython running "bare metal" in the browser via unicorn.js

Postby pythoncoder » Fri Aug 18, 2017 6:22 am

As far as I'm concerned Clarke's third law applies to this. Amazing ;)
Peter Hinch

SpotlightKid
Posts: 194
Joined: Wed Apr 08, 2015 5:19 am

Re: MicroPython running "bare metal" in the browser via unicorn.js

Postby SpotlightKid » Tue Aug 29, 2017 11:42 am

This is really helpful for demonstrating / teaching MicroPython! Well done.

User avatar
deshipu
Posts: 1149
Joined: Thu May 28, 2015 5:54 pm

Re: MicroPython running "bare metal" in the browser via unicorn.js

Postby deshipu » Thu Sep 07, 2017 10:21 pm

Shame it also became a victim of the ever-changing APIs.

For instance, the "Pin LED" demo errors with: TypeError: 'PIN' object is not callable

Damien
Site Admin
Posts: 534
Joined: Mon Dec 09, 2013 5:02 pm

Re: MicroPython running "bare metal" in the browser via unicorn.js

Postby Damien » Sun Sep 10, 2017 7:41 am

deshipu wrote:For instance, the "Pin LED" demo errors with: TypeError: 'PIN' object is not callable


Thanks for pointing this out. Unicorn is still very much a work-in-progress. The ability to call pin objects was actually implemented recently (see https://github.com/micropython/micropyt ... e2ba40055d), and this commit is now deployed on the website.


Return to “Announcements and News”

Who is online

Users browsing this forum: No registered users and 1 guest