XILNIXSDK2018为FreeRTOS增加配置项的方法

原创 2018年04月14日 16:23:06

在安装目录下找到目录:

SDK\2018.1\data\embeddedsw\ThirdParty\bsp\freertos10_xilinx_v1_0\data

 

然后通过两个步骤来完成配置项的增加。

 

(1) 编辑文件freertos10_xilinx.mld,为配置界面增加项目

用文本编辑器打开freertos10_xilinx.mld文件,通过手动编辑文件添加配置项

如想添加FreeRTOSconfigSUPPORT_STATIC_ALLOCATION配置,采取如下步骤:

1. 为这个配置项取一个适当的名字(不冲突),这里取为support_static_allocation

2. 设置好类型,这里为bool,缺省值,描述(随便看得明白即可)等

3. 找一个行当的分组,这里选kernel_behavior类别

BEGIN CATEGORY kernel_behavior

4. 在选中的类别里添加一行,这里为

PARAM name = support_static_allocation, type = bool, default = false, desc = "Support static allocation memory for FreeRTOS objects.";

添加后变成:

BEGIN CATEGORY kernel_behavior

PARAM name = kernel_behavior, type = bool, default = true, desc = "Parameters relating to the kernel behavior", permit = none;

PARAM name = max_api_call_interrupt_priority, type = int, default = 18, desc = "The maximum interrupt priority from which interrupt safe FreeRTOS API calls can be made.";

PARAM name = use_preemption, type = bool, default = true, desc = "Set to true to use the preemptive scheduler, or false to use the cooperative scheduler.";

PARAM name = tick_rate, type = int, default = 100, desc = "Number of RTOS ticks per sec";

PARAM name = idle_yield, type = bool, default = true, desc = "Set to true if the Idle task should yield if another idle priority task is able to run, or false if the idle task should always use its entire time slice unless it is preempted.";

PARAM name = max_priorities, type = int, default = 8, desc = "The number of task priorities that will be available.  Priorities can be assigned from zero to (max_priorities - 1)";

PARAM name = minimal_stack_size, type = int, default = 200, desc = "The size of the stack allocated to the Idle task. Also used by standard demo and test tasks found in the main FreeRTOS download.";

PARAM name = total_heap_size, type = int, default = 65536, desc = "Sets the amount of RAM reserved for use by FreeRTOS - used when tasks, queues, semaphores and event groups are created.";

PARAM name = max_task_name_len, type = int, default = 10, desc = "The maximum number of characters that can be in the name of a task.";

PARAM name = use_timeslicing, type = bool, default = true, desc = "When true equal priority ready tasks will share CPU time with a context switch on each tick interrupt.";

PARAM name = use_port_optimized_task_selection, type = bool, default = true, desc ="When true task selection will be faster at the cost of limiting the maximum number of unique priorities to 32.";

PARAM name = support_static_allocation, type = bool, default = false, desc = "Support static allocation memory for FreeRTOS objects.";

END CATEGORY

 

(2) 编辑文件freertos10_xilinx.tcl,为最后生成的配置文件增加项目

用文本编辑器打开freertos10_xilinx.tcl文件,通过手动编辑文件添加配置项

如想添加FreeRTOSconfigSUPPORT_STATIC_ALLOCATION配置,采取如下步骤:

1. 找到文件中下面的内容:

############################################################################

## Add constants common to all architectures to the configuration file.

############################################################################

 

set config_file [xopen_new_include_file "./src/FreeRTOSConfig.h" "FreeRTOS Configuration parameters"]

puts $config_file "\#include \"xparameters.h\" \n"

 

2. 添加几行内容:

set val [common::get_property CONFIG.support_static_allocation $os_handle]

if {$val == "false"} {

xput_define $config_file "configSUPPORT_STATIC_ALLOCATION" "0"

} else {

xput_define $config_file "configSUPPORT_STATIC_ALLOCATION" "1"

}

