3路RS4852路RJ45嵌入式ARM控制器

描述

如何在工控机上安装和使用Ubuntu

摘要:本文介绍了如何在工控机上安装和使用Ubuntu操作系统,以支持MySQL数据库平台。首先,简要介绍了内核,然后,确定必需的硬件与软件配置,下载Ubuntu系统,上传并安装在工控机。

嵌入式 ARM 控制器 BL301/BL302 系列是工业级坚固型工业控制器,采用 NXP 的

高性能处理器 I.MX6ULL,搭配先进的 ARM Cortex-A7 构架,运行速度高达 800MHz,

具有高度的稳定性。本产品最高可提供 4 路 RS485/RS232,1 路 CAN 口,2 路网口,2

路 DI 口,2 路 PWM 口输出以及 1 路 USB 接口,1 路电源输入/输出接口、1 路 HDMI

视频显示接口。可运行 LINUX、Ubuntu、Debian 等 OS,兼容 Node-Red、QT、Python、C++等应用程序,支持 MySQL、InfluxDB、SQLite 等数据库。

将文件 nand-burnsd 拷贝到 Ubuntu 系统的任一目录,假设为/home/beilai/work。

用户资料Linux烧录工具emmc-sdburn.tar.bz2 为 4G/8 GEMMC 文件系统。

1、SD 卡使用前使用格式化工具将其格式化为 FAT32 格式。

2、emmc-sdburn.tar.bz2 解压后拷贝到 ubuntu 系统下的任一目录。例如

/home/beilai/work。

3、使用 USB 读卡器把 SD 卡插入到电脑的 USB 端口(VMware 虚拟机用户如

果 U 盘没有被虚拟机识别,可以使用如下箭头指向图标将优盘连接到虚拟机)。

4、待虚拟机识别到 SD 卡后弹出目录再进行下边烧写操作。进入

/home/beilai/work/emmc-burnsd 目录,执行脚本:

执行上述命令后,终端会列出电脑的硬盘或 U 盘,对应选择自己的 SD

卡,回车。

注意:判定自己的 U 盘是 sda/sdb/sdc 可以根据容量进行判断,比如自

己的优盘容量为 8G,则其 size 为 7761920 KB≈8G,建议用户执行此操作

时不要同时插入多个优盘,以免混淆。

这里以我们的操作为例:

###############################################################################

This script will create a bootable SD card from custom or pre-built binaries. The script must be run with root permissions and from the bin directory of

the SDK

Example: $ sudo ./6ullsdburn.sh

Formatting can be skipped if the SD card is already formatted and

partitioned properly. ###############################################################################

Availible Drives to write images to: # major minor size name 1: 8 16 7761920 sdb

Enter Device Number: 1 //此处选择 1

sdb was selected

Checking the device is unmounted

unmounted /dev/sdb1

sdb1 sdb2 sdb3

7757824

###############################################################################

Detected device has 1 partitions already

Re-partitioning will allow the choice of 1 partitions ###############################################################################

Would you like to re-partition the drive anyways [y/n] : y //输入 y,回车,等待制卡完成

Now partitioning sdb ... ###############################################################################

Now making 1 partitions ###############################################################################

1+0 records in

1+0 records out

1024 bytes (1.0 kB, 1.0 KiB) copied, 0.0428509 s, 23.9 kB/s DISK SIZE - 7948206080 bytes Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 7.4 GiB, 7948206080 bytes, 15523840 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes >>> Created a new DOS disklabel with disk identifier 0x38224bb5. Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 500 MiB/dev/sdb2: New situation: Device Boot Start End Sectors Size Id Type

/dev/sdb1 20480 1044479 1024000 500M c W95 FAT32 (LBA)

The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. ###############################################################################

Partitioning Boot

############################################################################### mkfs.fat 3.0.28 (2015-05-16) mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows Mount the partitions Emptying partitions ###############################################################################

Copying files now... will take minutes ###############################################################################

Copying boot partition

copy sdrun/ target/ to SD

Buring the u-boot.imx to sdcard

129+0 records in

129+0 records out

132096 bytes (132 kB, 129 KiB) copied, 0.161529 s, 818 kB/s 431+0 records in

431+0 records out

441344 bytes (441 kB, 431 KiB) copied, 0.422838 s, 1.0 MB/s Syncing.... Un-mount the partitions Remove created temp directories Operation Finished

5、卡制作完成后可以看到 boot 分区包含 sdrun 和 target 两个目录

sdrun 文件夹内容用于引导系统烧写,一般无需修改;

arget 目录内容会烧写到 flash 芯片,用户做了镜像修改,需要替换镜像

文件时,只需将 target 目录中的对应文件替换掉,并保持同样的命名,之后

再重新进行系统烧写。以下以 NAND 的 SD 烧写卡的 target 内文件做介绍说

明:

u-boot-imx6ull14x14evk_nand BootLoader 镜像.imx

zImage 内核镜像

okmx6ull-s-emmc.dtb 设备树镜像。

logo.bmp 开机 Logo 图片。

用户更换开机 logo 图片,只需重新制作

bmp 格式图片(制作方法参考:用户资料应用

笔记),命名为 logo.bmp 替换该文件。

rootfs-console.tar.bz2 文件系统,无 qt 界面及 qt 库。

用户制作完新的文件系统后,命名为

rootfs_nogpu.tar.bz2 并替换该文件,可烧写自己

的文件系统。

modules.tar.bz2 模块文件(烧录时解压到文件系统中)

6、将上一节中制作好的 SD 卡插入,同时将拨码开关置于下图所示。3、

5、8 均为 ON,1、2、4、6、7 均为 OFF,此时将 SD 卡中 target 的内容烧写

到 emmc 中。烧写时间较长,等待系统烧写完成之后,串口打印信息:

7、同时底板上的 LED1 闪烁。

8、烧写完成之后,断电,将拨码开关拨到 3、7 均为 ON,1、2、4、5、

6、8 均为 OFF,重新上电,NAND 启动。

审核编辑 黄宇

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分