当前位置:网站首页>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模板 。
边栏推荐
- 37頁數字鄉村振興智慧農業整體規劃建設方案
- MIT 6.824 - raft Student Guide
- 1000 words selected - interface test basis
- 【CVPR 2022】半监督目标检测:Dense Learning based Semi-Supervised Object Detection
- Devops can help reduce technology debt in ten ways
- web渗透测试是什么_渗透实战
- Data analysis course notes (V) common statistical methods, data and spelling, index and composite index
- Designed for decision tree, the National University of Singapore and Tsinghua University jointly proposed a fast and safe federal learning system
- C语言输入/输出流和文件操作【二】
- 【vulnhub】presidential1
猜你喜欢
After leaving a foreign company, I know what respect and compliance are
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
准备好在CI/CD中自动化持续部署了吗?
沉浸式投影在线下展示中的三大应用特点
英雄联盟|王者|穿越火线 bgm AI配乐大赛分享
What is a responsive object? How to create a responsive object?
陀螺仪的工作原理
2022 PMP project management examination agile knowledge points (9)
三维扫描体数据的VTK体绘制程序设计
How engineers treat open source -- the heartfelt words of an old engineer
随机推荐
Model-Free Prediction
Interesting wine culture
Things like random
Basic information of mujoco
基于SSM框架的文章管理系统
37 page overall planning and construction plan for digital Village revitalization of smart agriculture
uniapp实现从本地上传头像并显示,同时将头像转化为base64格式存储在mysql数据库中
Matlab learning notes
48 page digital government smart government all in one solution
Testers, how to prepare test data
英雄联盟|王者|穿越火线 bgm AI配乐大赛分享
ldap创建公司组织、人员
js导入excel&导出excel
[2022 the finest in the whole network] how to test the interface test generally? Process and steps of interface test
Data analysis course notes (III) array shape and calculation, numpy storage / reading data, indexing, slicing and splicing
DAY FIVE
vector的使用方法_vector指针如何使用
2022/2/10 summary
PostgreSQL highly available repmgr (1 master 2 slave +1witness) + pgpool II realizes master-slave switching + read-write separation
互动滑轨屏演示能为企业展厅带来什么