当前位置:网站首页>ZYNQ移植uCOSIII
ZYNQ移植uCOSIII
2022-07-06 16:48:00 【Chenxr32】
我参考B站上的视频《FPGA(ZYNQ)上运行UC/OS的实例-TCP通讯》,在自己的ZYNQ开发板上移植uCOSIII操作系统,配置BSP,这里记录部分步骤。
软件:Vivado 2017.4
芯片:xc7z010clg400-1
硬件设计
第一步:新建Vivado工程,创建Block Design,在Block Design中添加ZYNQ7 Processing System IP核。
第二步:配置ZYNQ7 Processing System IP核。
配置PS的UART,点击Peripheral I/O Pins页面,选择UART1,我的板子引出的是MIO48和MIO49,波特率设置为115200。
配置PS的Ethernet,点击Peripheral I/O Pins页面,选择Ethernet0,我的板子用的PHY芯片是RTL8211E,Ethernet0引出的是MIO16~MIO27,MDC和MDIO分配到MIO52、MIO53。
MIO Configuration页面的设置如下图所示。
最后把剩下的所有GPIO MIO选中,留作他用(点灯)。DDR3、PS时钟、中断等配置按自己的需求来,这里不记录了。配置好的Block Design如下图所示。
第三步:验证当前设计,生成顶层HDL模块,导出硬件,启动SDK。
软件设计
第一步:下载uCOSIII代码。
可以到开头视频给的网站上下载。网址:https://github.com/suisuisi/zynq_guide/tree/main/ucos。这是开发操作系统的公司针对ZYNQ的Cortex-A9 CPU移植好的代码,我们不需要做任何修改,只需在SDK中配置一下可以。
第二步:在SDK中导入uCOSIII代码。
解压下载后的压缩包,将uCOSIII代码文件夹放到自己的工程目录下。
点击SDK软件上方的Xilinx->Repositories,在Local Repositories栏中导入uCOSIII代码文件夹的路径,点击“OK”。
第三步:新建应用。
OS Platform选择ucos,点击“Next”。下一页选择Micrium uc/OS-III Hello World模板。(其他模板也可试一试)。
第四步:配置BSP。
右击左侧的ucos_base_bsp,点击Board Support Package Settings,打开配置BSP的界面。
Ovrview中按下图勾选模块,我选了必须要的三个模块,其他模块按需勾选。其中ucos_standalone模块允许我们在代码中使用Xilinx提供的外设驱动代码。
在ucos_standalone中,将stdin和stdout设置为ps7_uart_1,也就是前面我们在硬件设计中选中的UART1。
在drivers中,将ps7_ethernet_0的驱动选为ucos_emacps,留着后面做网络实验用(本文未涉及)。
第五步:写代码。
ucos_base->src->app.c里有自动生成的代码,可以直接编译下载到板子上实验。
#include <stdio.h>
#include <Source/os.h>
#include <ucos_bsp.h>
void MainTask (void *p_arg);
int main()
{
UCOSStartup(MainTask);
return 0;
}
void MainTask (void *p_arg)
{
OS_ERR os_err;
UCOS_Print ("Hello world from the main task\r\n");
while (DEF_TRUE) {
OSTimeDlyHMSM(0, 0, 10, 0, OS_OPT_TIME_HMSM_STRICT, &os_err);
UCOS_Print("Periodic output every 10 seconds from the main task\r\n");
}
}
我还尝试了TCP和DNS的模板,开发板连接路由器,可以成功获得IP地址。
完整的工程下载地址:ZYNQ7010的uCOSIII模板 。
边栏推荐
- ldap创建公司组织、人员
- Model-Free Control
- uniapp实现从本地上传头像并显示,同时将头像转化为base64格式存储在mysql数据库中
- 【CVPR 2022】目标检测SOTA:DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
- GPIO簡介
- js导入excel&导出excel
- Pdf document signature Guide
- Idea automatically imports and deletes package settings
- 2021 SASE integration strategic roadmap (I)
- QT tutorial: creating the first QT program
猜你喜欢

DAY SIX

GPIO簡介

Designed for decision tree, the National University of Singapore and Tsinghua University jointly proposed a fast and safe federal learning system

专为决策树打造,新加坡国立大学&清华大学联合提出快速安全的联邦学习新系统

The way of intelligent operation and maintenance application, bid farewell to the crisis of enterprise digital transformation

Jenkins' user credentials plug-in installation

一图看懂对程序员的误解:西方程序员眼中的中国程序员

How can computers ensure data security in the quantum era? The United States announced four alternative encryption algorithms

JWT signature does not match locally computed signature. JWT validity cannot be asserted and should

2022/2/12 summary
随机推荐
37頁數字鄉村振興智慧農業整體規劃建設方案
Data analysis course notes (V) common statistical methods, data and spelling, index and composite index
Operation test of function test basis
量子时代计算机怎么保证数据安全?美国公布四项备选加密算法
Use mujoco to simulate Cassie robot
St table
[CVPR 2022] semi supervised object detection: dense learning based semi supervised object detection
MySQL主从之多源复制(3主1从)搭建及同步测试
Geo data mining (III) enrichment analysis of go and KEGG using David database
什么是响应式对象?响应式对象的创建过程?
Data analysis course notes (III) array shape and calculation, numpy storage / reading data, indexing, slicing and splicing
AI超清修复出黄家驹眼里的光、LeCun大佬《深度学习》课程生还报告、绝美画作只需一行代码、AI最新论文 | ShowMeAI资讯日报 #07.06
The programmer resigned and was sentenced to 10 months for deleting the code. Jingdong came home and said that it took 30000 to restore the database. Netizen: This is really a revenge
Compilation of kickstart file
Racher integrates LDAP to realize unified account login
智能运维应用之道,告别企业数字化转型危机
pytest多进程/多线程执行测试用例
web渗透测试是什么_渗透实战
Model-Free Control
《LaTex》LaTex数学公式简介「建议收藏」