petalinux-应用程序调试

petalinux-应用程序调试,第1张

$cd project-spec/meta-user/recipes-apps/vcu-qt/files

$mkdir develop

$cp vcu_qt.zip develop

$cd develop

$unzip 册悄vcu_qt.zip

$vi src/main.cpp    #在main()中增加一行qDebug("vcu-qt starting\n")保存退出

$rm vcu_qt.zip &&zip -r vcu_qt.zip *    #重新打包

$cp vcu_qt.zip ../

$petalinux-build -c vcu-qt        #回工程主目录州启渣进行编译

$cp build/tmp/deploy/rpm/aarch64/vcu-qt-1.0-r0.aarch64.rpm /tmp/    #拷贝到临时目录

$unpack.sh /tmp/vcu-qt-1.0-r0.aarch64.rpm    #解rpm包

$cat unpack.sh

#!/bin/bash

# unrpm.sh :解旁局包一个rpm归档文件

# Usage: `basename $0` target-file

TEMPFILE=$$.cpio  ##TEMPFILE必须是一个唯一的名字,$$是这个脚本的进程ID

file=$1

E_NOFILE=71

E_NORPM=72

if [ ! -f "$file" ]then

        echo "Should use a existing file"

        exit $E_NOFILE

fi

res=`file "$file" | grep -o "rpm"`

if [ -z "$res" ]then

        echo "Should use a rpm file"

        exit $E_NORPM

fi

rpm2cpio <$file >$TEMPFILE

cpio --make-directories -F $TEMPFILE -i

rm -f $TEMPFILE

exit 0

1,vivado硬件配置,要选择EMMC代表的SD1

2,编译petalinux:执行petalinux-config。

(1)选择Subsystem AUTO Hardware Setting

->Advanced bootable images storage settings

->boot image settings

选择primary flash,这里是将BOOT.bin设置为从qspi flash启动

(2)选择Subsystem AUTO Hardware Setting

->Advanced bootable images storage settings

->kernel image settings

选择primary sd,进入后我们看到这里实际就是设置image.ub的存放区域。

(3)选择Image Packaging Configuration,设置启动启动文件系统所在位置;

在设置启动方式的时候,如下两张图这样设置读取根文件系统的位置/dev/mmcblk1p2。

(4)设置你的驱动然后编译,依次执行:petalinux-config -c kernel;petalinux-config -c rootfs;

petalinux-build;petalinux-package --boot --fsbl ./粗数images/linux/zynq_fsbl.elf --fpga --u-boot --force;

3,做之前先分区(把EMMC分区),先做一个SD卡启动的petalinux文件,

petalinux系统在zynq上面启动起来以后岩橡首就进行如下分区:即是mmcblk1分为mmcblk1p1和mmcblk1p2

具体步骤如下:

(1) 把EMMC进行分区,执行命令: fdisk /dev/mmcblk1

(2)使用n命令,添加一个新的分区

Command (m for help): n

Command action

e extended

p primary partition (1-4)

选择p,添加主分区

,(3)选择分区号,选择1,

Partition number (1-4): 1// 选择分区号

First cylinder (1-238592, default 1): Using default value 1 // 选择分区的第一个柱面,选择1

Last cylinder or +size or +sizeM or +sizeK (1-238592, default 238592): Using default value 238592 // 选择如源最后一个柱面

注意:1-238592,first要选第一个数,last要选择的比238592小,其中1024就是表示1M

(4)使用t命令,设置分区格式

Command (m for help): t

Selected partition 1

Hex code (type L to list codes): b

Changed system type of partition 1 to b (Win95 FAT32)

(5)使用w命令,保存配置,必须保存配置

Command (m for help): w

The partition table has been altered.

Calling ioctl() to re-read partition table

(6)使用对应文件系统工具对分析进行格式化(只能在debian里面才能识别命令)

mkfs.fat /dev/mmcblk1p1 设置为fat32格式

