ChibiOS/RT移植到STM32F407
官网地址: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不断闪烁
ChibiOS/RT移植到STM32F407的更多相关文章
- zubax_gnss移植到STM32F407
源码下载:https://github.com/Zubax/zubax_gnss.git 源码默认支持STM32F107芯片 STM32 HAL库测试:zubax_gnss\bootloader\zu ...
- ChibiOS/RT 2.6.9 CAN Driver
Detailed Description Generic CAN Driver. This module implements a generic CAN (Controller Area Netwo ...
- rt—移植笔记1
将rtt源码往stm32f407移植的时候,源码串口打印引脚设置有误,以下是源码引脚配置. 以下是原理图 可见配置有误.
- rt—移植笔记2(Lwip)
首先参考f107已经有的目录结构添加Lwip这一组,添加各种.c文件及.文件. 还有drive下边的很重要的eth.c 到此,工程编译通过.(刚开始,小编是一个一个 的比对...一个一个错误排查... ...
- ChibiOS/RT 2.6.9 CAN Low Level Driver for STM32
/* ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio Licensed under the Apache License, Version 2 ...
- LwIP移植uCos+stm32f407
LwIP同操作系统一起工作的时候模型如下: 1.TCP/IP协议栈和应用程序以分离的任务运行 2.应用同协议栈沟通是通过API函数调用(API函数调用事实上就是通过OS自带的进程间通信机制,由应用程序 ...
- freeRTOS V10.0.1移植到STM32F407标准库 - 环境Keil5
最近因为工作需要用到FreeRTOS,其实开始本人内心是拒绝的因为自己只学习过UCOSIII还没实际上过什么大又复杂的工程,但是谁让FreeRTOS他是Free的呢公司成本考虑肯定是不会选择USOS的 ...
- 【WP 8.1开发】如何把自定义字体塞进应用里
或许,系统自带的字体不足以体现应用程序的魅力,对于表现极强的汉字来说,更是如此.这时候,我们就会想,要是能把网上下载的艺术字体塞到应用包中,那岂不美哉?那么,这可以实现吗?答案是Yes的. 接下来,阿 ...
- Open Source RTOS
http://www.osrtos.com/ Name License Platforms Description Last updated FreeRTOS Modified GPL MSP ...
随机推荐
- 深度学习:21天实战caffe学习资源-4-环境安装
使用anaconda3环境下的python2.7, 机器macos mojave 10.14 1.安装Xcode 首先现在app store中安装Xcode: 不然会有” framework not ...
- 【431】Prim 算法 & Kruskal 算法
Prim 算法: Minimum Spanning Tree(MST):最小生成树,就是连接所有节点的最小权值 mst集合与rest集合 mst集合中顶点,找到一条最小权值的边 然后把边相关的顶点,选 ...
- Spring Cloud Config 分布式配置管理 5.3
Spring Cloud Config简介 在传统的单体式应用系统中,我们通常会将配置文件和代码放在一起,但随着系统越来越大,需要实现的功能越来越多时,我们又不得不将系统升级为分布式系统,同时也会将系 ...
- clientHeight,offsetHeight,scrollHeight迷一样的三个值
https://blog.csdn.net/qq_39083004/article/details/78498178 https://www.imooc.com/article/17571 推荐 o ...
- LeetCode_383. Ransom Note
383. Ransom Note Easy Given an arbitrary ransom note string and another string containing letters fr ...
- 微信小程序技巧记录
1.直接在app.json中添加pages,会自动按照路径生成page目录文件: 2.动态修改样式: /** * 页面的初始数据 */ data: { authorInfo: [], article: ...
- 使用JSQLParser解析SQL中涉及到的表
首先添加Maven依赖: <dependency> <groupId>com.github.jsqlparser</groupId> <artifactId& ...
- 【ARTS】01_40_左耳听风-201900812~201900818
ARTS: Algrothm: leetcode算法题目 Review: 阅读并且点评一篇英文技术文章 Tip/Techni: 学习一个技术技巧 Share: 分享一篇有观点和思考的技术文章 Algo ...
- 线性链条件随机场(CRF)的原理与实现
基本原理 损失函数 (线性链)CRF通常用于序列标注任务,对于输入序列\(x\)和标签序列\(y\),定义匹配分数: \[ s(x,y) = \sum_{i=0}^l T(y_i, y_{i+1}) ...
- centos7修改yum源为阿里镜像
参考博客: https://blog.csdn.net/kxwinxp/article/details/78578492 https://blog.csdn.net/inslow/article/de ...