背景
- 目标为进一步研究RT-Thread,掌握系统移植的基本方法
- RT-Thread 最新代码BSP里,已经有STM32H743的BSP了。
操作方法
![2021-01-24_225916.png](https://img-blog.csdnimg.cn/img_convert/f463debab6e29325c79a3f4688514f95.png)
![2021-01-24_230050.png](https://img-blog.csdnimg.cn/img_convert/7a82051a3ee9c66a9323a831828f9703.png)
![2021-01-24_230634.png](https://img-blog.csdnimg.cn/img_convert/a63da3d69d02ef7ab2e3bdd65d02492b.png)
![2021-01-24_230804.png](https://img-blog.csdnimg.cn/img_convert/bcd1b3ac868d24b6bf9e1d50bb626eda.png)
![2021-01-24_231054.png](https://img-blog.csdnimg.cn/img_convert/c0fb9a9e5db78d3ef3b39bc8b61c2144.png)
![2021-01-24_231221.png](https://img-blog.csdnimg.cn/img_convert/facbc7fc8527e09ff231508d41217436.png)
![2021-01-24_231342.png](https://img-blog.csdnimg.cn/img_convert/d20bef7e0bafad4700f3ca891aafcb18.png)
![2021-01-24_231434.png](https://img-blog.csdnimg.cn/img_convert/33ed51d8fae087fe9de956e823e6f757.png)
运行
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;
}
![2021-01-24_232214.png](https://img-blog.csdnimg.cn/img_convert/b73e199fc1cf8c008d0973ab8f30d725.png)
总结
- STM32H743 资源比较丰富,有2M Flash,SRAM也比较大(1M,用户512K),可以做点更复杂的工作。
- 继续研究RT-Thread 移植与使用,总结与积累,学以致用。