[BSP] ADD ns800 BSP#11382
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
There was a problem hiding this comment.
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. |
| 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); |
| 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); |
| 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; | ||
| } |
|
|
||
| #ifndef __DRV_CONFIG_H__ | ||
| #define __DRV_CONFIG_H__ | ||
|
|
| rt_err_t res; | ||
| struct rt_can_msg rx_msg = {0}; | ||
|
|
| <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> |
| <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> |
| <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> |
| 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); |
| #include <rtthread.h> | ||
| #include <rtdevice.h> | ||
| #include "drivers/dev_can.h" | ||
| #include "rt_can.h" | ||
|
|
📌 Code Review Assignment🏷️ Tag: workflowReviewers: Rbb666 kurisaW supperthomas Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-05-11 16:21 CST)
📝 Review Instructions
|
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up