6 years, 11 months ago.

microbit update to mbedOS 5.x ?

Notice that mbed shows the microbit as only being available for mbedOS 2, and not 5.x I would like to use the export to vscode gcc option, but this does not seem to work with any of the microbit examples.

Question relating to:

Resources, programs and examples for the BBC micro:bit

2 Answers

6 years, 10 months ago.

The NUCLEO-F070RB and NUCLEO-F072RB have the same size RAM and half the flash as the micro:bit, and are supported by Mbed OS 5. Is there some particular reason (maybe the Bluetooth stack) that MbedOS 5 can't run on the micro:bit?

Interesting. My micro:bit has QFAAH1, meaning IC Revision 3, and should be able to support S130 2.x softdevice, and up through nrf5 SDK 12.3.0, albeit with tight memory constraints. This might be because of the way nrf5x implements BLE support via "softdevices". This softdevice can consume up to about 8-9kB in a basic configuration - so this might be one reason. But I do see BLE supported on 16k ram nrf51822 boards - so it's a bit confusing... To make matters even more confusing, the other micro:bit dev stacks (like microbit python and blocks/js) seem to discourage using BLE for this reason, and instead use the proprietary rf protocol ("Enhanced ShockBurst", which is still quite useful for a number of tasks). Not running with BLE stack/softdevice is also a valid option, and leaves enough memory to do alot of other things.

Jan, Who's responsibility is it to port/update this platform for mbed5.x? Can this be done by the community?

posted by Jens Jensen 01 Feb 2018

@Jens, yes, absolutely. PR welcome at https://github.com/armmbed/mbed-os. I'd suggest adding "5" to supported mbed versions in targets.json, and see if you can make it compile...

posted by Jan Jongboom 05 Feb 2018
6 years, 10 months ago.

I doubt that the micro:bit will be updated to Mbed OS 5 due to the very limited amount of memory on the board. However... you can still use VSCode for debugging.

  1. Export a project (e.g. mbed-os-example-blinky) to a board that supports Mbed OS 5 and pyOCD (e.g. K64F).
  2. Take the .vscode folder and drag it into your micro:bit project.
  3. Change task.json so you use mbed.exe to build instead of make.exe. Also add the --profile=debug flag to the arguments.
  4. Change launch.json to point to BUILD/nrf51_microbit/GCC_ARM/your_project.elf (in three locations).
  5. Change launch.json to run mbed as pre-launch task (instead of make).

Now hit F5 to build and debug :-)