ChibiOS/RT移植到STM32F407
来源:互联网 发布:ubuntu route设置 编辑:程序博客网 时间:2024/05/18 00:06
官网地址:
http://www.chibios.org/dokuwiki/doku.php
下载源码
找到STM32F407的demos程序(chibios\demos\STM32\RT-STM32F407-DISCOVERY
)
/* * This is a periodic thread that does absolutely nothing except flashing * a LED. */static THD_WORKING_AREA(waThread1, 128);static THD_FUNCTION(Thread1, arg) { (void)arg; chRegSetThreadName("blinker"); while (true) { palSetPad(GPIOD, GPIOD_LED3); /* Orange. 根据个人开发板配置*/ chThdSleepMilliseconds(500); palClearPad(GPIOD, GPIOD_LED3); /* Orange. */ chThdSleepMilliseconds(500); }}/* * Application entry point. */int main(void) { /* * System initializations. * - HAL initialization, this also initializes the configured device drivers * and performs the board-specific initializations. * - Kernel initialization, the main() function becomes a thread and the * RTOS is active. */ halInit(); chSysInit(); /* * Activates the serial driver 2 using the driver default configuration. * PA2(TX) and PA3(RX) are routed to USART2. */ sdStart(&SD2, NULL); //SD2,代表UART2 palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7)); //UART TX palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7)); //UART RX /* * Creates the example thread. 创建线程 */ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); /* * Normal main() thread activity, in this demo it does nothing except * sleeping in a loop and check the button state. */ while (true) { if (palReadPad(GPIOA, GPIOA_BUTTON)) TestThread(&SD2); chThdSleepMilliseconds(500); }}
使用烧写工具烧写。效果是串口不断打印TestThread中的信息,LED不断闪烁
阅读全文
1 0
- ChibiOS/RT移植到STM32F407
- zubax_gnss移植到STM32F407
- 移植u-boot到stm32f407
- 移植uClinux内核到stm32f407
- 移植 RT-Thread 到MB9BF218S
- 移植Qt程序到surface RT
- 移植rt-thread到esp8266笔记
- 移植RT-THREAD+LUA到STM32F4
- STM32F407上移植emwin
- rt3070 移植到at91 linux记录
- rt-thread移植STM32F103C8
- stm32F407 RT-thread V2.0.1 扩展系统串口设备
- 在龙芯1C上移植硬浮点FPU到RT-Thread
- RT 3570 wifi 移植手册
- RT 3570 wifi 移植手册
- uCOS-II在STM32F407上移植
- STM32F407和STM32F103的移植注意事项
- STM32F103至STM32F407程序移植参考
- java程序员从笨鸟到菜鸟之(二十)常用类Math和System
- 对Linux学习的看法
- Java并发编程:深入剖析ThreadLocal
- 阶层1
- 关于Python里面协程的一些理解
- ChibiOS/RT移植到STM32F407
- Codeforces 770D Draw Brackets! 模拟+中缀表达式
- LeetCode #718 Maximum Length of Repeated Subarray
- 20171104-程序员的自我修养
- C++动态内存管理(比较C动态内存管理)
- android下载解析xml
- GPIO口超强总结
- [bzoj4356][ceoi2014] wall
- PS之卡通徽章制作