mkfs.ext4 /dev/mmcblk1p2设置为ext4格式

注意:执行完w命令然后才算分区成功,执行完mkfs命令才算格设置内存属性成功。

以上分区完成后,可以使用p命令,显示分区信息;也可以使用用d命令表示删除分区

Command (m for help): p

Disk /dev/mmcblk0: 7818 MB, 7818182656 bytes

4 heads, 16 sectors/track, 238592 cylinders

Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System

/dev/mmcblk0p1 1 238592 7634936 83 Linux

(7)执行这句:mkdosfs -F 32 /dev/mmcblk0p1

当然,可以重复上述步骤,多分几个区,用来存放不同的状态:

FLASH要要用来存放BOOT.bin

第一个分区用来存放image.ub或者设备树(比如uImage和devicetree.dtb)等文件;--可以设置为128MB

第二个分区用来存放用户数据(比如可执行程序);可以设置为2048MB

第三个分区用来存放程序执行需要的库文件(opencv的库,qtcreator库,相机库,视频编码解码库等);剩余的1个多GB

4,把系统同步到ext4里面

先把sd卡里面系统挂载进来 :mount /dev/mmcblk0p2 /mnt

再把刚刚弄好的系统挂进来: mount /dev/mmcblk1p2 /tmp ,然后cd /mnt

然后进入把SD卡里面的系统同步到emmc里面:rsync -av ./* /tmp ,时间有点久,直到结束为止。

(要是不用SD卡也可以挂载U盘,解压,然后进行系统同步到EMMC所挂载的地方/tmp)

5,然后将BOOT.BIN和image.ub烧录到QSPI-FLASH中

首先擦除QSPI-FLASH:flash_eraseall /dev/mtd0

存放BOOT.bin到flash : flashcp BOOT.bin /dev/mtd0

此处若是将image.ub写入emmc的FAT分区中(不存放到flash中),先使用mount挂载eMMC的FAT分区,

然后将image.ub使用cp指令拷贝进 /mnt/mmcFat即可,也就是把uImage 拷贝到 /dev/mmcblk1p1;

进入uImage所在目录,然后执行 cp uImage /tmp;也就是把uImage存放到了 /dev/mmcblk1p1里面。

6,最后断电拔出SD卡,将拨码开关设置为flash启动,就能看到petalinux启动起来;

7,报错及其解决办法

————————————————

版权声明:本文为CSDN博主「寒听雪落」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/wangjie36/article/details/104740448/

With the development of information and network technology, embedded system has penetrated into various areas and been widely used. Using the access function of Internet makes it possible to monitor the equipment from any corner from global By taking advantage of the open TCP/IP network communication protocol, any computer can use common web browsing software and visiting equipment and needn't special computer and specialized softwareEquipment information is shown by webpages . This paper proceeded the embedded operating system petalinux and FPGA to web design based on the topic of petalinux embedded web design ,and realized the links between clients and servers by making dynamic web pages. The paper has mainly finished the following jobs: firstly, building a petalinux - FPGA platform v0.40 - immigration environment, and compiling petalinux mirror, completing petalinux transplantation, and developing dynamic web pages in the environment of the embeded operating systerm. This article mainly studied the transplantation and web operating system design. It also made a in-depth analysis of dynamic Web pages, studied the principle of CGI the embedded Web , and applied successfully in the embedded Web server, finished the development of the dynamic web page display function. The using of web server makes system development and use convenient. Through the browser, users can access and maintian anytime and anywhere, providing the system using with great convenience and having achieved the expected effect. The realization of petalinux embedded Web Server provides effective basis for use of limited resources to achieve the embedded Internet technology, and provides favorable solution for remote monitoring, remote diagnosis and maintenance etc .It can be widely used many fields such as information household appliance, industrial automation control, intelligent instrument and sensing technology . The theory has high theories and application value.这翻译忒表态了!啥也不说了,加分啊!


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12508597.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存