注意上面的support_static_allocation是第一步为configSUPPORT_STATIC_ALLOCATION取的名字。

 

保存文件,重启SDK,打开BSP settings界面

 

 

然后可以看到界面上增加了配置选项:

 

 

配置完成后,重新生成BSP代码:

 

 

然后查看配置文件:

 

 

可以看到,在BSPFreeRTOSConfig.h文件中增加了一行:

#define configSUPPORT_STATIC_ALLOCATION 1

 

 

freeRTOS 一步步学习(二)

freeRTOS 一步步学习(二) 任务状态 应用程序可以包含多个任务。如果运行应用程序的微控制器只有一个核(core),那么在任意给定时间,实际上只会有一个任务被执行。这就意味着一个任务可以...
  • xingyuan1hao
  • xingyuan1hao
  • 2016-12-03 16:43:14
  • 676

嵌入式FreeRTOS操作系统原理

1、FreeRTOS操作系统功能 作为一个轻量级的操作系统,FreeRTOS提供的功能包括:任务管理、时间管理、信号量、消息队列、内存管理、记录功能等,可基本满足较小系统的需要。FreeRTOS内核...
  • sinat_23338865
  • sinat_23338865
  • 2016-09-23 10:48:21
  • 1266

软件配置项测试要点

软件配置项内容包括:功能测试、性能测试、外部接口测试、余量测试和边界测试,必要时,应包括人机交互界面测试、强度测试、可靠性测试、安全性测试、恢复性测试、安装性测试、互操作性测试、敏感性测试等内容。 ...
  • u014357995
  • u014357995
  • 2015-04-19 16:29:02
  • 2754

FreeRtos内存管理

FreeRtos内存管理标签(空格分隔): FreeRtos内存 FreeRtos的内存管理接口,都遵循POSIX接口标准.可移植操作系统接口(英语:Portable Operating Syst...
  • jndxcsc
  • jndxcsc
  • 2017-08-18 16:42:06
  • 303

FreeRTOS 抢占式调度器的实现

通过如下的框图来说明枪占式调度器在FreeRTOS中的运行过程,让大家有一个形象的认识: 运行条件:  此框图是FreeRTOS操作系统运行过程中的一部分。  这...
  • ZhaoFa_JLU
  • ZhaoFa_JLU
  • 2016-10-14 17:33:12
  • 1380

STM32F103上移植的FreeRTOS纯净版(MDK工程)

  • 2016年04月16日 09:39
  • 2.11MB
  • 下载

FreeRTOS计数型信号量

API函数 //创建 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #define xSemaphoreCreateCounting( uxM...
  • zhangxuechao_
  • zhangxuechao_
  • 2018-02-07 16:18:15
  • 70

Project00:FreeRTOS工程集成SystemView

码云项目:https://gitee.com/bigvan_tech/FreeRTOS_STM32Project.git FreeRTOS_STM32Project SystemView对于学习F...
  • weixin_38285895
  • weixin_38285895
  • 2018-01-11 21:45:08
  • 587

FreeRTOS 学习笔记 3 —— 任务状态机之阻塞

FreeRTOS 会创建很多任务,每个任务有相同或不同的优先级,如果让任务全都处于准备执行状态,那么只有优先级最高的任务一直在执行,优先级低的任务全都被 “饿死” 了。为了解决这个问题,添加了 “阻塞...
  • haozi0_0
  • haozi0_0
  • 2015-07-29 15:38:18
  • 2142

FreeRTOS任务运行时间信息统计

相关宏的设置 configGENERATE_RUN_TIME_STATS //使能 portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() //配置一个高精度定时...
  • zhangxuechao_
  • zhangxuechao_
  • 2018-01-17 10:42:36
  • 338
收藏助手
不良信息举报
您举报文章:XILNIXSDK2018为FreeRTOS增加配置项的方法
举报原因:
原因补充:

(最多只允许输入30个字)