STM32学习笔记9——移植FreeRTOS

开发环境
硬件环境:STM32F103C8T6
软件环境:STM32CubeIDE1.4.0

前置条件

FreeRTOS移植

1.移植FreeRTOS源码
  • 在工程文件中新建文件夹 —— FreeRTOS(存储FreeRTOS源码)
    在这里插入图片描述
    *打开 FreeRTOS 源码文件夹, 将其中的include文件夹复制到刚刚新建的FreeRTOS文件夹中。
    在这里插入图片描述
  • 然后include同目录下新建一个文件夹——portable
  • 进入portable文件夹,在FreeRTOS源码文件夹的FreeRTOSv202012.00\FreeRTOS\Source\portable\GCC\ARM_CM3的路径下,将port.c和portmacro.h文件复制到刚刚新建的protable文件夹中,并将FreeRTOSv202012.00\FreeRTOS\Source\portable\MemMang路径下的heap_4.h也复制到protable文件夹中,此时文件夹中存在以下三个文件。
    在这里插入图片描述
  • 再次打开FreeRTOS源码文件夹,在FreeRTOSv202012.00\FreeRTOS\Source路径下,将所有的.c文件复制到工程的FreeRTOS文件夹中。
    在这里插入图片描述
  1. 拷贝FreeRTOSConfig.h文件到src文件夹中
  • 打开FreeRTOS源码文件夹,在FreeRTOSv202012.00\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC路径下,将FreeRTOSConfig.h文件拷贝到工程的src文件夹下。
    在这里插入图片描述
    3.配置FreeRTOS源码到工程文件中
    右键点击工程名——点击Properties进入配置页——点击Paths and Symbols选项——添加Includes路径
    在这里插入图片描述
    选择Source Location添加源文件路径
    在这里插入图片描述
    4.修改FreeRTOSConfig.h文件
/*
    FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
    All rights reserved

    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.

    This file is part of the FreeRTOS distribution.

    FreeRTOS is free software; you can redistribute it and/or modify it under
    the terms of the GNU General Public License (version 2) as published by the
    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.

    ***************************************************************************
    >>!   NOTE: The modification to the GPL is included to allow you to     !<<
    >>!   distribute a combined work that includes FreeRTOS without being   !<<
    >>!   obliged to provide the source code for proprietary components     !<<
    >>!   outside of the FreeRTOS kernel.                                   !<<
    ***************************************************************************

    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    FOR A PARTICULAR PURPOSE.  Full license text is available on the following
    link: http://www.freertos.org/a00114.html

    ***************************************************************************
     *                                                                       *
     *    FreeRTOS provides completely free yet professionally developed,    *
     *    robust, strictly quality controlled, supported, and cross          *
     *    platform software that is more than just the market leader, it     *
     *    is the industry's de facto standard.                               *
     *                                                                       *
     *    Help yourself get started quickly while simultaneously helping     *
     *    to support the FreeRTOS project by purchasing a FreeRTOS           *
     *    tutorial book, reference manual, or both:                          *
     *    http://www.FreeRTOS.org/Documentation                              *
     *                                                                       *
    ***************************************************************************

    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
    the FAQ page "My application does not run, what could be wrong?".  Have you
    defined configASSERT()?

    http://www.FreeRTOS.org/support - In return for receiving this top quality
    embedded software for free we request you assist our global community by
    participating in the support forum.

    http
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值