2017-01-16 01:06:04 +01:00
|
|
|
The Micro:Bit is a very small ARM Cortex-M0 board designed by the BBC for
|
|
|
|
|
computer education. It's fitted with a [Nordic
|
|
|
|
|
nRF51](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822)
|
|
|
|
|
Bluetooth enabled microcontroller and an embedded programmer. You can get it
|
|
|
|
|
at:
|
|
|
|
|
|
|
|
|
|
- [Pimoroni (UK/EU)](https://shop.pimoroni.com/collections/micro-bit/products/microbit)
|
|
|
|
|
- [Kitronik (UK/EU)](https://www.kitronik.co.uk/5613-bbc-microbit-board-only.html)
|
|
|
|
|
- [ThePiHut (UK/EU)](https://thepihut.com/collections/microbit/products/micro-bit)
|
2020-08-06 19:24:16 +02:00
|
|
|
- [AdaFruit (US)](https://www.adafruit.com/products/3530)
|
2017-01-16 01:06:04 +01:00
|
|
|
|
|
|
|
|
# How to setup the Ada development environment for the Micro:Bit
|
|
|
|
|
|
2023-01-02 11:34:55 +01:00
|
|
|
You can use GNAT FSF arm-elf and GPRbuild releases from the Alire project,
|
|
|
|
|
download [here](https://github.com/alire-project/GNAT-FSF-builds/releases).
|
|
|
|
|
|
|
|
|
|
A public release of GNAT Studio is also available
|
|
|
|
|
[here](https://github.com/AdaCore/gnatstudio/releases).
|
2018-06-28 19:19:40 +02:00
|
|
|
|
2017-04-07 20:24:36 +02:00
|
|
|
## pyOCD programmer
|
2017-01-16 01:06:04 +01:00
|
|
|
|
2017-04-07 20:24:36 +02:00
|
|
|
The Micro:Bit comes with an embedded programming/debugging probe implementing
|
|
|
|
|
the
|
|
|
|
|
[CMSIS-DAP](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/advanced/DAP/)
|
2018-06-28 19:19:40 +02:00
|
|
|
protocol defined by ARM.
|
2017-01-16 01:06:04 +01:00
|
|
|
|
2018-06-28 19:19:40 +02:00
|
|
|
To use it on Linux, you might need privileges to access the USB ports without
|
|
|
|
|
which the flash program will say "No connected boards".
|
|
|
|
|
|
2020-08-06 19:24:16 +02:00
|
|
|
On Ubuntu, you can do it by creating (as administrator) the file
|
2018-06-28 19:19:40 +02:00
|
|
|
/etc/udev/rules.d/mbed.rules and add the line:
|
2017-01-16 01:06:04 +01:00
|
|
|
```
|
2020-08-06 19:24:16 +02:00
|
|
|
SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204", MODE="0666"
|
2017-01-16 01:06:04 +01:00
|
|
|
```
|
2018-06-28 19:19:40 +02:00
|
|
|
then restarting the service by doing
|
2017-01-16 01:06:04 +01:00
|
|
|
|
2018-06-28 19:19:40 +02:00
|
|
|
```shell
|
|
|
|
|
$ sudo udevadm trigger
|
2017-01-16 01:06:04 +01:00
|
|
|
```
|
|
|
|
|
|
2018-07-06 12:56:19 +02:00
|
|
|
## Open one of example projects and build it
|
2017-01-16 01:06:04 +01:00
|
|
|
|
2018-06-28 19:19:40 +02:00
|
|
|
Start GNAT Programming studio (GPS) and open the micro:bit example project:
|
2018-07-06 12:56:19 +02:00
|
|
|
|
|
|
|
|
- [Text Scrolling](text_scrolling/)
|
2018-07-13 19:51:43 +02:00
|
|
|
- [Buttons](buttons/)
|
2018-07-06 12:56:19 +02:00
|
|
|
- [Digital Output](digital_out/)
|
|
|
|
|
- [Digital Input](digital_in/)
|
|
|
|
|
- [Analog Output](analog_out/)
|
|
|
|
|
- [Analog Input](analog_in/)
|
|
|
|
|
- [Music](music/)
|
|
|
|
|
- [BLE beacon](BLE_beacon/)
|
2017-01-16 01:06:04 +01:00
|
|
|
|
|
|
|
|
Press F4 and then press Enter to build the project.
|
|
|
|
|
|
2018-06-28 19:19:40 +02:00
|
|
|
## Program the board
|
2017-01-16 01:06:04 +01:00
|
|
|
|
2018-06-28 19:19:40 +02:00
|
|
|
Plug your micro:bit board with a USB cable, and wait for the system to
|
|
|
|
|
recognize it. This can take a few seconds
|
2017-01-16 01:06:04 +01:00
|
|
|
|
2018-06-28 19:19:40 +02:00
|
|
|
In the GPS toolbar, click on the "flash to board" button to program the
|
|
|
|
|
micro:bit.
|
2017-01-16 01:06:04 +01:00
|
|
|
|
2018-06-28 19:19:40 +02:00
|
|
|
After a few seconds, you should see a text scrolling on the LED matrix.
|
2017-01-16 01:06:04 +01:00
|
|
|
|
2018-06-28 19:19:40 +02:00
|
|
|
That's it, you are ready to hack the micro:bit with Ada!
|