Bern RTOS: Meetings
2022-06-13: Espresso Machine Demo and Bern Kernel
Meeting Information
| Subject: | Milestone Meeting: Espresso Machine and Bern Kernel |
| Date/Time: | 13.06.2022, 15:00-15:45 |
| Location: | T215a, Jlcoweg 1, 3400 Burgdorf |
| Note Taker: | Stefan Lüthi |
Participants
- Stefan Lüthi (maintainer)
- Roger Weber (advisor)
Agenda
- Milestone: Espresso Machine
- Milestone: Kernel Modification
- Varia
Meeting
- Milestone: Espresso Machine Demo done
-
Evaluation of milestone objectives:
-
These features were added to the demo application:
- Temperature control
- Data log over TCP
- System log to SEGGER SystemView or RTT
- Water volume readout
-
No solution was found to read the temperature inside the group head (type K thermocouple). There is still an issue regarding communication with the external ADC over the galvanic isolation. This will not be fixed during the thesis. For documentation purposes an external measurement device will be used.
-
Currently a PID controller is used to control the temperature. A state space model has been developed and will be implemented this week for temperature control comparison.
-
The demo is done, no measures have to be taken.
-
-
Next steps:
- Document demo application
-
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Implement state space temperature control. | Stefan Lüthi | 17.06.2022 | |
| Evaluate espresso machine performance. | Stefan Lüthi | 17.06.2022 |
- Milestone: Kernel Modifications done
-
Evaluation of milestone objectives:
-
These features were added to the kernel:
- Add message queue across different processes
- Add
logfacade support for system logs - Add kernel tracing calls
- Add SEGGER SystemView as RTOS tracing backend
- Manage interrupts in the kernel
- Update kernel config format (generate
memory.xfrom macro) - Fix critical bug in linked list
- Fix floating point context switch
-
The following planned features are considered out of scope and will not be added to the kernel within the thesis:
- Event groups
- Priority inversion prevention for mutexes
- API for statically allocated memory (i.e. thread stack)
-
The project is on track, no measures have to be taken.
-
-
Next steps:
- Document kernel
- Update examples
-
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Publish kernel to crates.io | Stefan Lüthi | 10.07.2022 |
- Varia
- The BFH book abstract must done until the 30.06.2022. For a first review the abstract should be send to the advisor until thursday noon.
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Write BFH book abstract. | Stefan Lüthi | 16.06.2022 |
Next Meeting
according to sprint cycle
2022-04-05: Espresso Machine Demo MVP
Meeting Information
| Subject: | Milestone Meeting: Espresso Machine MVP |
| Date/Time: | 05.04.2022, 10:00-10:30 |
| Location: | MS Teams |
| Note Taker: | Stefan Lüthi |
Participants
- Stefan Lüthi (maintainer)
- Roger Weber (advisor)
Agenda
- Milestone: Espresso Machine MVP
- Implementation of priorities
Meeting
- Milestone: Espresso Machine Modifications done
-
Evaluation of milestone objectives:
-
These features were implemented for the demo application:
- Add board support package with a modular structure
- Add support for GPIO peripherals (buttons, LEDs, power control)
- Add ADC (AD7124-8) driver (not working as expected)
- Add simple machine controls
-
For now the temperature cannot be measured, because the external ADC does provide any measurement results. However, the demo still works as a minimal viable product, because the power controls to pull an espresso shot (boiler, pump and valve control) already work and the machine is wired to use the old thermostat. This provides a baseline for any new temperature controller implementation.
-
A considerable amount time was spent on the development of library to simplify register access of devices attached to the microcontroller. The library allows to describe a register with its fields using a macro:
#![allow(unused)] fn main() { register!{ /// Status Register [..] STATUS(0x00 | r): B8 { /// Ready bit for the ADC. [..] RDY: [7], /// ADC error bit. [..] ERROR_FLAG: [6], /// Power-on reset flag. [..] POR_FLAG: [4], /// These bits indicate which channel is being converted by the ADC. CH_ACTIVE: [3..0], } } }The macro generates the bit access functions and supports different register sizes (8, 16, 24 or 32 bit). Reading a register could look like as follows:
#![allow(unused)] fn main() { let status: STATUS = ad7124.read_register(); let por: bool = satutus.POR_FLAG(); }This library will speed up the implementation of future device drivers.
-
The milestone was missed, which has the following consequences:
- An additional 8h are needed to fix the ADC driver. There are no consequences to the demo application because this is only a minor delay.
-
-
Next steps:
- Fix the driver for the AD7124-8 ADC
-
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Fix AD7124-8 ADC driver. | Stefan Lüthi | 08.04.2022 |
- Implementation of priorities
-
The original plan was to create a model of the boiler to design a temperature controller in the next step. However, because the project will be showcased at the Embedded Computing Conference implementing more Rust code is preferred.
-
The following features should be added until the conference (31.05.2022), sorted by priority:
- Multiple temperature sensors (showcases multiple devices on the same bus).
- GUI providing live data (using LVGL, to show the use of C code in a Rust project).
- RTOS Tracing library (SEGGER SystemView) to provide a visualization of what is running on the system.
-
Next Meeting
according to sprint cycle
2022-03-07: Espresso Machine Modifications done
Meeting Information
| Subject: | Milestone Meeting: Espresso Machine Modifications done |
| Date/Time: | 07.03.2022, 15:00-15:45 |
| Location: | BFH, Burgdorf |
| Note Taker: | Stefan Lüthi |
Participants
- Stefan Lüthi (maintainer)
- Roger Weber (advisor)
Agenda
- Milestone: Espresso Machine Modifications done
Meeting
- Milestone: Espresso Machine Modifications done
-
Evaluation of milestone objectives:
-
These modification were done to the espresso machine:
- Add thermowell to measure water temperature inside the boiler.
- Add 0.5mm thermocouple to measure water temperature inside the group head.
- Add a water pressure sensor.
- Add a flow meter before the water pump.
- Mount power control PCB and solid state relay to control pump, valve and boiler.
- Clean and descale every machine part.
- Order heat resistant (>120°C) strand wires to replace the cabling.
-
The modification was on tight schedule because the PCB production took longer than expected due to queries. 42h were planned for the modification, it took 46h and will need an additional 8h to finish.
-
The milestone was missed, which has the following consequences:
- The additional time for the modification was used from the kernel documentation budget.
- To provide enough time to finish the documentation the final application milestone will be moved from week 26 to week 24.
- The demo application will lack low priority features such as pressure control.
- Additional 8h are needed to complete the modification.
- The additional time for the modification was used from the kernel documentation budget.
-
-
Next steps:
- Mount processing unit and 3D printed case to the machine.
- Glue a RTD sensor to outside of the boiler and group head.
- Replace all cables with new wiring.
- Reassemble the machine.
-
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Finish wiring and mount all sensors. | Stefan Lüthi | 11.03.2022 | |
| Reassemble espresso machine. | Stefan Lüthi | 11.03.2022 |
Next Meeting
according to sprint cycle
2022-02-25: Bern Kernel v0.3.0
Meeting Information
| Subject: | Milestone Meeting: Bern Kernel v0.3.0 |
| Date/Time: | 25.02.2022, 13:30-14:00 |
| Location: | MS Teams |
| Note Taker: | Stefan Lüthi |
Participants
- Stefan Lüthi (maintainer)
- Roger Weber (advisor)
Agenda
- Milestone: Bern Kernel v0.3.0
- Timing measurements
Meeting
- Milestone: Bern Kernel v0.3.0
- Evaluation of milestone objectives:
-
The kernel is reasonably stable, so that the development of the demonstration application can begin.
-
The following changes where made since v0.2.0
- Message queues in the form of channels between threads.
- Multiple allocators:
- Bump allocator (no deallocation)
- Heap allocator
- Memory pool (not accessible to the user at the moment)
- Log message using
defmt - Relaxation of memory restrictions and introduction of processes. Threads can now access other threads data within the same process.
- Interrupt handling, the user can now register interrupts at the kernel.
-
The project is on track, no measures have to be taken
-
- Next steps:
- Create an example project to share with people, so that we can get feedback on the Bern RTOS.
- Evaluation of milestone objectives:
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Publish Kernel v0.3.0 to crates.io | Stefan Lüthi | 05.03.2022 | |
| Create a project template for people to test Bern RTOS. | Stefan Lüthi | 05.03.2022 |
- Timing measurements
- Wit the use of a Digilent Digital Discovery logic analyzer and a Python script, interrupt latency can now be measured automatically. The script flashes the test application onto the microcontroller, applies a pulse on an interrupt GPIO pin, and then measures the time until the RTOS toggles an output GPIO pin in the ISR.
- The timing can now be measured and visualized with ease, a histogram of different ISR latency is shown below.
- The timing measurement setup allows for characterization of the real-time aspects of the kernel. After this first test the script can be used to evaluate further timing constraints.
Next Meeting
according to sprint cycle
2022-01-14: Hardware order
Meeting Information
| Subject: | Milestone Meeting: Hardware order |
| Date/Time: | 14.01.2022, 10:00-10:20 |
| Location: | MS Teams |
| Note Taker: | Stefan Lüthi |
Participants
- Stefan Lüthi (maintainer)
- Roger Weber (advisor)
Agenda
- Milestone: Hardware order
Meeting
- Milestone: Hardware order
- Evaluation of milestone objectives:
-
All components except some temperature sensors are ordered.
-
Component placement on PCB is done.
-
The HW development took about 100h instead of the planned 60h which is due to
- elaborate measurement capabilities (RTD and isolated thermocouple)
- case design
- ongoing supply chain shortages (multi changes of microcontroller module and display)
-
The hardware milestone was narrowly missed, which has the following consequences:
- Kernel v0.3.0 will not include any features beyond the ones specified, because some of the SW development time was allocated to HW development.
- No additional measures have to be taken, the other milestones are still on track (mainly because the kernel is ahead of schedule).
-
- Next steps:
- Route remaining nets on PCB.
- Generate PCB design output and order PCB.
- Order temperatures sensors (1x RTD PT100 for in-boiler measurement and 1x K-type thermocouple for in-group head measurement).
- Evaluation of milestone objectives:
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Check size fit of PCB from 3D printed parts. | Stefan Lüthi | 17.01.2022 | |
| Order a crimp tool for Molex Micro-Lock PLUS 1.25mm | Stefan Lüthi | 17.01.2022 | |
| Order remaining components and PCB. | Stefan Lüthi | 21.01.2022 |
Next Meeting
according to sprint cycle
2021-06-04: Bern Kernel v0.2.0
Meeting Information
| Subject: | Milestone Meeting: Kernel v0.2.0 |
| Date/Time: | 04.06.2021, 10:00-10:39 |
| Location: | MS Teams |
| Note Taker: | Stefan Lüthi |
Participants
- Stefan Lüthi (maintainer)
- Roger Weber (advisor)
Agenda
- Milestone: Kernel v0.2.0
- Documentation Structure
Meeting
- Milestone: Kernel v0.2.0
- Evaluation of milestone objectives:
- All issues regarding the milestone are done
- A few highlights:
- For mutex and semaphore a generic event system was added. The synchronization primitive handles data access, while the event system manages tasks that are waiting for access.
- The ARM Cortex-M4 Memory Protection Unit (MPU) features:
- 8 regions
- Region size from 32B to 4GB in \(2^n\) spacing
- 8 equally sized subregions per region (enabled by 8 bit mask)
- Region address must be a multiple of region size
- Access levels for (un)privileged mode: no access, read-only, read/write
- Prevent instruction fetch
- The project is on track, no measures have to be taken
- Next steps:
- Write documentation
- Port existing 3D Orientation Demo to Bern RTOS
- Evaluation of milestone objectives:
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Write documentation | Stefan Lüthi | 28.06.2021 | |
| Port 3D Orientation Demo to Bern RTOS | Stefan Lüthi | 28.06.2021 | |
| Clean source code | Stefan Lüthi | 28.06.2021 | |
| Release Bern RTOS to crates.io | Stefan Lüthi | 28.06.2021 |
-
Documentation Structure
-
Abstract
-
Introduction
- Why Bern RTOS
- Previous work
-
Design Overview
- Design Principles (SRS Summary)
- Architecture
- Everything the RTOS should do
- Memory separation
- syscalls
-
Implementation Details
- Scheduler
- Preemptive scheduling
- Task list
- Task
- Data structure
- Code example for user
- Synchronization Primitives
- Event System
- Mutex
- What is a Mutex for?
- Design
- Code example for user
- Semaphore
- What is a Semaphore for?
- Design
- Code example for user
- Memory Protection
- Application segmentation and enforcement
- Hardware Limitations & trade-off
- Scheduler
-
Results
- Demo
- Memory footprint and context switch instruction count
-
Evaluation of objectives
-
Conclusion and outline for next project
-
Appendix A: Kernel SRS
-
Appendix B: GitLab Issue summary
- Issues solved
- Weekly work time
-
- Structure approved
Next Meeting
according to sprint cycle
2021-05-07: Bern Kernel v0.1.0
Meeting Information
| Subject: | Milestone Meeting: Kernel v0.1.0 |
| Date/Time: | 07.05.2021, 10:00-10:55 |
| Location: | MS Teams |
| Note Taker: | Stefan Lüthi |
Participants
- Stefan Lüthi (maintainer)
- Roger Weber (advisor)
Agenda
- Milestone: Kernel v0.1.0
- Testing on Host
- Remote Tracing Station
Meeting
- Milestone: Kernel v0.1.0
- Evaluation of milestone objectives:
- All issues regarding the milestone are done
- The scheduler currently disables all interrupts when active. This leads to high interrupt latency, which is ok for now.
- The project is on track, no measures have to be taken
- Next Milestone:
- Next up are of synchronization primitives (mutex, semaphore) and stack overflow protection
- The mutex implementation will be minimal (without priority inversion)
- Most RTOS append tasks waiting for a semaphore to a pending list within the semaphore. Because the Bern RTOS isolates task stacks, the pending list must be kept in kernel memory. There are two possible solutions:
- The kernel keeps a pending list per synchronization object. Fast but needs list for every sync object.
- The kernel keeps one pending list for all sync object. Slower but needs only one list.
- Off Topic:
- Interrupts in uC/OS are divided into OS aware interrupts and low latency/high priority interrupts. ISR unaware of the OS must not call the RTOS. In Rust we could use procedural macros to see which ISR run outside the RTOS and could possibly check at compile time that the ISR doesn't contain any RTOS API calls.
- Evaluation of milestone objectives:
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Close milestone Kernel v0.1.0 | Stefan Lüthi | 07.05.2021 | |
| Shorten/Optimize critical sections in the scheduler | Stefan Lüthi | deferred | |
| Compare/Evaluate different pending list approaches for sync objects | Stefan Lüthi | 21.05.2021 |
-
Testing on Host
- Current testing strategy
- Test API calls on host (off target)
- Test hardware integration on target (microcontroller)
- The CPU architecture is completely isolated (through trait interfaces) and mocks are provided for off target testing
- Some unit tests are already running (linked-list), while others pose some issues with the mocking framework
- Current testing strategy
| Action Item | Owner | Due Date | Done |
|---|---|---|---|
| Implement a unit test for the scheduler to check if mocks are working | Stefan Lüthi | 21.05.2021 |
- Remote Tracing Station
- The remote tracing station consists of
- a SEGGER J-Trace Cortex-M edition trace adapter
- a SEGGER Cortex-M trace reference board (STM32F407)
- a Digilent Digital Discovery logic analyzer & pattern generator
- a PC (running GNU/Linux)
- The tracing station can be accessed within the
bfh.chdomain. - Tracing allows for in-depth kernel execution and stack analysis.
- The remote tracing station consists of
Next Meeting
according to sprint cycle