Skip to content

[misc] Update CANopen packages and parameter storage configuration - #2038

Merged
Rbb666 merged 3 commits into
RT-Thread:masterfrom
wdfk-prog:sync/misc-canopen-and-parameter-config
Sep 11, 2026
Merged

[misc] Update CANopen packages and parameter storage configuration#2038
Rbb666 merged 3 commits into
RT-Thread:masterfrom
wdfk-prog:sync/misc-canopen-and-parameter-config

Conversation

@wdfk-prog

Copy link
Copy Markdown
Contributor

中文 PR Message

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

本 PR 同步 misc 分类下几个相关 package 的最新配置和集成状态,主要包括:

  1. 同步 CanopenNode 当前 RT-Thread port 的模块化 Kconfig 结构;
  2. autogen_parameter_manager 增加应用自定义参数存储 backend 的显式配置;
  3. 新增 canopen-lely,将 Lely CANopen RT-Thread port 加入 package index。

这些修改都属于 RT-Thread packages 仓库中的 package 配置与索引集成,不修改 RT-Thread 内核或 BSP。

你的解决方案是什么 (what is your solution)

CanopenNode

将原有集中在 misc/CanopenNode/Kconfig 中的配置按照当前 port 的模块结构进行拆分,包括:

  • CANopenNode core protocol configuration
  • RT-Thread runtime configuration
  • Storage configuration
  • Object Dictionary 和 demo/test configuration
  • CiA 401 Device profile
  • CiA 402 Device / Controller profile
  • profile-specific RT-Thread configuration

同时增加对应的 Storage SCons source selection,根据 Kconfig 选择实际使用的 storage implementation。

根 Kconfig 继续负责 package 入口、模块引用以及版本选择。

autogen_parameter_manager

现有参数存储抽象已经允许应用通过 backend hooks 提供自己的 storage implementation,但 Kconfig 原先只能选择 package 提供的 AT24CXX 或 Flash-EE backend。

本 PR 增加:

AUTOGEN_PM_BACKEND_APP_DEFINED

选择该配置时不启用 package-provided scalar backend。

应用负责提供 strong:

par_store_backend_get_api()

如果 backend 需要显式绑定过程,还可以覆盖:

par_store_backend_bind()

现有默认 backend 保持不变,因此不会改变已有工程的默认选择。

canopen-lely

新增:

misc/canopen-lely/Kconfig
misc/canopen-lely/package.json

并在:

misc/Kconfig

中注册 canopen-lely

该 package 为 Lely CANopen 的 RT-Thread port 提供配置入口,包括:

  • single-owner EV/IO2 runtime
  • RT-Thread CAN integration
  • Classic CAN / optional CAN FD
  • automatic runtime initialization
  • owner thread configuration
  • logging
  • startup/shutdown configuration
  • optional CANopen Master services

Lely runtime 使用 LELY_NO_THREADS=1,Lely EV/IO2/CANopen 对象由一个专用 RT-Thread owner thread 串行访问,异步 CAN、timer 和 status 事件转交给该 owner 处理。

请提供验证的bsp和config (provide the config and bsp)

  • BSP:
[提交前填写实际验证 BSP]
  • .config:

CanopenNode 验证配置:

CONFIG_PKG_USING_CANOPENNODE=y
[填写实际验证的 CiA 401 / CiA 402 / Storage 配置]

autogen_parameter_manager 验证配置:

CONFIG_PKG_USING_AUTOGEN_PARAMETER_MANAGER=y
CONFIG_AUTOGEN_PM_USING_NVM=y
CONFIG_AUTOGEN_PM_BACKEND_APP_DEFINED=y
# CONFIG_AUTOGEN_PM_USING_RTT_AT24CXX_BACKEND is not set
# CONFIG_AUTOGEN_PM_USING_FLASH_EE_BACKEND is not set

canopen-lely 验证配置:

CONFIG_PKG_USING_LELY=y
[填写实际验证的 runtime / CAN / Master 配置]

提交前请使用实际 BSP 生成的 .config 替换以上占位内容。

  • action:
[提交前填写 fork 对应 PR branch 的成功 Action 链接]

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用 formatting 等源码格式化工具确保格式符合 RT-Thread 代码规范
  • 如果是新增 BSP,已经添加对应 CI 检查

Synchronize the CanopenNode package configuration with the modular
RT-Thread port layout.

Split the monolithic Kconfig into dedicated core, demo, RT-Thread
runtime, storage, CiA 401 and CiA 402 configuration files.

Add the corresponding storage SCons source selection and synchronize
the profile-specific configuration exposed by the current port.
…ackend

Allow the parameter manager to explicitly select an
application-defined scalar storage backend.

Add AUTOGEN_PM_BACKEND_APP_DEFINED without changing the existing
default backend. When selected, no package-provided scalar backend is
enabled and the application can provide par_store_backend_get_api()
and, when required, par_store_backend_bind().

Update the related Kconfig help text to document the backend contract.
Add the canopen-lely package for the Lely CANopen RT-Thread port.

Provide package metadata and Kconfig options for the single-owner
EV/IO2 runtime, CAN configuration, automatic initialization, logging
and optional CANopen Master services.

Register canopen-lely in the misc package index.
@Rbb666
Rbb666 merged commit 8c61340 into RT-Thread:master Sep 11, 2026
3 checks passed
@wdfk-prog
wdfk-prog deleted the sync/misc-canopen-and-parameter-config branch September 11, 2026 13:50
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.

2 participants