apache / apache/nuttx

[FEATURE] Multi-Repository NuttX Management and Flexible Application Development

Open
#18,143 4 comments 0 reactions 0 assignees View on GitHub
Type: Enhancement
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

### Is your feature request related to a problem? Please describe.

## Proposal

Implement a **multi-repository registration and discovery mechanism** for NuttX:

### Describe the solution you'd like

### 1. Registration System
- Script to register NuttX instances with version identifiers (e.g., `nuttx_v1`, `user_nuttx`)
- Store metadata (path, git commit, branch) in centralized location
- Example: `python register-nuttx.py nuttx_v1 --path /path/to/nuttx --git-commit `

### 2. CMake Integration
- Create `FindNuttX.cmake` module for `find_package()` support
- Usage: `find_package(nuttx_v1 REQUIRED CONFIG)`
- Support version/branch specification

### 3. Flexible Board Management
```cmake
# Official board
board_set(${NUTTX_BASE}/boards/arm/stm32h7/stm32h750xb)

# Custom board
board_set(${CMAKE_CURRENT_SOURCE_DIR}/boards/custom_board)
```

4. Decoupled Application Development
Applications can be anywhere, not confined to apps/ repository
Clear dependency declaration on NuttX versions

Example
Register:

```
cd D:\nuttx_workspace\nuttx
python register-nuttx.py nuttx_v1 --label "main-branch"
```
User Application (E:/nuttx_app/CMakeLists.txt, the nuttx in D:\nuttx_workspace\nuttx ):
```
find_package(nuttx_v1 REQUIRED CONFIG)

project(MyApp)

# Use official board
board_set(${NUTTX_BASE}/boards/arm/stm32h7/stm32h750xb)

# Or use custom board
# board_set(${CMAKE_CURRENT_SOURCE_DIR}/boards/custom_board)

add_executable(myapp app/main.c)
target_link_libraries(myapp nuttx_libs)
```

### Describe alternatives you've considered

_No response_

### Verification

- [x] I have verified before submitting the report.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.