overview.rst 2.27 KB
Newer Older
Rahix's avatar
Rahix committed
1
2
.. _firmware_overview:

Rahix's avatar
Rahix committed
3
4
5
6
7
8
9
10
11
12
13
Overview
========
To make the most of card10's dual-core processor, its firmware will have been
divided into two parts: The "main" firmware running on core 0 which will have
been called *Epicardium* and the "user-code" running on core 1.  In most cases
this will have been *Pycardium*, our MicroPython port.

.. image:: ./static/overview.svg

Epicardium
----------
Rahix's avatar
Rahix committed
14
15
Epicardium is based on `FreeRTOS <https://www.freertos.org/>`_.  There are a
number of tasks that will have been keeping card10 running.  These are:
Rahix's avatar
Rahix committed
16
17
18
19
20
21

* **Dispatcher**:  The dispatcher task handles API calls from core 1.
* **PMIC**:  The power manager task checks the battery level and other interesting
  statistics that can be gathered from our power manager IC (MAX77650).
* **Serial**:  Handles serial communication via *UART*, *CDC ACM* and possibly
  Bluetooth.
Rahix's avatar
Rahix committed
22
23
24
* **BHI160**: Housekeeping task for interaction with the `BHI160`_.

.. _BHI160: https://www.bosch-sensortec.com/bst/products/all_products/bhi160
Rahix's avatar
Rahix committed
25
26
27
28
29

.. todo::

   The following tasks have not yet been implemented/are currently in the works:

Rahix's avatar
Rahix committed
30
   - **Bluetooth**: The bluetooth stack (`#23`_)
Rahix's avatar
Rahix committed
31
32
   - **Payload Controller**: Control what is running on core 1

Rahix's avatar
Rahix committed
33
   .. _#23: https://git.card10.badge.events.ccc.de/card10/firmware/issues/23
Rahix's avatar
Rahix committed
34

Rahix's avatar
Rahix committed
35
36
37
Epicardium API
--------------
Epicardium exposes lots of functionality via the *Epicardium API*.  The
prof_r's avatar
prof_r committed
38
39
technical details of this API can be found in this :ref:`overview
<epicardium_api_overview>`.  If you are interested in adding new API calls,
Rahix's avatar
Rahix committed
40
41
you should probably read the :ref:`epicardium_api_guide` guide.

Rahix's avatar
Rahix committed
42
43
44
Pycardium
---------
Pycardium is our MicroPython fork.  Its purpose is to make it as easy as
Rahix's avatar
Rahix committed
45
46
possible to interact with card10.  If you are interested in working on
Pycardium, take a look at the :ref:`pycardium_guide` guide.
Rahix's avatar
Rahix committed
47

48
49
50
51
52
53
L0dables
--------
Next to Pycardium, other bare-metal code can also run on core 1.  For example,
a Rustcardium or C-cardium.  These l0dables must be compiled using our special
linker script and should link against the api-caller library so they can
interface with the :ref:`epicardium_api`.
Rahix's avatar
Rahix committed
54

55
.. todo::
Rahix's avatar
Rahix committed
56

57
   Provide more details how this works
Rahix's avatar
Rahix committed
58
59
60
61
62
63

Program Flow Diagram
--------------------
The following diagram is a rough overview of the program flow in this fimware:

.. image:: ./static/firmware-flow.svg