背景
- 目标为进一步研究RT-Thread,掌握系统移植的基本方法
- RT-Thread 最新代码BSP里,已经有STM32H743的BSP了。
操作方法








运行
LED |
引脚 |
RT-Thread Pin 编号 |
LED_R 红色 |
PB14 |
GET_PIN(B, 14) |
LED_G 绿色 |
PB0 |
GET_PIN(B, 0) |
LED_Y 黄色 |
PE1 |
GET_PIN(E, 1) |
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
/* defined the LEDR LEDG LEDY pins */
#define LEDR_PIN GET_PIN(B, 14)
#define LEDG_PIN GET_PIN(B, 0)
#define LEDY_PIN GET_PIN(E, 1)
int main(void)
{
int count = 1;
/* set LEDS pin mode to output */
rt_pin_mode(LEDR_PIN, PIN_MODE_OUTPUT);
rt_pin_mode(LEDG_PIN, PIN_MODE_OUTPUT);
rt_pin_mode(LEDY_PIN, PIN_MODE_OUTPUT);
rt_kprintf("hello, STM32H743 RT-Thread!\r\n");
while (count++)
{
rt_pin_write(LEDR_PIN, PIN_HIGH);
rt_pin_write(LEDG_PIN, PIN_HIGH);
rt_pin_write(LEDY_PIN, PIN_HIGH);
rt_thread_mdelay(500);
rt_pin_write(LEDR_PIN, PIN_LOW);
rt_pin_write(LEDG_PIN, PIN_LOW);
rt_pin_write(LEDY_PIN, PIN_LOW);
rt_thread_mdelay(500);
}
return RT_EOK;
}

总结
- STM32H743 资源比较丰富,有2M Flash,SRAM也比较大(1M,用户512K),可以做点更复杂的工作。
- 继续研究RT-Thread 移植与使用,总结与积累,学以致用。