Skip to content

ShadowThree/SystemView_FreeRTOS_Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

参考

  1. FreeRTOS_with_SystemView

说明

  1. 本工程使用RTT用于日志输出以及SystemView事件跟踪;
  2. 本工程通过CubeMX生成的FreeRTOS相关代码版本为FreeRTOS V10.3.1
  3. 本工程使用了dbgerSystemView

使用

  1. 通过git submodule add https://github.com/ShadowThree/SystemView.git ThirdUtils/SystemView添加本项目到工程指定目录;
  2. 添加如下头文件路径到工程:
../ThirdUtils/SystemView/FreeRTOS_V10.3.1_portable_RVDS_ARM_CM4F_SystemView_FreeRTOS10_Patch    // 必须添加到 FreeRTOS 相关头文件之前
../ThirdUtils/SystemView/Config
../ThirdUtils/SystemView/Sample/FreeRTOSV10     // 因为 FreeRTOS 源码版本为 V10.3.0,所以选择这个
../ThirdUtils/SystemView/SEGGER
  1. 添加如下源文件到工程:
ThirdUtils\SystemView\FreeRTOS_V10.3.1_portable_RVDS_ARM_CM4F_SystemView_FreeRTOS10_Patch\port.c
ThirdUtils\SystemView\FreeRTOS_V10.3.1_portable_RVDS_ARM_CM4F_SystemView_FreeRTOS10_Patch\tasks.c
ThirdUtils\SystemView\Sample\FreeRTOSV10\SEGGER_SYSVIEW_FreeRTOS.c
ThirdUtils\SystemView\Sample\FreeRTOSV10\Config\Cortex-M\SEGGER_SYSVIEW_Config_FreeRTOS.c
ThirdUtils\SystemView\SEGGER\SEGGER_RTT.c
ThirdUtils\SystemView\SEGGER\SEGGER_SYSVIEW.c
  1. MDK keil选中如下文件 --> 右击 --> Options for File,去掉Include in Target Build前面的勾:
Middlewares/FreeRTOS/tasks.c        // 被 SystemView 中的 Patch 文件修改了
Middlewares/FreeRTOS/port.c         // 被 SystemView 中的 Patch 文件修改了
LOG/SEGGER_RTT.c                    // 和 SystemView 共用,在 SystemView 已经添加了
  1. FreeRTOSConfig.h中引入如下头文件:
#include "SEGGER_SYSVIEW_FreeRTOS.h"
  1. MDK keil的魔术棒 --> C/C++ 中勾选GNU extensions
  2. main.c中调用SEGGER_SYSVIEW_Conf();配置SystemView;
  3. 编译下载,打开SystemView软件启动接收即可;

注意

  1. 只能在ARM Compiler V5下移植;
  2. SEGGER_SYSVIEW_Conf.h中添加如下定义:
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
  1. FreeRTOS开始调度之前,执行如下代码:
// 在 RTOS 环境中,只需要 Conf 即可
SEGGER_SYSVIEW_Conf();

// 以下两个只有在非 RTOS 环境下才需要
// SEGGER_SYSVIEW_Start();
// SEGGER_SYSVIEW_OnIdle();

About

systemview, stm32v6, stm32f429, freertos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published