Osek_pi_spigot_metal computes
The backbone real-time operating system is taken directly from the OSEK-like OS implemented in Chalandi/OSEK_Raspberry_Pi_Zero
This fascinating, educational and fun project combines the domain of high-performance numerical computing with the raw simplicity of bare-metal embedded microcontroller systems.
In this project,
The spigot calculation has quadratic numerical complexity of order
The microcontroller boots and performs initialization of stacks
and C/C++ run-time static initialization with self-written
hybrid assembly/C/C++ in reset
in
int_vect.s.
and in __my_startup()
in
crt0.cpp.
Hardware setup (including FPU/MMU/LMU-enable, data and instruction caching, etc.)
is carried out with yet more self-written hybrid assembly/C/C++ code
in the subroutine mcal::cpu::init()
and the subroutines
in namespace
detail
called by it.
After reaching main()
, we initialize the MCAL
and start the OS via call to OS_StartOS(...)
,
as can be found in main.c.
The pi-spigot calculation runs continuously and successively in the
application's idle-task. LED-blinky and calculation progress
presented on an LCD display are controlled within a higher-priority
extended task named T1
. Calculation correctness is verified with
a hash sum of the character representation of the digits computed.
Compact code size is in focus and the entire project compiles to about 16k of program code, with slight variations depending optimization options. The calculation does, however, require ample RAM of about 1.5 Mbyte.
The target hardware on a breadboard is taken directly from the similar project ckormanyos/pi_crunch_metal. It runs on a RaspberryPi(R)-Zero.
The build system is set up to use GCC, making use of the arm-none-eabi
compiler. The default optimization setting is -O2
.
The hardware setup is pictured in the image below.
In this image, the target system has already completed
one