Emby is a small modular embedded framework written in C/C++ that provides a collection of core modules (logging, time, threading, console, system abstractions, small libraries) plus platform-specific implementations. The project is structured to keep a clear separation between platform-independent core code and platform-specific code (drivers, startup, linker scripts, HAL adapters).
Key features:
- Modular core components under
emby/core(e.g.EmbySystem,EmbyThreading,EmbyLibs). - Platform implementations under
emby/platforms/<PlatformName>, optionally overridingImplsubcomponents from the core. - CMake-based build system with helper macros to assemble platform and core sources.
emby/— core sources and platform cmake helpers.emby/platforms/— platform-specific folders (e.g.X86_Unix,STM32xx_Baremetal,Mbed).src/— application code that consumes Emby core.build/— out-of-source build directory (we use per-platform subfolders here).
This repository uses out-of-source builds. We recommend using one build directory per platform to avoid configuration conflicts.
build/X86_Unix/— for x86 developmentbuild/STM32xx_Baremetal/STM32H5xx/— for STM32 H5 familybuild/STM32xx_Baremetal/STM32H7xx/— for STM32 H7 family
From the repository root you can configure a dedicated build directory:
# create and configure build dir for x86
./compile_x86.sh
# then build
cd build/X86_Unix && make -j$(nproc)Or run cmake directly from the root using the recommended -S/-B syntax:
cmake -S . -B build/X86_Unix -DEMBY_FOLDER=$PWD/emby -DEMBY_CONFIG=$PWD/src/emby_config.h -DEMBY_PLATFORM=X86_Unix
cmake --build build/X86_Unix -- -j$(nproc)First, set up your ARM cross toolchain by exporting the path to your arm-none-eabi GCC toolchain:
export CUSTOM_GCC_TOOLCHAIN_PATH=/path/to/your/arm-none-eabi/binThen configure a build directory for the desired STM32 family. Example scripts are provided:
# H5 example
./compile_h5x.sh
cd build/STM32xx_Baremetal/STM32H5xx && make -j
# H7 example
./compile_h743.sh
cd build/STM32xx_Baremetal/STM32H7xx && make -jOr invoke cmake directly:
cmake -S . -B build/STM32xx_Baremetal/STM32H5xx \
-DEMBY_FOLDER=$PWD/emby \
-DEMBY_CONFIG=$PWD/src/emby_config.h \
-DSTM32xx_Baremetal_DEVICE=STM32H563xx \
-DSTM32xx_Baremetal_FAMILY=STM32H5xx \
-DEMBY_PLATFORM=STM32xx_Baremetal \
-DSTM32xx_Baremetal_STARTUP=$PWD/src/platform/arm/ST/nucleo_stm32H563ZI/startup_stm32h563zitx.s \
-DSTM32xx_Baremetal_CONF_DIR=$PWD/src/platform/arm/ST/nucleo_stm32H563ZI/ \
-DSTM32xx_Baremetal_LINKER=$PWD/src/platform/arm/ST/nucleo_stm32H563ZI/STM32H563ZITX_FLASH.ld
cmake --build build/STM32xx_Baremetal/STM32H5xx -- -jNotes:
- Use
-S <source> -B <build>to avoid accidental configuration of the wrong directory. - The
compile_*.shscripts in the repo set sensible defaults and create platform-specific build dirs.
- Core modules live under
emby/core. When a platform needs to provide a specialized implementation it typically creates the same module path insideemby/platforms/<PlatformName>and places platform headers or sources in anImplsubdirectory. - The CMake helper macro
EMBY_UTILS_SYNC_IMPL_INCLUDES()includes platformImplsubdirectories and removes matchingcore/.../Impl/...include directories when the platform provides the same subpath—this lets platform headers take precedence. - Platform CMake files (usually named
emby-platform.cmake) are responsible for:- adding platform-specific compile definitions and toolchain includes,
- adding startup assembler and linker scripts,
- collecting platform sources and drivers,
- creating the
emby_platformstatic library that is then linked with the core and application.
- If you add a new platform, create a
emby/platforms/<YourPlatform>/emby-platform.cmakeand follow the patterns used byX86_UnixandSTM32xx_Baremetal. - Provide
Implheaders under the same module path if you want to override core components. - Update the top-level scripts if you add new family/device combinations.
Open an issue or create a PR describing the change and include reproduction steps. If you want assistance adding a new platform, point me to the board/family and I can create a starting platform template for you.
This repository includes a small helper script to quickly generate a build-time configuration header:
emby/emby/misc/tools/emby_config_menu.sh— a simple text-based configurator usingdialogthat lets you set macros and values, then export them toemby_config.h.
See the detailed documentation for this tool in docs/menu-tool.md (usage, dependencies, extension points).
If the script is not executable, make it so and run it from the directory where you want emby_config.h to be created:
chmod +x emby/emby/misc/tools/emby_config_menu.sh
emby/emby/misc/tools/emby_config_menu.sh