Skip to content

Merge the XRobot 1.0 migration into dev - #3

Merged
Jiu-xiao merged 45 commits into
devfrom
feat/static-assembly-20260915
Oct 4, 2026
Merged

Jiu-xiao merged 45 commits into
devfrom
feat/static-assembly-20260915

Conversation

@Jiu-xiao

@Jiu-xiao Jiu-xiao commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

把 feat/static-assembly-20260915 合入 dev。BSP 迁移到 XRobot 1.0(静态装配、xrobot 命令、libxr 命令、提交的 xrobot.lock),具体改动见下方提交列表。

Merges feat/static-assembly-20260915 into dev. Migrates the BSP to XRobot 1.0 (static assembly, the xrobot and libxr commands, a committed xrobot.lock); the commits below list the changes.

合并顺序:工具先合并并发布(xrobot 1.0.0、libxr 6.0.0、扩展 2.0.0,XRobot 打 v1),BSP 的 CI 安装已发布的 xrobot 1.0.0 和 libxr 6.0.0,因此本 PR 在发布之后合入 dev,再由 dev 合入默认分支。

Merge order: the tools are merged and released first (xrobot 1.0.0, libxr 6.0.0, extension 2.0.0, XRobot tag v1). The BSP CI installs the released xrobot 1.0.0 and libxr 6.0.0, so this PR is merged into dev after the release, and dev then into the default branch.

验证 / Verification

  • MC02(STM32H723VG)实机:数据库写入 3000 次 × 3 次重启后数据一致;SPI DMA 20000 次收发正确。
  • dev 上的 ci: validate dev branch 已合入本分支,工作流内容以本分支为准(已包含 dev 触发)。

提交 / Commits

  • feat: migrate BSP application to static module assembly (29f84c4)
  • feat: complete static XRobot BSP integration (62e5bfd)
  • Migrate to static assembly (b04175e)
  • Pin LibXR static assembly candidate (2314627)
  • Regenerate CubeMX config in CI (4fdf367)
  • Regenerate app_main with the CMSIS cache-line fallback (42efd0c)
  • Commit the stamped XRobot entry and verify generated files in CI (dc9c698)
  • Pin LibXR with absolute-path stamp inputs (00e5585)
  • Regenerate the entry without the stamp tool line (40c4c05)
  • Regenerate app_main with XROBOT_MAIN() owned by the generator (f315900)
  • Normalize application configs to the canonical YAML layout (fec149b)
  • Build with pinned tools and the xrobot CLI in CI (324a0d6)
  • Pin the tools and stop tracking generated XRobot files (ac1395b)
  • Pin LibXR with the XRobot freshness check and Release-active topic checks (abfeb4c)
  • Lock the Module feature heads (bf77117)
  • Add a README for the XRobot 1.0 workflow and license under Apache-2.0 (1e00559)
  • Regenerate with the generated-file notices (25b7367)
  • Write config strings in double quotes and code without quotes (05b1025)
  • Generate with libxr parse and libxr gen (bfb44b3)
  • Migrate to STM32CubeMX 6.18.1 and FreeRTOS CMSIS-RTOS V2 (f7fc8f3)
  • Route stack overflows to LibXR error handling (004bc24)
  • Key the CAN settings by the lower-case instance name (1da6f54)
  • Regenerate with libxr stm32 setup (aba7faf)
  • Enable the EXTI15_10 interrupt of ACC_INT and GYRO_INT in NVIC (0305be6)
  • Drop FlashLayout from libxr_config.yaml (f1a7f08)
  • README: regenerate with libxr stm32 setup after CubeMX changes (9622b60)
  • README: the build check compares input content (f1b8790)
  • Update LibXR to 7f51121 (cdd3e16)
  • Update LibXR to 6c51bf4 and build the flash from runs (9fedbff)
  • Resolve the Modules against dev (5c9ce1b)
  • Place the GOT in its own FLASH section (55cfd9c)

User/xrobot_main.hpp is generated from User/xrobot.yaml and xrobot.lock and
now committed; LibXR refuses to build it once either input changes. CI
regenerates app_main.cpp, libxr_config.yaml, the entry and Modules/CMakeLists.txt
from the committed inputs with the locked module commits (--frozen) and fails
when they differ from the commit. Registrations follow the generated object
order; the unused device_aliases table is gone. LibXR pinned to the stamp check.
The call moves from User Code 3 to right after it, where the generator now
writes it (and refuses to regenerate while a user region still contains it).
Each FDCAN object is also registered as LibXR::CAN through canN references.
Install the XRobot and CodeGenerator versions pinned in modules.yaml and
libxr_config.yaml; check the CodeGenerator outputs and the config layout;
resolve the lock frozen with the release-line gate of the target branch. The
generated entry, module list and lock are no longer diffed.
modules.yaml pins xrobot 1.0.0 and libxr_config.yaml pins the generator
6.0.0; CI installs exactly these. User/xrobot_main.hpp and
Modules/CMakeLists.txt are produced by xrobot setup and are no longer
committed. Remove the STATIC_CANDIDATE.md task notes.
…ecks

