XILINX 官方的SDK可以生成FreeRTOS
本文分为三个部分:
1.ZYNQ 7010 创建一个最小ZYNQ Processer系统,能够使用串口打印
2.使用SDK 创建一个FreeRTOS最小软件系统
3.浅析FreeRTOS最小软件系统
一:ZYNQ 7010 创建一个最小ZYNQ Processer系统,能够使用串口打印
1.创建对应SOC型号的工程
2.创建Block Design, ZYNQ Processer系统
得到一个最小的默认ZYNQ Blcok Design
2.对ZYNQ Proceing system 进行配置,配置的目的是适应硬件参数
双击上图的方框,得到下面的界面,绿色的方框表示可以双击跳转到对应的模块进行配置
设置DDR,双击DDR 模块绿色方框
配置DDR型号和带宽
配置BANK 电压与串口
关闭多余的PL Reset、clock信号
关闭AXI接口,双击绿色方框
进行校验
生成最后的ZYNQ7 Processing system
可以看到最小硬件系统的接口有DDR,FIXED_OI的MIO,CLK,复位和启动信号
在这里插入
Export HardWare
二:使用SDK 创建一个FreeRTOS最小软件系统
编译
进行运行
三:FreeRTOS 最小软件系统浅析
1.任务、软件定时器、消息的创建
/* Create the two tasks. The Tx task is given a lower priority than the
Rx task, so the Rx task will leave the Blocked state and pre-empt the Tx
task as soon as the Tx task places an item in the queue. */
xTaskCreate( prvTxTask, /* The function that implements the task. */
( const char * ) "Tx", /* Text name for the task, provided to assist debugging only. */
configMINIMAL_STACK_SIZE, /* The stack allocated to the task. */
NULL, /* The task parameter is not used, so set to NULL. */
tskIDLE_PRIORITY, /* The task runs at the idle priority. */
&xTxTask );
xTaskCreate( prvRxTask,
( const char * ) "GB",
configMINIMAL_STACK_SIZE,
NULL,
tskIDLE_PRIORITY + 1,
&xRxTask );
/* Create the queue used by the tasks. The Rx task has a higher priority
than the Tx task, so will preempt the Tx task and remove values from the
queue as soon as the Tx task writes to the queue - therefore the queue can
never have more than one item in it. */
xQueue = xQueueCreate( 1, /* There is only one space in the queue. */
sizeof( HWstring ) ); /* Each space in the queue is large enough to hold a uint32_t. */
/* Check the queue was created. */
configASSERT( xQueue );
/* Create a timer with a timer expiry of 10 seconds. The timer would expire
after 10 seconds and the timer call back would get called. In the timer call back
checks are done to ensure that the tasks have been running properly till then.
The tasks are deleted in the timer call back and a message is printed to convey that
the example has run successfully.
The timer expiry is set to 10 seconds and the timer set to not auto reload. */
xTimer = xTimerCreate( (const char *) "Timer",
x10seconds,
pdFALSE,
(void *) TIMER_ID,
vTimerCallback);
/* Check the timer was created. */