firmware for i2c.init

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
rhubarbdog
Posts: 168
Joined: Tue Nov 07, 2017 11:45 pm

firmware for i2c.init

Post by rhubarbdog » Tue Jan 30, 2018 10:43 pm

hi,
i'm trying to write a producer and a consumer with 2 microbits connected over the I2C bus. from reading other posts i know the firmware on my microbits may be old. how do i find out what my microbit's current firmware is and how do i upgrade it to a latest version 1.92?
thanks
phil

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: firmware for i2c.init

Post by shaoziyang » Wed Jan 31, 2018 8:41 am

there is no new version firmware available now, it is still v1.7.9.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: firmware for i2c.init

Post by mcauser » Thu Feb 01, 2018 1:36 am

shaoziyang, that's not entirely true...

Leading on from viewtopic.php?f=17&t=4161
v1.7.9 is the most recent stable version
v1.9.2 is the most recent development version

To find the version you are running, connect to the board via REPL and you should see the MicroPython header, eg.
MicroPython v1.7-9-gbe020eb on 2016-04-18; micro:bit with nRF51822
MicroPython v1.9.2-34-gd64154c73 on 2017-09-01; micro:bit with nRF51822

This is how I connect to the micro:bit on my MacBook:

Code: Select all

screen /dev/tty.usbmodem1422 115200
If it's a different port on yours, try "screen /dev/tty." then use tab auto completion and make sure you add the 115200 baud.

To get v1.9.2 on your microbit, it's as simple as dragging the v1.9.2 .hex file to your board and reset it.
To roll back to v1.7.9, same process. Drag the .hex file and reset.

If your microbit is already running a script, uploading a new .hex file will overwrite it.
You'll start fresh with just the micropython runtime.
To put files back, use microfs aka ufs.
Or just connect to the REPL (eg. with screen) and run your scripts.

You can either compile v1.9.2 from source, or use my precompiled version:
https://github.com/mcauser/microbit-tm1 ... r/firmware
(Mine is around 5 commits old now)

v1.9.2 is based on the version1 branch on the bbcmicrobit/micropython repo on github:
https://github.com/bbcmicrobit/micropyt ... s/version1
v1.7.9 is based on the master branch.

Compiling from source was relatively easy on my MacBook:

Code: Select all

brew tap ARMmbed/homebrew-formulae
brew install python cmake ninja arm-none-eabi-gcc
pip install yotta
git clone git@github.com:bbcmicrobit/micropython.git
cd micropython
git checkout version1
yt target bbc-microbit-classic-gcc-nosd
yt up
yt build
cp build/bbc-microbit-classic-gcc-nosd/source/microbit-micropython.hex microbit-micropython-v1.9.2.hex 
Further reading:
https://microbit-micropython.readthedoc ... ation.html
http://docs.yottabuild.org/#installing-on-osx

rhubarbdog
Posts: 168
Joined: Tue Nov 07, 2017 11:45 pm

Re: firmware for i2c.init

Post by rhubarbdog » Sun Jul 29, 2018 12:00 am

As of recently Mu and uflash upgraded their firmware to 1.9.2 it make sense to use them the precompiled version mentioned in @mcauser 's post has a bug in the neopixel module which has been fixed in the uflash and Mu 1.9.2 firmware.

to upgrade uflash type

Code: Select all

sudo pip3 install --no-cache --upgrade uflash
I installed Mu from instructions on ubuntu forums https://ubuntuforums.org/showthread.php?t=2377314
I just downloaded a clone off github repeated step 3 and moved the unzipped mu-master to /usr/local/bin

Post Reply