zynq中mgtx应用_基于ZYNQ的UCOS移植(TCP通讯)
通过第三方库创建SDK工程
在ZYNQ-UCOS中实现TCP echo通讯
二、配置需求
操作系统 | Windows 10(64位) |
开发环境 | SDK 2018.3 |
三、操作流程
1、添加资源库。启动SDK软件,选择Xilinx->Repositories弹出Perferences视图,在Local Repositories中添加ucos资源库(ucos资源库下载链接见附件部分)。
2、创建新工程。选择File->New->Application Project弹出New Project视图,输入工程名称ucos_tcp,选择操作系统平台ucos,点击Next>,在弹出的Templates选项中选择Micrium uc/OS-Ⅱ Hello World,点击Finish完成基础示例工程的创建。
3、配置emac。在ucos_tcp_bsp文件夹上单击鼠标右键,选择Board Support Pcakage Settings,在弹出的Board Support Pcakage Settings视图中选择drivers,修改ucos_emacps为emacps,单击OK完成emac的配置。
4、移植Lwip。将lwip212文件夹及内容拷贝到工程源文件目录下(Lwip资源库下载链接见附件部分)。
5、设置头文件路径,在src文件夹上单击鼠标右键,选择Properties,在弹出的Properties for src视图中选择C/C++ Build->Settings->Directories,在Include Paths中依次添加lwip212文件下的contrib、contrib/xilinx/include,lwip-2.1.2/include三个文件夹。单击Apply应用配置变更,单击OK退出Properties for src视图。
6、删除报错的头文件。
注释/ucos_tcp/src/lwip212/contrib/xilinx/include/netif/xemacpsif.h中xuartps.h的引用
注释/ucos_tcp/src/lwip212/contrib/xilinx/netif/xemacpsif.c中xuartps.h的引用
注释/ucos_tcp/src/lwip212/contrib/LwipEnter.h中platform_config.h的引用
7、修改入口函数文件。将app.c文件进行如下修改。
/*********************************************************************************************************** uCOS XSDK BSP** (c) Copyright 2014-2020; Silicon Laboratories Inc.,* 400 W. Cesar Chavez, Austin, TX 78701** All rights reserved. Protected by international copyright laws.** Your use of this software is subject to your acceptance of the terms* of a Silicon Labs Micrium software license, which can be obtained by* contacting info@micrium.com. If you do not agree to the terms of this* license, you may not use this software.** Please help us continue to provide the Embedded community with the finest* software available. Your honesty is greatly appreciated.** You can find our product's documentation at: doc.micrium.com** For more information visit us at: www.micrium.com**********************************************************************************************************//*********************************************************************************************************** SETUP INSTRUCTIONS** This demonstration project illustrate a basic uC/OS-II project with simple "hello world" output.** By default some configuration steps are required to compile this example :** 1. Include the require Micrium software components* In the BSP setting dialog in the "overview" section of the left pane the following libraries* should be added to the BSP :** ucos_common* ucos_osii* ucos_standalone** 2. Kernel tick source - (Not required on the Zynq-7000 PS)* If a suitable timer is available in your FPGA design it can be used as the kernel tick source.* To do so, in the "ucos" section select a timer for the "kernel_tick_src" configuration option.** 3. STDOUT configuration* Output from the print() and UCOS_Print() functions can be redirected to a supported UART. In* the "ucos_standalone" section the stdout configuration will list the available UARTs.** Troubleshooting :* By default the Xilinx SDK may not have selected the Micrium drivers for the timer and UART.* If that is the case they must be manually selected in the drivers configuration section.** Finally make sure the FPGA is programmed before debugging.*** Remember that this example is provided for evaluation purposes only. Commercial development requires* a valid license from Micrium.**********************************************************************************************************//*********************************************************************************************************** INCLUDE FILES**********************************************************************************************************/#include #include #include #include "ucos_ii.h"#include "LwipEnter.h"/*********************************************************************************************************** LOCAL FUNCTION PROTOTYPES**********************************************************************************************************/OS_STK Polling_thread_Stk[256u];OS_STK LwipEnter_thread_Stk[512u];void MainTask (void *p_arg);void PollingTask (void *p_arg);/*********************************************************************************************************** main()** Description : Entry point for C code.***********************************************************************************************************/int main(){ UCOSStartup(MainTask); return 0;}/*********************************************************************************************************** MainTask()** Description : Startup task example code.** Returns : none.** Created by : main().**********************************************************************************************************/void MainTask (void *p_arg){ OS_CPU_SR cpu_sr; OS_ENTER_CRITICAL(); // Create Task OSTaskCreate(PollingTask, (void*)0, (OS_STK*)&Polling_thread_Stk[255u], 20u); OSTaskCreate(LwipEnter_thread, (void*)0, (OS_STK*)&LwipEnter_thread_Stk[511u], 50); OS_EXIT_CRITICAL(); // Suspend this Start Task after initialization OSTaskSuspend(OS_PRIO_SELF);}/*********************************************************************************************************** PollingTask()** Description : Polling task example code.** Returns : none.** Created by : MainTask().**********************************************************************************************************/void PollingTask (void *p_arg){ UCOS_Print ("Hello world from the main task\r\n"); while (DEF_TRUE) { OSTimeDlyHMSM(0, 0, 3, 0); UCOS_Print("Periodic output every 3 seconds from the main task\r\n"); }}
8、调试配置。调试配置如下图所示。
9、启动调试。将测试PC机IP设置为192.168.1.99(与Zedboard处于同一网段),子网掩码为255.255.255.0。此时即可通过网口调试助手测试TCP的通讯功能。
四、资源链接
链接:https://pan.baidu.com/s/1iVkFfXC964F7cCZVK8URCA
提取码:s5p1
zynq中mgtx应用_基于ZYNQ的UCOS移植(TCP通讯)相关推荐
- zynq中mgtx应用_【干货分享】ZYNQ常用外设设计 (上)
2. IO的电压为1.8V. 3. 默认使用的参数为:115200波特率以及其他对应参数,见图 21. Step2: 在Vivado的Block Design中配置ZYNQ7 Processing S ...
- zynq中mgtx应用_[ZYNQ入门宝典]GTX高速口带着IBERT一起玩(二)
(全文以7Z045为例) 1.IBERT初体验: IBERT全称 Integrated Bit Error Ratio Tester ,顾名思义:集成好的单比特高速误码率测试工具.它可以利用FPGA内 ...
- zynq中mgtx应用_[ZYNQ入门宝典]GTX高速口怎么玩(一)
(原帖中有图) GTX的概述 高速接口本来就复杂,Xilinx的IP虽然方便,但定制化参数较多,需要去了解的知识很多,官方文档就四五百页.还好在大多数应用里我们都只是用了其皮毛.我也是第一次学习GTX ...
- 基于zynq的千兆网udp项目_基于Zynq平台的EtherCAT主站方案实现
作者:陈秋苑 谢晓锋 陈海焕 广州虹科电子科技有限公司 摘 要:EtherCAT 是开放的实时以太网通讯协议,由德国倍福自动化有限公司研发.EtherCAT 具有高性能.低成本.容易使用等特点,目前在 ...
- zynq中mgtx应用_ZYNQ7000性能分析
提到自动驾驶,机器人视觉,高清摄像机,都要想到摄像头这个单元,先前本侠也讲过一些FPGA应用在高清摄像头和机器视觉中的深度摄像头以及双目摄像头等,FPGA在里面的作用主要是对采集的图像进行处理,对图像 ...
- rs485与modbus流程图_基于Modbus协议的RS485总线通讯机设计原理及应用
摘要:该文详细论述了基于Modbus协议的RS485总线通讯机设计原理及应用.物理结构上包括上位机.主站.和多个从站节点.在上位机与各从站节点间增加主站,承担上位机的轮询工作,使上位机从繁忙的通信工作 ...
- 基于QTcpSocket和QTcpServer的Tcp通讯以及QDataStream序列化数据
为什么80%的码农都做不了架构师?>>> 最近要在QT下开发Tcp通讯,发送序列化数据以便于接收. 这里涉及到几个问题: 1.QTcpSocket.QTcpServer的通讯 ...
- zynq中mgtx应用_Xilinx 7系列FPGA 高速收发器GTX/GTH的一些基本概念
本来写了一篇关于高速收发器的初步调试方案的介绍,给出一些遇到问题时初步的调试建议.但是发现其中涉及到很多概念.逐一解释会导致文章过于冗长.所以单独写一篇基本概念的介绍,基于Xilinx 7系列的GTX ...
- zynq中mgtx应用_Zynq7000系列之芯片引脚功能综述
很多人做了很久的FPGA,知道怎么去给信号分配引脚,却对这些引脚的功能及其资源限制知之甚少:在第一章里对Zynq7000系列的系统框架进行了分析和论述,对Zynq7000系列的基本资源和概念有了大致的 ...
最新文章
- Android -- DrawerLayout
- Laravel: 基础篇
- 返回数组个数Java_用java实现返回一个整数数组中最大数组的和
- f5 ppt图标_PPT制作学习 (PPT技巧干货,拿走不谢)
- linux英文系统+搜狗输入法
- 串操作指令及其应用程序的设计与调试运行——汇编实验四 用8086汇编完成下题 编制一程序,从键盘输入两个长度不同的字符串,设字符串长度小于25个字符。要求在屏幕上以右边对齐的形式显示出
- 在 VS 类库项目中 Add Service References 和 Add Web References 的区别
- 总结django form
- IOS中获取屏幕尺寸
- java中double..compare_为什么Java的Double.compare(double,double)实现了它的样子?
- 怎么用计算机平方,手机计算器平方怎么按
- 网件rax40可以刷梅林_Netgear 网件 RAX40 AX3000规格 无线路由器 开箱拆解评测
- 我的世界服务器如何修复报错,我的世界18w30a发布_我的世界1.13版本bug修复
- python分块处理功能_Python自然语言处理学习笔记之信息提取步骤分块(chunking)...
- ICEM-圆柱与长方体相切
- 计算机操作系统pv实验,计算机操作系统PV操作例题.doc
- JSP大学实用教程(第2版)代码一
- 高空简易水果采摘装置设计(CAD+proe)
- c++ zlib 7z解压缩
- Allegro封装的制作
热门文章
- Activiti源码 之工厂模式
- 基于RBAC的权限设计模型
- linux下编译为知笔记,为知笔记 Linux 版安装
- java上传视频代码下载_java 实现视频上传
- 广西大学计算机类开设课程,操作系统教学大纲-广西大学计算机与电子信息学院.DOC...
- Robots on a Grid CodeForces - 1335F(拓扑排序+正反建图+判环)
- [蓝桥杯][算法提高]能量项链(区间dp)
- 计算机二级考试需要怎么备考,计算机二级ms office应该怎么备考 考试内容是什么...
- trinitycore MySQL模块_Windows下编译TrinityCore服务端
- generator mysql插件_mybatis Generator最佳实践(数据库:mysql)