Skip to content
Snippets Groups Projects
Forked from card10 / firmware
1575 commits behind the upstream repository.
how-to-build.rst 2.31 KiB

How To Build

If you just want to write MicroPython code for card10, you probably won't need to build the firmware yourself. This page is for people who want to work on the underlying firmware itself.

Dependencies

  • gcc, binutils & newlib for arm-none-eabi: The packages have slightly different names on different distros.
    • Ubuntu: gcc-arm-none-eabi, binutils-arm-none-eabi, libnewlib-arm-none-eabi
    • Arch: arm-none-eabi-gcc, arm-none-eabi-binutils, arm-none-eabi-newlib
    • Alternative: Download ARM's GNU toolchain. TODO
  • python3: For meson and various scripts needed for building.
  • ninja: Needed for meson.
  • meson (>0.43.0): Unfortunately most distros only have very old versions of meson in their repositories. Instead, you'll probably save yourself a lot of headaches by installing meson from pip3 install --user meson.
  • python3-crc16: Install with pip3 install --user crc16.

Building

Build using the following two commands:

$ ./bootstrap.sh
$ ninja -C build/

bootstrap.sh initializes git submodules and runs meson. Afterwards you can build with ninja.

Note

Our build-system contains a few workarounds around short-comings in meson. These workarounds might break on some setups which we did not yet test. If this is the case for you, please open an issue in our issue tracker!

If ninja succeeds, the binaries are in build/. They are available in two formats: As an .elf which can be flashed using a debugger and as a .bin which can be loaded using the provided bootloader. Here is a list of the binaries:

  • build/bootloader/bootloader.elf: Our bootloader. It should already be on your card10. The bootloader can only be flashed using a debugger.
  • build/pycardium/pycardium_epicardium.bin: The entire firmware in one .bin.
  • build/epicardium/epicardium.elf: The core 0 part of the firmware, called Epicardium.
  • build/pycardium/pycardium.elf: Our MicroPython port, the core 1 part of the firmware.