Skip to main content

A module and utility to flash Python onto the BBC micro:bit.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

A community fork of uFlash.

A utility for flashing the BBC micro:bit with Python scripts and the MicroPython runtime. You pronounce the name of this utility “micro-flash”. ;-)

It provides three services:

  1. A library of functions to programatically create a hex file and flash it onto a BBC micro:bit.

  2. A command line utility called uflash/py2hex that will flash Python scripts onto a BBC micro:bit.

  3. A command line utility called uextract/hex2py that will extract Python scripts from a hex file created by uFlash.

Several essential operations are implemented:

  • Encode Python into the hex format.

  • Embed the resulting hexified Python into the MicroPython runtime hex.

  • Extract an encoded Python script from a MicroPython hex file.

  • Discover the connected micro:bit.

  • Copy the resulting hex onto the micro:bit, thus flashing the device.

  • Specify the MicroPython runtime hex in which to embed your Python code.

You can generate or download fully optimized MicroPython runtime hex for micro:bit v2 through micropython-microbit-v2-builder.

Installation

To install simply type:

$ pip install uflash3

NB: You must use a USB data cable to connect the micro:bit to your computer (some cables are power only). You’re in good shape if, when plugged in, the micro:bit appears as a USB storage device on your file system.

Linux users: For uflash to work you must ensure the micro:bit is mounted as a USB storage device. Usually this is done automatically. If not you’ve probably configured automounting to be off. If that’s the case, we assume you have the technical knowledge to mount the device yourself or to install the required kernel modules if they’re missing. Default installs of popular Linux distros “should just work” (tm) out of the box given a default install.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uflash3-3.0.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uflash3-3.0.3-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file uflash3-3.0.3.tar.gz.

File metadata

  • Download URL: uflash3-3.0.3.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uflash3-3.0.3.tar.gz
Algorithm Hash digest
SHA256 3c2cce53847bd37346066efbbc39a2a7cf68caaf8b76f3e472ae0a4444eb73b3
MD5 f3b0721312b1990d60b27668c9f2f3d5
BLAKE2b-256 a67e86be9505954300022ac93f9db5f1d5697a69339f898f1f325b8171c1a1ce

See more details on using hashes here.

File details

Details for the file uflash3-3.0.3-py3-none-any.whl.

File metadata

  • Download URL: uflash3-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uflash3-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6cf4bee344ee0ab28658dbf534bb8b70efd847abef8ebe12ee4f24c40db6226d
MD5 c96ffdc6d15bdff56d94eb5f896701fd
BLAKE2b-256 20b980c4d33e0ae1f76730e262fb128827ae0c3451241741663006650420c61c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page