LibXR now requires the generated module list, checks the entry header against
the files it lists, prints the selected product, rejects RawData callback
payloads and keeps init-time topic type checks in Release.
The Modules drop their empty OnMonitor hooks and gain licenses, CI and README
updates; no interface this BSP uses changes.
Describe setup, build, BSP object regeneration and CI. Add the
Apache-2.0 LICENSE and a NOTICE listing the vendored third-party code
that keeps its own license.
app_main.cpp, app_main.h and flash_map.hpp from CodeGenerator 459f125 and
xrobot.lock from XRobot bfe20af1; only the notice lines change.
XRobot reads a double-quoted value as a C++ string and any other value as C++ code; xrobot format writes code without quotes where YAML allows it. The generated headers are unchanged.
libxr 6.0.0 gathers its commands under `libxr`; CI, the README and the
generated file notices use the new names. Regenerated output is otherwise
unchanged.
STM32Cube FW_H7 V1.13.0 no longer ships the CMSIS-RTOS V1 wrapper, so
CubeMX 6.18.1 drops FreeRTOS from a project that uses it. The FreeRTOS
interface moves to CMSIS_V2 (in STM32CubeMX), then the project moves
from 6.15.0 / FW_H7 V1.12.1 to 6.18.1 / FW_H7 V1.13.0; HAL, CMSIS and
FreeRTOS (10.6.2) follow the package.

- CMSIS-RTOS V2 makes CubeMX enable FreeRTOS software timers. The USER
  CODE Defines section of FreeRTOSConfig.h turns them off again, with
  the osTimer API and event flags from interrupts that depend on them
  (as freertos_os2.h describes). The old define of
  INCLUDE_xTimerPendFunctionCall in the Includes section is gone.
- The USB HS handle is placed in RAM_D1 (its Setup buffer is written by
  the USB DMA, which cannot reach DTCM) and cleared before init, now
  from USER CODE sections of usb_otg.c, so regeneration keeps them; the
  attribute was on the generated declaration and the memset in a
  section CubeMX 6.18 renamed.
- The stack overflow hook in USER CODE 4 takes char *, as FreeRTOS 10.6
  declares it.
- CubeMX 6.18 names the linker script STM32H723xG_flash.ld; the file
  (with its .ram_d1 section) and its references follow.

libxr parse/gen reproduce the committed User files. The CI image build
(ST Arm Clang 21.1.1) links; text/data/bss go from 135444/84/116196 to
136976/84/117172. system_stm32h7xx.h of the new package adds an
optimize attribute that Clang ignores with a warning in each unit.
Not tested on hardware.
The stack overflow hook in USER CODE 4 of freertos.c is now a strong
definition that disables interrupts and calls libxr_fatal_error, as
bsp-dev-c does. It replaces the empty weak hook of the CubeMX template;
a strong definition is needed because the first weak definition the
linker sees wins, so LibXR's own weak hook never took effect. CubeMX
keeps the section when it regenerates the file.

In this CMSIS-RTOS V2 project the weak hook of cmsis_os2.c (configASSERT) was the one linked.
Regenerated with libxr gen, which keys CAN and FDCAN instances in libxr_config.yaml by their lower-case name like every other peripheral; the settings are unchanged and the generated sources are identical.
app_main.cpp names LibXR priority levels in PlatformInit() and for the
terminal thread. With configMAX_PRIORITIES 56 both threads move from
FreeRTOS priority 2, below every module thread, to MEDIUM (22).
cmake/LibXR.CMake globs User/*.cpp with CONFIGURE_DEPENDS and
cmake/starm-clang.cmake selects the runtime profile per build directory,
as the current setup writes them.
PE10 (ACC_INT) and PE12 (GYRO_INT) are external interrupt pins, but
EXTI15_10 was not enabled in NVIC, so CubeMX generated no
EXTI15_10_IRQHandler and the BMI088 interrupt would go to
Default_Handler once enabled. Regenerated with STM32CubeMX 6.18.1, line
endings kept as before; libxr gen output is unchanged.
libxr gen 6.0.0 no longer copies the flash sector table into
libxr_config.yaml; the layout stays in User/flash_map.hpp.
LibXR now checks User/xrobot_main.hpp against the content digest that xrobot
writes into it, instead of comparing file times.
libxr 6c51bf4 describes the sector table as runs of equal sectors
(FlashRegion). flash_map.hpp is regenerated and the flash is built from
FLASH_REGIONS; its storage area stays the last two sectors.
Every Module now has its dev branch at the commit this lock already pins; xrobot setup
--update --context-ref refs/heads/dev records dev as the resolved branch.
With the CubeMX default STARM_PICOLIBC, starm-clang reads errno through a GOT entry. The
CubeMX linker script names no .got, so the linker places the orphan section by its own
rules; in some builds it lands in RAM without a load address, which gives a bin of about
400 MB and a wrong errno address. The GOT holds only link-time constants and now has its
own FLASH section, as in the other STM32 BSPs.
# Conflicts:
#	.github/workflows/xrobot_stm32.yml

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 300 files, and this pull request has 1282

# Conflicts:
#	.github/workflows/xrobot_stm32.yml
#	.mxproject
#	Core/Inc/FreeRTOSConfig.h
#	Core/Inc/main.h
#	Core/Inc/stm32h7xx_it.h
#	Core/Src/adc.c
#	Core/Src/dac.c
#	Core/Src/fdcan.c
#	Core/Src/freertos.c
#	Core/Src/gpio.c
#	Core/Src/main.c
#	Core/Src/spi.c
#	Core/Src/stm32h7xx_hal_msp.c
#	Core/Src/stm32h7xx_hal_timebase_tim.c
#	Core/Src/stm32h7xx_it.c
#	Core/Src/tim.c
#	Core/Src/usart.c
#	Core/Src/usb_otg.c
#	STM32H723xG_flash.ld
@Jiu-xiao
Jiu-xiao merged commit 1f896c4 into dev Oct 4, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant