Use node-core as a git submodule and keep your product code in your own repo. You never edit node-core: boards, targets, modules and drivers live in your app and are layered on top. See also the README "Framework" workflow and build_system.md.
your_app/
├── Makefile # thin wrapper, one target per firmware
├── src/
│ ├── boards/<vendor>/<board>/
│ │ ├── board/board.cmake # platform, cube project, flash layout
│ │ └── <target>.cmake # the firmware target
│ ├── modules/... # optional app modules
│ └── drivers/... # optional app drivers
└── third_party/node-core/ # submodule
Point the build at src/ with --app-src-dir (NC_APP_SRC_DIR).
Submodule URL scheme — pick by visibility:
- Public submodule →
https://github.com/...so CI and fresh clones work without an SSH key. - Private submodule →
git@github.com:...so developers clone with their key (CI then needs a deploy key or token).
- Board dir
src/boards/<vendor>/<board>/board/board.cmake. For existing hardware, copy a node-core board (e.g.rl/mini_v2) and keepSTM32_CUBEMX_PROJECT_PATHpointing at node-core's stock cube project to reuse the.ioc/HAL as-is. For new hardware, add your own.iocand generate the HAL with your script — do not commit generated HAL. For CI, use prebuilt HAL archives: see cubemx.md. - Target
src/boards/<vendor>/<board>/<target>.cmake. Start from a node-core target (e.g.dronecan.cmake) andrl_include_module(...)what you need. - Node name:
add_definitions(-DNC_DEFAULT_NODE_NAME="co.vendor.app.node"). - Makefile target that forwards to
scripts/build.sh(copy an existing one). - Build it.
- A board dir is self-contained and fully shadows a core board of the same path — it does not merge. Give new boards a new name.
- Modules and drivers resolve app-first, then core via
rl_include_module/rl_include_driver. To override a core module, copy the whole module dir. - A module's
CMakeLists.txtmay pull a driver viainclude(${SRC_DIR}/drivers/...), which bypasses the app override. If you override such a driver, change that line torl_include_driver(<driver>).