Skip to content

[BSP] ADD ns800 BSP#11382

Merged
Rbb666 merged 11 commits into
RT-Thread:masterfrom
rcitach:rcitach/ns800
May 11, 2026
Merged

[BSP] ADD ns800 BSP#11382
Rbb666 merged 11 commits into
RT-Thread:masterfrom
rcitach:rcitach/ns800

Conversation

@rcitach
Copy link
Copy Markdown
Contributor

@rcitach rcitach commented May 10, 2026

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

[

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

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

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

  • BSP:
  • .config:
  • 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代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@github-actions
Copy link
Copy Markdown

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:rcitach/ns800
  • 设置PR number为 \ Set the PR number to:11382
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 rcitach/ns800 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the rcitach/ns800 branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions github-actions Bot added the BSP label May 10, 2026
@rcitach
Copy link
Copy Markdown
Contributor Author

rcitach commented May 10, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new Novosense NS800 BSP under bsp/novosns/ns800/, including board bring-up code, HAL driver layer (UART/GPIO/CAN/ECAP), example applications, and IDE project templates (MDK/IAR) to integrate NS800 targets into the RT-Thread BSP ecosystem.
本次 PR 在 bsp/novosns/ns800/ 下新增 Novosense NS800 BSP,包含板级初始化、HAL 驱动层(UART/GPIO/CAN/ECAP)、示例应用,以及 MDK/IAR 工程模板,用于将 NS800 目标接入 RT-Thread BSP 体系。

Changes:

  • Add NS800 HAL driver framework and board support package structure. / 新增 NS800 HAL 驱动框架与 BSP 目录结构
  • Add example apps for CAN/ECAP and build scripts (SCons/Kconfig). / 新增 CAN/ECAP 示例与构建脚本(SCons/Kconfig)
  • Add IDE project templates (Keil/IAR) for the BSP. / 新增 Keil/IAR 工程模板

Reviewed changes

Copilot reviewed 58 out of 59 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
bsp/novosns/ns800/README.md Vendor-level NS800 BSP entry README.
bsp/novosns/ns800/tools/sdk_dist.py BSP SDK distribution helper script.
bsp/novosns/ns800/libraries/HAL_Drivers/SConscript SCons integration for HAL_Drivers layer.
bsp/novosns/ns800/libraries/HAL_Drivers/drv_common.c Common BSP init utilities (incl. console output path).
bsp/novosns/ns800/libraries/HAL_Drivers/drv_common.h Common driver/BSP header definitions.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/SConscript SCons integration for HAL driver modules.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/Kconfig Kconfig entries for HAL drivers.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_can.c CAN/CANFD driver implementation for NS800.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_can.h CAN driver public definitions.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_config.h Driver configuration header.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_dma.h DMA-related definitions for drivers.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_ecap.c ECAP capture driver implementation.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_ecap.h ECAP driver public API/types.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_gpio.c GPIO/pin driver implementation.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_gpio.h GPIO driver public definitions.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_log.h Driver logging abstraction header.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_uart.c UART driver implementation.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/drv_uart.h UART driver public definitions.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/adc_config.h RT7 ADC configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/dac_config.h RT7 DAC configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/dma_config.h RT7 DMA configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/i2c_hard_config.h RT7 I2C hard/DMA config templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/lptim_config.h RT7 LPTIM configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/pwm_config.h RT7 PWM configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/qspi_config.h RT7 QSPI configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/sdio_config.h RT7 SDIO configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/spi_config.h RT7 SPI configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/tim_config.h RT7 timer configuration templates.
bsp/novosns/ns800/libraries/HAL_Drivers/drivers/config/rt7/uart_config.h RT7 UART configuration templates.
bsp/novosns/ns800/ns800rt7p65-nssinepad/.config Default RT-Thread configuration for the board.
bsp/novosns/ns800/ns800rt7p65-nssinepad/.gitignore BSP-local ignore patterns for build artifacts.
bsp/novosns/ns800/ns800rt7p65-nssinepad/Kconfig Board-level Kconfig integration.
bsp/novosns/ns800/ns800rt7p65-nssinepad/README.md Short board README (English).
bsp/novosns/ns800/ns800rt7p65-nssinepad/README_zh.md Board README (Chinese) with usage notes.
bsp/novosns/ns800/ns800rt7p65-nssinepad/rtconfig.h Generated/config header for the BSP build.
bsp/novosns/ns800/ns800rt7p65-nssinepad/rtconfig.py BSP build configuration script (SCons).
bsp/novosns/ns800/ns800rt7p65-nssinepad/SConscript BSP SCons sub-script.
bsp/novosns/ns800/ns800rt7p65-nssinepad/SConstruct BSP top-level SCons build entry.
bsp/novosns/ns800/ns800rt7p65-nssinepad/applications/SConscript SCons integration for application examples.
bsp/novosns/ns800/ns800rt7p65-nssinepad/applications/main.c Application entry point.
bsp/novosns/ns800/ns800rt7p65-nssinepad/applications/rt_can.c CAN example app/thread.
bsp/novosns/ns800/ns800rt7p65-nssinepad/applications/rt_can.h CAN example header placeholder.
bsp/novosns/ns800/ns800rt7p65-nssinepad/applications/rt_ecap.c ECAP example app.
bsp/novosns/ns800/ns800rt7p65-nssinepad/applications/rt_ecap.h ECAP example header.
bsp/novosns/ns800/ns800rt7p65-nssinepad/board/SConscript SCons integration for board sources.
bsp/novosns/ns800/ns800rt7p65-nssinepad/board/board.c Board init (clock/pin/heap/etc).
bsp/novosns/ns800/ns800rt7p65-nssinepad/board/board.h Board-level macros and pin definitions.
bsp/novosns/ns800/ns800rt7p65-nssinepad/board/Kconfig Board feature toggles (UART/GPIO/etc).
bsp/novosns/ns800/ns800rt7p65-nssinepad/board/linker_scripts/link.icf IAR linker script.
bsp/novosns/ns800/ns800rt7p65-nssinepad/board/linker_scripts/link.lds GCC linker script.
bsp/novosns/ns800/ns800rt7p65-nssinepad/board/linker_scripts/link.sct MDK/ARMCC scatter file.
bsp/novosns/ns800/ns800rt7p65-nssinepad/project.ewp IAR project file.
bsp/novosns/ns800/ns800rt7p65-nssinepad/project.eww IAR workspace file.
bsp/novosns/ns800/ns800rt7p65-nssinepad/project.uvoptx Keil uVision options file.
bsp/novosns/ns800/ns800rt7p65-nssinepad/project.uvprojx Keil uVision project file.
bsp/novosns/ns800/ns800rt7p65-nssinepad/template.ewp IAR template project.
bsp/novosns/ns800/ns800rt7p65-nssinepad/template.eww IAR template workspace.
bsp/novosns/ns800/ns800rt7p65-nssinepad/template.uvoptx Keil template options file.
bsp/novosns/ns800/ns800rt7p65-nssinepad/template.uvprojx Keil template project file.

Comment on lines +178 to +194
rt_size_t size = rt_strlen(str);

__write(0, str, size);
#else
rt_size_t i = 0, size = 0;
char a = '\r';
FILE f;

size = rt_strlen(str);

for (i = 0; i < size; i++)
{
if (*(str + i) == '\n')
{
fputc(a, &f);
}
fputc(str[i], &f);
Comment on lines +323 to +326
Interrupt_disable(uart->config->rx_irq_type);
if (direction == RT_DEVICE_FLAG_INT_RX)
{
UART_disableInterrupt(uart->handle.Instance, UART_INT_RX_DATA_REG_FULL);
Comment on lines +420 to +435
static rt_err_t ns800_pin_attach_irq(struct rt_device *device, rt_base_t pin,
rt_uint8_t mode, void (*hdr)(void *args), void *args)
{
return RT_EOK;
}

static rt_err_t ns800_pin_dettach_irq(struct rt_device *device, rt_base_t pin)
{
return RT_EOK;
}

static rt_err_t ns800_pin_irq_enable(struct rt_device *device, rt_base_t pin,
rt_uint8_t enabled)
{
return RT_EOK;
}
Comment on lines +1 to +4

#ifndef __DRV_CONFIG_H__
#define __DRV_CONFIG_H__

Comment on lines +24 to +26
rt_err_t res;
struct rt_can_msg rx_msg = {0};

Comment on lines +119 to +124
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
<Name>-U0670FF495355878281171423 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(6BA02477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC8000 -FN1 -FF0STM32H7x_2048.FLM -FS08000000 -FL0200000 -FP0($$Device:STM32H743ZITx$CMSIS\Flash\STM32H7x_2048.FLM)</Name>
</SetRegEntry>
Comment on lines +14 to +23
<Device>STM32H743ZITx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32H7xx_DFP.4.1.3</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000-0x2001FFFF) IRAM2(0x24000000-0x2407FFFF) IROM(0x8000000-0x81FFFFF) CLOCK(12000000) FPU3(DFPU) CPUTYPE("Cortex-M7") ELITTLE</Cpu>
<FlashUtilSpec />
<StartupFile />
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F746NGHx$CMSIS\Flash\STM32F7x_1024.FLM))</FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile>$$Device:STM32F746NGHx$Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f7xx.h</RegisterFile>
Comment on lines +119 to +124
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
<Name>-U0670FF495355878281171423 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(6BA02477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC8000 -FN1 -FF0STM32H7x_2048.FLM -FS08000000 -FL0200000 -FP0($$Device:STM32H743ZITx$CMSIS\Flash\STM32H7x_2048.FLM)</Name>
</SetRegEntry>
Comment on lines +117 to +126
while ((RCC_readHxtlRdyFlag() != 1) && (--wait_time));
while (wait_time == 0)
{
}

/* enable MIRC2 and HXTL kernal func */
RCC_enablePeriphKernalUseMirc2();
RCC_enablePeriphKernalUseHxtl();
/* select the HXTL as the working clocks for CANFD1 */
RCC_selectCanfdOscClkSource(RCC_CANFD1SEL, RCC_CANFD_OSCCLK_SEL_HXTLKER);
Comment on lines +1 to +5
#include <rtthread.h>
#include <rtdevice.h>
#include "drivers/dev_can.h"
#include "rt_can.h"

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

📌 Code Review Assignment

🏷️ Tag: workflow

Reviewers: Rbb666 kurisaW supperthomas

Changed Files (Click to expand)
  • .github/ALL_BSP_COMPILE.json

📊 Current Review Status (Last Updated: 2026-05-11 16:21 CST)

  • Rbb666 Pending Review
  • kurisaW Pending Review
  • supperthomas Pending Review

📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@github-actions github-actions Bot added the action github action yml imporve label May 11, 2026
@Rbb666 Rbb666 merged commit fd3cf81 into RT-Thread:master May 11, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action github action yml imporve BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants