Sync the HPMicro BSPs with hpm_sdk v1.13.0 and add the HPM5100EVK
(HPM5151) board.
- add the hpm5100evk BSP (board/startup/applications/Kconfig/docs) and
register it in .github/ALL_BSP_COMPILE.json, bsp/README.md and the
HPMicro READMEs
- re-sync the 11 existing boards (board/startup/debug scripts/linker
scripts/applications) with hpm_sdk v1.13.0, keeping the RT-Thread
specific parts: clock_time based drv_timer, CXX wired into the scons
environment, SConscript outputs under build/, named Kconfig choices,
rt_hw_us_delay in board_delay_*, board local codec files
- sync the shared driver layer with hpm_sdk v1.13.0 (GPTMRv2/PTMR,
PUART, soft I2C/SPI and the remaining peripheral driver updates)
- select the hpm_sdk v1.13.0 online package (PKG_USING_HPM_SDK_V113)
- use -Og instead of -O0 for the debug builds and print floats with the
RT-Thread klibc implementation instead of newlib nano
- initialize the RT-Thread heap before the SDK console init: the SDK
console_init() calls setvbuf(), which allocates through the C library
malloc() and tripped RT_ASSERT() in rt_smem_alloc() on the boards
built with RT_USING_DEBUG
- keep only ram_rtt.ld/flash_rtt.ld per board, align the DLM origin to
4KB on hpm5300evk/hpm5301evklite (the unaligned origin made the
linker emit a file backed PT_LOAD for the RAM area, which broke
"program rtthread.elf"), and anchor the generated .bin at the flash
base address 0x80000000
- sync the hpm6750evk openocd debug scripts with the new style used by
the other boards (hpm_common.cfg/hpm_reset.cfg with arp_halt)
- keep the upstream synced board/startup/libraries trees of bsp/hpmicro out of the
changed-file cppcheck run (same policy as bsp/hpmicro/.clang-format-ignore): the
check runs without the hpm_sdk include paths, so it reports ATTR_PLACE_AT and the
linker script symbol arithmetic in c_startup() as errors
- give the hpmicro boards in the changed-file scons trigger list the RV32 toolchain
they need (RISC-V-GCC-RV32) and add the matching installation step to that
workflow: the entries used sourcery-arm, which only provides the ARM toolchain,
so those legs could not find riscv32-unknown-elf-gcc
- keep hpm5100evk's ram_rtt.ld identical to the hpm_sdk v1.13.0
reference: the .fast_ram sections belong in DLM there (the DLM has
enough headroom), and that also makes its RAM and flash layouts agree
- skip the dependency pre-check when cleaning (scons -c): it runs from
DoBuilding() unconditionally, so a clean request with packages/ not
fetched yet was aborted with exit code 1 instead of cleaning
- make the manual scons trigger workflow runnable: it aborted while still
downloading actions because actions/upload-artifact@v3 is deprecated,
and scons was not on PATH because ~/.env/env.sh was never sourced.
Install tools/requirements.txt and source the Env PATH script in the
build step, and use @main action versions, as bsp_buildings.yml does
- start the LED demo thread only when rt_thread_create() succeeded
Tested:
- 12 boards x {ram_debug, ram_release, flash_debug, flash_release}:
48/48 clean builds
- flash boot + msh on hpm5100evk, hpm5300evk, hpm5e00evk, hpm6200evk,
hpm6300evk, hpm6750evk, hpm6750evk2, hpm6750evkmini, hpm6800evk,
hpm6e00evk, hpm6p00evk (list device/timer, ps, free, reset, rt_kprintf
float formatting)
- re-ran .github/workflows/manual_trigger_scons_except_STM32_all.yml with
the matrix reduced to the three hpmicro rows: all three legs build and
scons --dist succeeds with no local workarounds
HPMicro Board Support Package (BSP) Introduction
中文页 |
Introduction
This document provides an overview of the HPMicro BSPs (Board Support Package) available in the RT-Thread repository. Each BSP is tailored for specific HPMicro development boards, offering necessary drivers and configurations to run RT-Thread seamlessly on RISC-V based HPMicro microcontrollers.
The document consists of the following parts:
- HPMicro BSP Overview
- Available BSPs
- Quick Start Guide
- Common Development Environment Setup
- References
By reading the Quick Start Guide section, developers can quickly get their hands on any HPMicro BSP and run RT-Thread on the board. Each individual BSP contains detailed documentation for specific board features and advanced usage.
Available BSPs
Below is a comprehensive list of HPMicro BSPs currently supported:
| BSP Name | Supported Board | MCU | Description |
|---|---|---|---|
| hpm5300evk | HPM5300EVK | HPM5361 | Development board for HPM5300 series |
| hpm5301evklite | HPM5301EVKLITE | HPM5301 | Lite version development board for HPM5301 |
| hpm5e00evk | HPM5E00EVK | HPM5E31 | Development board for HPM5E00 series |
| hpm6200evk | HPM6200EVK | HPM6200 | Development board for HPM6200 series |
| hpm6300evk | HPM6300EVK | HPM6360 | Development board for HPM6300 series with Ethernet support |
| hpm6750evk | HPM6750EVK | HPM6750 | Development board for HPM6750 series with dual-core RISC-V |
| hpm6750evk2 | HPM6750EVK2 | HPM6750 | Second generation development board for HPM6750 series |
| hpm6750evkmini | HPM6750EVKMINI | HPM6750 | Mini development board for HPM6750 series |
| hpm6800evk | HPM6800EVK | HPM6800 | Development board for HPM6800 series |
| hpm6e00evk | HPM6E00EVK | HPM6E00 | Development board for HPM6E00 series |
| hpm6p00evk | HPM6P00EVK | HPM6P00 | Development board for HPM6P00 series |
| hpm5100evk | HPM5100EVK | HPM5100 | Development board for HPM5100 series |
Quick Start Guide
Prerequisites
Before getting started with any HPMicro BSP, you need to prepare the following development environment:
1. RT-Thread ENV
- Download and install RT-Thread ENV
2. RISC-V Toolchain
- Download the RISC-V toolchain: riscv32-gnu-toolchain
- Extract it to a specified directory, for example:
C:\DevTools\riscv32-gnu-toolchain - Set environment variable
RTT_RISCV_TOOLCHAINto<TOOLCHAIN_DIR>\bin- For example:
C:\DevTools\riscv32-gnu-toolchain\bin
- For example:
3. OpenOCD for HPMicro
- Download OpenOCD: rtt-debugger-support-package
- Extract it to a specified directory, for example:
C:\DevTools\openocd-hpmicro - Set environment variable
OPENOCD_HPMICROto<OPENOCD_HPMICRO_DIR>\bin- For example:
C:\DevTools\openocd-hpmicro\bin
- For example:
Getting Started with a Specific BSP
-
Navigate to the desired BSP directory:
cd rt-thread/bsp/hpmicro/<bsp_name> -
Configure the project:
- Open RT-Thread ENV command-line
- Change directory to the BSP directory
- Run
menuconfigto configure the project
-
Build the project:
scons -jN # N equals to the number of CPU cores -
Hardware Connection:
- Switch BOOT pin to 2'b00
- Connect the
PWR_DEBUGport to PC via TYPE-C cable
-
Download and Debug:
- Use the provided OpenOCD scripts for downloading and debugging
- Refer to individual BSP README files for specific commands
Running Results
Once the project is successfully downloaded, the system runs automatically. The LED on the board will flash periodically.
Connect the serial port of the board to the PC, communicate with it via a serial terminal tool (115200-8-1-N). Reset the board and the startup information of RT-Thread will be observed:
\ | /
- RT - Thread Operating System
/ | \ 5.2.2 build Aug 16 2025 18:18:18
2006 - 2025 Copyright by RT-Thread team
msh >
Common Peripheral Support
Most HPMicro BSPs support the following peripherals:
| On-board Peripherals | Support | Note |
|---|---|---|
| USB | √ | |
| QSPI Flash | √ | |
| GPIO | √ | |
| SPI | √ | |
| I2C | √ | |
| UART | √ | |
| PWM | √ | |
| RTC | √ | |
| On-Board Debugger | √ | ft2232 |
Additional peripherals may be supported depending on the specific board:
- Ethernet: Available on
- HPM6300EVK
- HPM6750EVK
- HPM6750EVK2
- HPM6750EVKMINI + ART-Pi Industry IO extension
- HPM6800EVK
- HPM6E00EVK
- HPM6P00EVK
- HPM5E00EVK
- CAN: Available on HPM6750 series Development Boards, HPM5300EVK, HPM6800EVK, HPM6E00EVK, HPM6P00EVK, HPM5E00EVK and HPM5100EVK
- SDIO: Available on HPM6300EVK, HPM6750EVKMINI, HPM6750EVK, HPM6750EVK2 and HPM6800EVK
- Display/Audio: Available on HPM6750EVK, HPM6800EVK, HPM6E00EVK,HPM6P00EVK
Development Environment Setup
Using Command Line Tools
- Set up the environment variables as described in the Prerequisites section
- Use
sconsfor building - Use OpenOCD and GDB for debugging or use the Ozone + JLink for debugging
Individual BSP Documentation
Each BSP contains its own detailed README file with:
- Board-specific hardware information
- Peripheral configuration details
- Specific download and debug commands
- Advanced features and examples
Please refer to the individual BSP directories for detailed documentation:
hpm5300evk/README.mdhpm5301evklite/README.mdhpm5e00evk/README.mdhpm6200evk/README.mdhpm6300evk/README.mdhpm6750evk/README.mdhpm6750evk2/README.mdhpm6750evkmini/README.mdhpm6800evk/README.mdhpm6e00evk/README.mdhpm6p00evk/README.mdhpm5100evk/README.md
Troubleshooting
Common Issues
- Toolchain not found: Ensure
RTT_RISCV_TOOLCHAINenvironment variable is set correctly - OpenOCD connection failed: Check USB connection and driver installation
- Build errors: Verify all dependencies are installed and environment variables are set
- Serial communication issues: Check baud rate (115200) and COM port settings
Getting Help
- Check the individual BSP README files for board-specific issues
- Visit RT-Thread Community
- Refer to RT-Thread Documentation
References
- RT-Thread Document Center
- RT-Thread ENV
- HPMicro Official Website
- HPMicro SDK Documentation
- RISC-V Toolchain
Contributing
Contributions to enhance existing BSPs or add new ones are welcome. Please follow the RT-Thread contribution guidelines and ensure that your BSP adheres to the project's standards.
For contributing to HPMicro BSPs:
- Fork the
RT-Threadrepository - Create a feature branch
- Make your changes following the existing code style
- Test your changes thoroughly
- Submit a pull request with a clear description
License
This BSP is released under the RT-Thread license.