查看: 2821|回复: 0

[原创] 【正点原子I.MX6U-ALPHA开发板】+②构建开发环境

[复制链接]
  • TA的每日心情
    奋斗
    11 小时前
  • 签到天数: 2079 天

    连续签到: 161 天

    [LV.Master]伴坛终老

    发表于 2020-2-2 13:23:39 | 显示全部楼层 |阅读模式
    分享到:
        大家鼠年身体健康,新型冠状病毒影响着今年的过年气氛,亲朋好友不再聚餐,不能随便走访,出行都戴口罩,搞得人心惶惶,焦虑万分。今天静下心来更新一下使用正点原子I.MX6U-ALPHA开发板工程的心得体会。
        此开发板运行的系统是Linux系统,因此需要安装一个基于Linux开发的编译环境。在正点原子官方提供的《阿尔法Linux开发板光盘资料(A盘)-资料盘》的《3.软件》文件夹下有比较齐全的软件工具,其最新提供的《【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.0》讲述的非常详细,真可谓是面面俱到。在这里就使用光盘中推荐的“VMware-workstation-full-15.5.0”与“ubuntu-16.04.5-desktop-amd64”来搭建虚拟机系统。
        本地主机采用的是64位Win10系统,以管理员身份运行“VMware-workstation-full-15.5.0”软件,安装完成后输入激活密钥许可证,我在网上找了些,分享如下,希望对您有所帮助。
    激活密钥许可证
    VMware Workstation Pro 15 激活许可证
    UY758-0RXEQ-M81WP-8ZM7Z-Y3HDA
    VF750-4MX5Q-488DQ-9WZE9-ZY2D6
    UU54R-FVD91-488PP-7NNGC-ZFAX6
    YC74H-FGF92-081VZ-R5QNG-P6RY4
    YC34H-6WWDK-085MQ-JYPNX-NZRA2
          然后再将“ubuntu-16.04.5-desktop-amd64”系统镜像导入进VMware软件中,安装中显示如下:
    安装虚拟机.jpg
        等待5分钟左右系统安装完成后,在没有登录Linux系统前,先将VMware软件设置成桥接模式,有利于后续的网络连接,加快软件的更新速度。在《【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.0》中介绍了本地windows系统与Linux虚拟机通过FTP服务传输文件,这里我们可以采用VMware的共享文件的功能,在重启虚拟机的时候,我们可以在VMware软件的“虚拟机”菜单下选中“安装VMware Tools”,然后登录进Liunx虚拟系统,然后在左边的启动框内看得到光盘图标,然后点击打开光盘,将压缩文件拷贝到桌面,然后在终端中采用管理员身份运行tar命令将桌面的压缩文件解压出来,然后使用管理员身份运行“vmware-install.pl”文件,然后一直回车,选择系统默认,遇到【no】时也需要选择输入yes,这样安装完成后,才能在“/mnt/hgfs”目录下看到我们在VMware软件设置中的共享目录。
        安装好VMware Tools工具后,我们需要将虚拟机中的软件更新,执行“sudo apt-get update”时老是报资源暂时不可用,似乎是被某个进程锁住了,然后网上搜索解决问题的办法,截图如下:
    异常.jpg
    将lock文件删除后可以执行“sudo apt-get update”,但是老是报显示无法定位软件包,因此只能在网上找找软件源,在Linux系统设置中,将“软件和更新”中设置“下载自:中国服务器”,同时在“/etc/apt/sources.list”文件中做些补充。如下所示:
    1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    2. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    4. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    7. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    9. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

    11. #deb cdrom:[Ubuntu 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)]/ xenial main restricted

    12. # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    13. # newer versions of the distribution.
    14. deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
    15. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted

    16. ## Major bug fix updates produced after the final release of the
    17. ## distribution.
    18. deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
    19. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

    20. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    21. ## team. Also, please note that software in universe WILL NOT receive any
    22. ## review or updates from the Ubuntu security team.
    23. deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
    24. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
    25. deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
    26. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe

    27. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    28. ## team, and may not be under a free licence. Please satisfy yourself as to
    29. ## your rights to use the software. Also, please note that software in
    30. ## multiverse WILL NOT receive any review or updates from the Ubuntu
    31. ## security team.
    32. deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
    33. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
    34. deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
    35. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

    36. ## N.B. software from this repository may not have been tested as
    37. ## extensively as that contained in the main release, although it includes
    38. ## newer versions of some applications which may provide useful features.
    39. ## Also, please note that software in backports WILL NOT receive any review
    40. ## or updates from the Ubuntu security team.
    41. deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    42. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

    43. ## Uncomment the following two lines to add software from Canonical's
    44. ## 'partner' repository.
    45. ## This software is not part of Ubuntu, but is offered by Canonical and the
    46. ## respective vendors as a service to Ubuntu users.
    47. # deb http://archive.canonical.com/ubuntu xenial partner
    48. # deb-src http://archive.canonical.com/ubuntu xenial partner

    49. deb http://security.ubuntu.com/ubuntu xenial-security main restricted
    50. # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
    51. deb http://security.ubuntu.com/ubuntu xenial-security universe
    52. # deb-src http://security.ubuntu.com/ubuntu xenial-security universe
    53. deb http://security.ubuntu.com/ubuntu xenial-security multiverse
    54. # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
    55. deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse

    56. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted
    57. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted
    58. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic universe
    59. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates universe
    60. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic multiverse
    61. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates multiverse
    62. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    63. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted
    64. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security universe
    65. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security multiverse

    66. deb http://packages.ros.org/ros/ubuntu xenial main
    67. deb http://packages.ros.org/ros-shadow-fixed/ubuntu xenial main

    68. # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
    69. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
    70. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
    71. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
    72. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
    73. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
    74. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
    75. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    76. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
    77. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
    78. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
    复制代码
    这样再执行“sudo apt-get update”,可以快速将软件更新至最新版本。后续我们经常会用到Vim工具,而系统初始默认的vim中,上下左右变成了abcd,所以需要先将原来的vim卸载,执行“sudo apt-get remove vim-common”,然后再执行“sudo apt-get install vim”,这样Vim才能正常编辑使用。
        接下来我们再根据需求依次安装FTP服务,NFS网络服务,SSH服务,交叉编译器等。安装FTP服务截图如下:
    安装FTP服务.png
         然后继续根据《【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.0》的第四章节,继续安装NFS网络服务,截图信息如下:
    安装NFS服务.png
    再在设置环境变量的文件中设置一下启动NFS服务的路径
    设置NFS服务.png
        同样的方法,将windows下的交叉编译器文件共享拷贝到“/usr/local/arm”下。
    拷贝交叉编译器文件.png
    再在环境变量/etc/profile文件中设置链接的bin文件路径,添加代码“export PATH=$PATH:/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin”
    添加环境变量.png
    保存,退出Vim编辑,安装相关的库文件,执行“sudo apt-get install lsb-core lib32stdc++6”,待安装完成后,运行“arm-linux-gnueabihf-gcc -v”,显示如下,说明安装交叉编译器完成。
    交叉编译器安装完成.png
        综上所述,搭建Linux的开发环境其实比较简单,正点原子提供的官方光盘资料很齐全,当然由于Linux的许多软件源链接的服务器在国外,因此更新软件源比较缓慢,尤其是更新采用汉字输入法,中文系统等需要等待一段时间。此次分享就与大伙交流到这里,期待新型冠状病毒早日离去,生产生活恢复正常。谢谢!

    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-4-16 19:28 , Processed in 0.112306 second(s), 16 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.