摘要
RT-Thread 是一款开源的嵌入式实时操作系统(Real-Time Operating System,RTOS),因其组件丰富、可裁剪性好等特点在物联网领域得到广泛应用。TH4001 是一款面向轻量级嵌入式控制场景的 32 位精简指令集架构(Reduced Instruction Set Computer-V, RISC-V)处理器芯片,片内静态随机存取存储器(Static Random Access Memory,SRAM)容量受限,且缺少标准硬件标准通用异步收发传输器(Universal Asynchronous Receiver/Transmitter,UART)等外设资源。目前,关于将RT-Thread操作系统移植到TH4001平台尚无成熟方案。针对此问题,本文提出了一种在TH4001芯片上移植RT-Thread的完整方案,重点解决SRAM容量受限和无 UART 问题,采用混合加载运行架构实现系统启动,并通过可编程输入输出(Programmable Input/Output,PIO)模块模拟 UART 控制台输出。实验结果表明,移植后的RT-Thread系统能够成功启动并运行用户 main 线程以及上下文切换逻辑,为同类型资源受限 RISC-V 芯片的 RTOS 移植提供参考方案。
Abstract
RT-Thread is an open-source embedded Real-Time Operating System (RTOS) that has been widely adopted in the Internet of Things (IoT) domain due to its rich components and excellent tailorability. TH4001 is a 32-bit Reduced Instruction Set Computer-V (RISC-V) processor chip targeted at lightweight embedded control scenarios. It suffers from limited on-chip Static Random Access Memory (SRAM) capacity and is not equipped with standard hardware peripherals such as the Universal Asynchronous Receiver/Transmitter (UART). To date, no mature solution exists for porting the RT-Thread operating system to the TH4001 platform. To fill this gap, this paper presents a complete RT-Thread porting scheme for the TH4001 chip, focusing on addressing the constraints of insufficient SRAM capacity and the lack of UART peripherals. The scheme adopts a hybrid loading and running architecture for system booting, and leverages the Programmable I/O (PIO) module to emulate a UART interface for console output. Experimental results demonstrate that the ported RT-Thread system boots successfully, runs the user main thread, and correctly performs context switching. This work serves as a reference solution for porting RTOS to similarly resource-constrained RISC-V chips.
关键词
RT-Thread /
实时操作系统 /
移植方法 /
RISC-V /
TH4001
Key words
RT-Thread /
real-time operating system /
Porting Method /
RISC-V /
TH4001
吴海康, 刘文博, 李云初, 王雨禾, 秦军瑞.
面向低资源芯片的RT-Thread移植方法研究——以TH4001为例[J]. 集成电路与嵌入式系统. 0 https://doi.org/10.20193/j.ices2097-4191.2026.0038
Research on RT-Thread Porting Method for Resource-Constrained Chips: A Case Study of TH4001[J]. Integrated Circuits and Embedded Systems. 0 https://doi.org/10.20193/j.ices2097-4191.2026.0038
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
基金
面向AIoT生态的软硬件协同敏捷设计(2024YFB4505400); 广东省高端集成电路设计与集成技术重点实验室(2024B1212020007)