uCOS2源码分析1-BSP部分(二)

本文分析了uCOS2在STM32上的移植,涉及ucos2目录结构、工程建立过程,特别是BSP(板级支持包)的源码解析。 BSP包括系统时钟配置、GPIO、中断表和串口初始化,其移植工作量大。在BSP源码测试中,重点介绍了如何移植和测试printf函数以实现串口输出。
摘要由CSDN通过智能技术生成

注:本课件参考朱有鹏老师单片机系列课程课件

本章节主要的内容分为如下的几大部分

一、熟悉ucos2目录结构

原始结构: 这里主要包含应用层的app目录,底软相关的BSP目录,ucos相关的uc目录,串口相关的usart目录,其他编译生成的文件。
移植后的结构: 这里主要是删除了编译后生成的文件夹,生成了工程相关的lst、out、project文件,新增了CMSIS文件夹和STM32F10x_stdPeriph_driver.
这里对于新增的这两个文件夹进行一个解释:
CMSIS 这是arm的微控制器软件接口标准,作用是向下负责于内核和各个外设打交道,向上提供实时操作系统用户程序调用的接口,详细可参考:
CMSIS到底是个什么东西

STM32F10x_stdPeriph_driver:使用标准外设驱动
在这里插入图片描述

二、工程建立

目前没有开发板,不能进行debug,所以目前的侧重点是在使用source insight 进行代码熟悉,以及ucos的学习

三、BSP的源码解析

\SOFTWARE The main directory from the root where all software-related files are placed. \SOFTWARE\BLOCKS The main directory where all ‘Building Blocks’ are located. With μC/OS-II, I included a ‘building block’ that handles DOS-type compatible functions that are used by the example code. \SOFTWARE\BLOCKS\TO This directory contains the files for the TO utility (see Appendix E, TO). The source file is TO.C and is found in the \SOFTWARE\TO\SOURCE directory. The DOS executable file (TO.EXE) is found in the \SOFTWARE\TO\EXE directory. Note that TO requires a file called TO.TBL which must reside on your root directory. An example of TO.TBL is also found in the \SOFTWARE\TO\EXE directory. You will need to move TO.TBL to the root directory if you are to use TO.EXE. \SOFTWARE\uCOS-II The main directory where all μC/OS-II files are located. \SOFTWARE\uCOS-II\EX1_x86L This directory contains the source code for EXAMPLE #1 (see section 1.07, Example #1) which is intended to run under DOS (or a DOS window under Windows 95). \SOFTWARE\uCOS-II\EX2_x86L This directory contains the source code for EXAMPLE #2 (see section 1.08, Example #2) which is intended to run under DOS (or a DOS window under Windows 95). \SOFTWARE\uCOS-II\EX3_x86L This directory contains the source code for EXAMPLE #3 (see section 1.09, Example #3) which is intended to run under DOS (or a DOS window under Windows 95). \SOFTWARE\uCOS-II\Ix86L This directory contains the source code for the processor dependent code (a.k.a. the port) of μC/OS-II for an 80x86 Real-Mode, Large Model processor. \SOFTWARE\uCOS-II\SOURCE This directory contains the source code for processor independent portion of μC/OS-II. This code is fully portable to other processor architectures.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值