# Alire with microbit v1

**URL:** https://forum.ada-lang.io/t/alire-with-microbit-v1/4659
**Category:** General
**Tags:** embedded, microbit, alire
**Created:** [August 23, 2026, 7:09pm UTC](https://forum.ada-lang.io/t/alire-with-microbit-v1/4659 "2026-08-23T19:09:12Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bjorn-lundin](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/bjorn-lundin/32/106_2.png) [@bjorn-lundin](https://forum.ada-lang.io/u/bjorn-lundin)
#### Post date: [August 23, 2026, 7:09pm UTC](https://forum.ada-lang.io/t/alire-with-microbit-v1/4659/1 "2026-08-23T19:09:12Z")

</div>

Hi,

I’ve spent some (several) hours now to get a trivial example to link for a bbc:microbit card V1.

Google AI was involved but it did not help that much.

I’m on opensuse 16 and have no compiler installed.

In the end, it compile but usually complains on missing memory-map.ld

```ada
sattmate@fuji-i3:~/micro_1> alr build
ⓘ Building micro_1=0.1.0-dev/micro_1.gpr...         
Bind
   [gprbind] micro_1.bexch
   [Ada] micro_1.ali
Link
   [link] micro_1.adb
/home/sattmate/.local/share/alire/toolchains/gnat_arm_elf_11.2.4_ba16d45c/bin/../lib/gcc/arm-eabi/11.2.0/../../../../arm-eabi/bin/ld: cannot open linker script file memory-map.ld: No such file or directory
collect2: error: ld returned 1 exit status
gprbuild: link of micro_1.adb failed

```

it insists of installing gnat 11, and not 15/16 which is odd, but perhaps the crate has note been updated. It is ok for my purpose, but odd.

So - can anyone point me to how I should do - if I have a clean computer - to get a cross compiling environment that can be used via cli, and compile and link to the bbc-micro?

---

<div class="post-metadata">

### Author: ![Irvise](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/i/7ba0ec/32.png) [@Irvise](https://forum.ada-lang.io/u/Irvise)
#### Post date: [August 23, 2026, 7:21pm UTC](https://forum.ada-lang.io/t/alire-with-microbit-v1/4659/2 "2026-08-23T19:21:14Z")

</div>

Did you install the BSP? (Board Support Package) [Alire - Microbit\_bsp](https://alire.ada.dev/crates/microbit_bsp)

Also, take a look at [Alire - Microbit\_examples](https://alire.ada.dev/crates/microbit_examples)

The missing file is basically what the BSP should provide or you have to write it by hand if you are doing support from scratch.

I hope this helps. Best regards,  
Fer

---

<div class="post-metadata">

### Author: ![bjorn-lundin](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/bjorn-lundin/32/106_2.png) [@bjorn-lundin](https://forum.ada-lang.io/u/bjorn-lundin)
#### Post date: [August 24, 2026, 5:27am UTC](https://forum.ada-lang.io/t/alire-with-microbit-v1/4659/3 "2026-08-24T05:27:27Z")

</div>

Fer,

yes I did.

The microbit\_bsp is the one with dependence on gnat 11.

I also installed the examples crate

looking at my history I did this

```ada
  204 wget https://github.com/alire-project/alire/releases/download/v2.1.1/alr-2.1.1-bin-x86_64-linux.zip
  205 ls
  206 mkdir alire
  207 mv alr-2.1.1-bin-x86_64-linux.zip alire/
  208 cd alire/
  209 unzip alr-2.1.1-bin-x86_64-linux.zip 

  225 alr index --update
  226 alr help index
  227 alr index --update-all
  228 alr init --bin my_microbit_app
  229 ls
  230 cd my_microbit_app/
  231 alr get microbit
  232 alr search microbit
  233 alr get microbit_bsp

  243 cd src/
  244 ls
  245 nano my_microbit_app.adb 
  246 cd ..
  247 alr build

```

googling gives some old info that is not true anymore, like alr index --update, and the crate changed name from microbit to microbit\_bsp.

I used to program it using gnat gpl 2018 on macOS with GPS, so many instructions is still from that time.

However - starting fresh - how do I set it up from the beginning

---

<div class="post-metadata">

### Author: ![Irvise](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/i/7ba0ec/32.png) [@Irvise](https://forum.ada-lang.io/u/Irvise)
#### Post date: [August 24, 2026, 2:20pm UTC](https://forum.ada-lang.io/t/alire-with-microbit-v1/4659/4 "2026-08-24T14:20:50Z")

</div>

If those are the exact commands you used, then I can see the problem.

While you did almost perfectly, you did not in fact add microbit\_bsp as a dependency. The command `alr get microbit_bsp` downloads the library to a local folder and allows you to inspect and modify the contents, but it does NOT add it as a project dependency. `get` is a very useful tool from Alire to download packages/libraries, build them independently, make local modification and potentially use those modified libraries as a project dependency. However, I suppose that is not what you are trying to do.

The command that you need is `alr with`. `with` adds a dependency to your project and configures the build system to build it and link against it. So the set of commands that you need are:

```sh
alr init --bin my_microbit_app
cd my_microbit_app/
alr with microbit_bsp
cd src/
nano my_microbit_app.adb 
cd ..
alr build

```

Just one tip. You can use `alr edit` to launch any editor that you may want to with the full setup already done for you (such as Ada LSP). This wont be very useful for `nano` but it will help a lot with VS Code, (neo)Vim, Emacs, etc.

I hope this helps. Best regards,  
Fer

---

<div class="post-metadata">

### Author: ![bjorn-lundin](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/bjorn-lundin/32/106_2.png) [@bjorn-lundin](https://forum.ada-lang.io/u/bjorn-lundin)
#### Post date: [August 24, 2026, 4:00pm UTC](https://forum.ada-lang.io/t/alire-with-microbit-v1/4659/5 "2026-08-24T16:00:25Z")

</div>

Thanks for the suggestions, however it won’t work.

It targets the native x86\_64-linux platform.

How do I get it to cross compile?

This is the log from what I did -

```ada
sattmate@fuji-i3:~> alr init --bin my_microbit_app
Enter a short description of the crate: (default: '')
>
Using default: ''

Select a software license for the crate?
  1. MIT OR Apache-2.0 WITH LLVM-exception
  2. MIT
  3. Apache-2.0 WITH LLVM-exception
  4. Apache-2.0
  5. BSD-3-Clause
  6. LGPL-3.0-or-later
  7. GPL-3.0-or-later WITH GCC-exception-3.1
  8. GPL-3.0-or-later
  9. Other...
Enter your choice index (first is default):
>
Enter a comma (',') separated list of tags to help people find your crate: (default: '')
>
Using default: ''
Enter an optional Website URL for the crate: (default: '')
>
Using default: ''
✓ my_microbit_app initialized successfully.
sattmate@fuji-i3:~> cd my_microbit_app/

sattmate@fuji-i3:~/my_microbit_app> alr with microbit_bsp
The index can be periodically refreshed to make available recently published crates.
Do you want Alire to go online without asking in the future?
(You can update manually with `alr index --update-all` at any time.)
[Y] Yes [N] No (default is Yes)
Using default: Yes
◴ Updating index... remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (2/2), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 4 (from 1)
Unpacking objects: 100% (6/6), 9.55 KiB | 9.55 MiB/s, done.
From https://github.com/alire-project/alire-index
   d3366dd..9ee60e0 stable-1.4.0 -> origin/stable-1.4.0
Updating d3366dd..9ee60e0
Fast-forward
 index/li/lithophane/lithophane-0.1.0.toml | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 index/li/lithophane/lithophane-0.1.0.toml
Requested changes:

   ✓ microbit_bsp ~0.2.1 (add)

Changes to dependency solution:

   + adl_middleware 0.1.1 (new,indirect)
   + cortex_m 0.2.0 (new,indirect)
   + embedded_components 0.1.0 (new,indirect)
   +📦 gnat_arm_elf 11.2.4 (new,indirect,binary)
   + hal 0.1.0 (new,indirect)
   + microbit_bsp 0.2.1 (new)
   + nrf5x_hal 0.1.0 (new,indirect)

Do you want to proceed?
[Y] Yes [N] No (default is Yes)
Using default: Yes
ⓘ Deploying microbit_bsp=0.2.1...
Cloning into '/home/sattmate/.local/share/alire/releases/alr-1965-csmf.tmp'...
remote: Enumerating objects: 56, done.
remote: Counting objects: 100% (56/56), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 56 (delta 33), reused 45 (delta 26), pack-reused 0 (from 0)
Receiving objects: 100% (56/56), 30.09 KiB | 505.00 KiB/s, done.
Resolving deltas: 100% (33/33), done.
◴ Exploring /home/sattmate/.local/share/alire/releases/microbit_bsp_0.2.1_6e957a◷ Exploring .../src...
sattmate@fuji-i3:~/my_microbit_app> cd src/
sattmate@fuji-i3:~/my_microbit_app/src> ls
my_microbit_app.adb
sattmate@fuji-i3:~/my_microbit_app/src> cd ..
sattmate@fuji-i3:~/my_microbit_app> alr build
◵ Syncing build dir... embedded_components=0.1.0... Syncing embedded_components= ⓘ Building my_microbit_app=0.1.0-dev/my_microbit_app.gpr...
kb: info: can't find a toolchain for the following configuration: language 'Ada', target 'x86_64-linux', default runtime
kb: info: can't find a toolchain for the following configuration: language 'Ada', target 'x86_64-linux', default runtime
Setup
   [mkdir] object directory for project HAL
   [mkdir] library directory for project HAL
   [mkdir] object directory for project Cortex_M0
   [mkdir] library directory for project Cortex_M0
   [mkdir] object directory for project NRF51
   [mkdir] library directory for project NRF51
   [mkdir] object directory for project Adl_Middleware
   [mkdir] library directory for project Adl_Middleware
   [mkdir] object directory for project Embedded_Components
   [mkdir] library directory for project Embedded_Components
   [mkdir] object directory for project Microbit_Bsp
   [mkdir] library directory for project Microbit_Bsp
   [mkdir] object directory for project My_Microbit_App
   [mkdir] exec directory for project My_Microbit_App
adl_middleware.gpr:3:09: no compiler for language "Ada", cannot compile "logging_with_priority.ads"
gprbuild: *** compilation phase failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/sattmate/my_microbit_app/my_microbit_app.gpr"] exited with code 7
error: Compilation failed.
sattmate@fuji-i3:~/my_microbit_app>

```

---

<div class="post-metadata">

### Author: ![Shuihuzhuan](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/s/c6cbf5/32.png) [@Shuihuzhuan](https://forum.ada-lang.io/u/Shuihuzhuan)
#### Post date: [August 24, 2026, 4:12pm UTC](https://forum.ada-lang.io/t/alire-with-microbit-v1/4659/6 "2026-08-24T16:12:46Z")

</div>

You have to change the default toolchain. Something like `alr toolchain --select` if I remember well.

---

<div class="post-metadata">

### Author: ![bjorn-lundin](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/bjorn-lundin/32/106_2.png) [@bjorn-lundin](https://forum.ada-lang.io/u/bjorn-lundin)
#### Post date: [August 24, 2026, 6:13pm UTC](https://forum.ada-lang.io/t/alire-with-microbit-v1/4659/7 "2026-08-24T18:13:49Z")

</div>

I’ve got it work with some changes in the .gpr

```ada
with "config/my_microbit_app_config.gpr";
with "microbit_bsp.gpr";
project My_Microbit_App is

   for Source_Dirs use ("src/", "config/");
   for Exec_Dir use "bin";
   for Main use ("my_microbit_app.adb");

   for Runtime ("ada") use MicroBit_BSP'Runtime ("Ada");
   for Target use "arm-eabi";
   for Languages use ("Ada");
   for Object_Dir use "obj";
   for Create_Missing_Dirs use "True";

   package Compiler renames MicroBit_BSP.Compiler;

   package Linker is
      for Default_Switches ("Ada") use
         MicroBit_BSP.Linker_Switches &
         ("-Wl,--print-memory-usage",
          "-Wl,--gc-sections");
      end Linker;

end My_Microbit_App;

```
