How next-flip/momentum-firmware works
Major architectural layers
• • ROM Bootloader & Startup – Although not very separate in the repo, the bootstrapping code (startup files, SConstruct, and toolchain scripts in “targets”) is critical.
• • RTOS Kernel & Core – This layer comprises the FreeRTOS components (found in “lib/FreeRTOS-Kernel” and “furi/core”) and the Furi core libraries. It is the basis on which tasks and threads run.
• • Hardware Abstraction Layer (HAL) & Device Drivers – Under “targets/furi_hal”, “lib/drivers,” “lib/fatfs”, and various protocol modules (NFC, Infrared, SubGHz, iButton, etc.), you have drivers that talk directly to the hardware.
• • Middleware & Libraries – A wealth of modules sit here (for example, “lib/mjs” provides the JavaScript engine, “lib/ibutton”, “lib/nfc”, “lib/subghz”, “lib/u8g2”, “lib/mlib”, etc.). These libraries abstract complex protocols and functionalities.
• • Applications and Services – In the “applications” folder you see many subfolders: a wide range of apps (debug apps, main apps, settings apps, system apps) and in “applications/services” you have services (CLI, desktop, GUI, input, loader, etc.). This application layer also includes the highly customizable Momentum Settings and Bad Keyboard functions described in the README.
Inter-layer dependencies and interactions
• Data flows upward from the hardware through the HAL and driver layers into the OS kernel, where tasks are scheduled.
• Middleware libraries (protocol stacks for NFC, SubGHz, Infrared, etc.) abstract hardware complexities and provide APIs to the higher-level applications.
• The applications and services call upon these libraries to implement features like file management, Bluetooth spoofing (Bad Keyboard), and the momentum settings interface.
• The assets and animation system interacts with the GUI part of the services and apps to provide a fully customizable user experience.
• Additionally, the build system (SConstruct, SConscripts, and associated “scripts” folders) is critical for assembling and flashing the firmware to the device.
Final Elements
• Clear, legible labels for each major component.
• Optionally, add notes indicating which folders from the file tree correspond to each module.