ARMlinux嵌入式开发环境安装参考手册
- 格式:doc
- 大小:531.00 KB
- 文档页数:12
gec-6818 嵌入式linux开发指导手册嵌入式Linux开发指导手册是针对GEC-6818嵌入式开发板的用户提供的一份使用手册,旨在帮助开发者了解如何在GEC-6818上进行嵌入式Linux开发,并提供一些开发过程中可能遇到的问题和解决方案。
本文将从以下几个方面进行介绍和指导。
一、GEC-6818简介GEC-6818是一款基于ARM架构的嵌入式开发板,搭载了Cortex-A53四核处理器,主频高达 1.3GHz,拥有丰富的外设接口和扩展能力,适合用于嵌入式Linux系统的开发和应用。
本章将介绍GEC-6818的主要硬件组成和接口定义,以便开发者能够快速上手使用。
二、嵌入式Linux系统搭建本章将介绍如何搭建嵌入式Linux系统,并详细介绍了系统的编译和安装过程。
主要内容包括交叉编译工具链的安装、内核的编译和配置、文件系统的构建和配置等。
同时,还会提供一些常见的问题和解决方案,帮助开发者尽快搭建起自己的开发环境。
三、设备驱动开发设备驱动是嵌入式Linux开发中一个重要的环节,本章将介绍设备驱动的基本概念和开发过程。
主要内容包括字符设备驱动、块设备驱动、网络设备驱动等。
同时,还会提供一些实例代码和开发技巧,帮助开发者更好地理解和掌握设备驱动的开发。
四、应用程序开发应用程序开发是嵌入式Linux开发中的另一个重要环节,本章将介绍如何在GEC-6818上进行应用程序的开发。
主要内容包括交叉编译环境的搭建、编写Makefile文件、调试应用程序等。
同时,还会提供一些常见的应用程序开发技巧和调试方法,帮助开发者快速进行应用程序开发。
五、远程调试和调优远程调试和调优是嵌入式Linux开发中的重要环节之一,本章将介绍如何在GEC-6818上进行远程调试和调优。
主要内容包括通过串口进行调试、使用GDB进行调试、使用sysbench进行性能测试等。
同时,还会提供一些常见的调试和调优技巧,帮助开发者尽快定位和解决问题。
实验一嵌入式 Linux 开发环境的搭建及 Makefile 应用一、实验目的:1.熟悉嵌入式 Linux 开发基本过程及基本命令。
2.了解嵌入式 Linux 开发中各种工具的基本用途。
3.搭建好嵌入式 Linux 的开发环境。
4.通过对包含多文件的 Makefile 的编写,熟悉各种形式的Makefile 编写,加深对 Makefile 中用户自定义变量、自动变量及预定义变量的理解。
二、实验内容:1.安装 Vmware 及 Ubuntu;2.熟悉 Linux 下相关命令:属性查询、修改,路径、目录的查询、修改、删除,压缩、解压等;3.熟悉编辑工具;4.熟悉 makefile 文件的基本作用(编写一个包含多文件的Makefile)。
三、Make 工程管理器:Makefile如今能得以广泛应用,这还得归功于它被包含在Unix系统中。
在make诞生之前,Unix系统的编译系统主要由“make”、“install”shell脚本程序和程序的源代码组成。
它可以把不同目标的命令组成一个文件,而且可以抽象化依赖关系的检查和存档。
这是向现代编译环境发展的重要一步。
1977年,斯图亚特·费尔德曼在1贝尔实验室里制作了这个软件。
2003年,斯图亚特·费尔德曼因发明了这样一个重要的工具而接受了美国计算机协会(ACM)颁发的软件系统奖。
Makefile文件是可以实现自动化编译,只需要一个“make”命令,整个工程就能完全自动编译,极大的提高了软件开发的效率。
目前虽有众多依赖关系检查工具,但是make是应用最广泛的一个。
一个程序员会不会写makefile,从一个侧面说明了这个程序员是否具备完成大型工程的能力。
1.Makefile 基本规则一个简单的 Makefile 语句由目标、依赖条件、指令组成。
smdk6400_config :unconfig@mkdir -p $(obj)include $(obj)board/samsung/smdk6400其中:smdk6400_config:目标;unconfig:先决条件;@mkdir -p $(obj)include $(obj)board/samsung/smdk6400:指令。
嵌入式系统原理与应用实验栗华编着山东大学信息科学与工程学院二零一四年三月目录第一章实验硬件平台1.1北京博创UP-TECH三合一实验箱简介本实验指导书所依赖的硬件平台为北京博创兴盛科技有限公司生产的一种ARM9/Xscale经典三核心教学科研平台(型号:UP-TECHS2410/S2440/P270),本平台兼容PXA270核心CPU及S3C2410、S2440核心CPU的全部功能,是北京博创多年来嵌入式教学产品开发经验的结晶。
这里选配的是S3C2440核心板。
图1-1UP-CUP三合一实验箱外观应用案例:※支持Linux、WinCE、Vxworks、μC/OS-Ⅱ4套操作系统;※核心板可更换,同时拥有ARM9(S3C2410和S3C2440)和XScale(PXA270);※中国电子学会嵌入式工程师认证考试和师资培训指定平台;硬件资源:软件资源结构说明图1-2UP-TECH三合一实验箱实物结构图1-2UP-TECH三合一实验箱框图结构图1-3UP-TECH三合一实验箱框图结构版图1.2跳线设置参考说明:◆PCB上所有“EXPORT”丝印字符表示168Pin扩展槽◆JP1401RESET-SEL:设置复位电路,位置JTAG20插座下方。
1-2:ICE的ICE-TRST复位信号可以控制系统复位信号RESET。
2-3:ICE的ICE-TRST复位信号不可以控制系统复位信号RESET。
◆JP1402JTAGSEL:选择JTAG电路,位置JTAG20插座下方。
1-2:使能板载的UP-LINKJTAG电路。
2-3:使用外部的JTAG电缆或者ARMICE仿真器。
◆JP1103TXD1-SEL◆JP1104RXD1-SEL:UART1选择扩展槽或者RS232的DB9插座。
1-2:UART1连接RS232-1,从DB9串口插座输出。
2-3:UART1连接到扩展槽。
◆JP1101TXD2-SEL◆JP1102RXD2-SEL:UART2选择跳线,分别为RS485、IrDA、扩展槽1-2:UART2连接到RS485总线上。
嵌入式linux系统开发标准教程嵌入式Linux系统开发是一门非常重要的技术,它在嵌入式设备、物联网和智能家居等领域中得到广泛应用。
本文将介绍嵌入式Linux系统开发的标准教程,帮助读者了解该技术的基本原理和常用的开发工具。
一、嵌入式Linux系统开发的基本原理嵌入式Linux系统开发是指将Linux操作系统移植到嵌入式设备中,并针对特定的应用领域进行定制开发。
它与传统的桌面Linux系统有很大的区别,主要体现在以下几个方面:1. 硬件平台的选择:嵌入式设备通常采用ARM架构或者其他低功耗的处理器架构,而不是传统的x86架构。
因此,在进行嵌入式Linux系统开发时,需要根据具体的处理器架构进行相应的移植和优化。
2. 精简的内核:由于嵌入式设备的资源有限,为了提高系统性能和节省资源,嵌入式Linux系统通常会精简内核。
这需要对Linux内核的源代码进行裁剪和优化,以去除不必要的模块和功能,并保留对应用需求的必要功能。
3. 定制化的驱动程序和应用程序:嵌入式设备通常需要与各种外设进行交互,因此需要编写相应的驱动程序。
此外,根据具体的应用需求,还需要定制相关的应用程序和用户界面。
二、嵌入式Linux系统开发的工具嵌入式Linux系统开发需要使用一些常用的工具,下面是一些常用的工具和其功能的介绍:1. 交叉编译工具链:由于嵌入式设备和开发主机的处理器架构不同,无法直接在开发主机上编译和运行目标代码。
因此,需要使用交叉编译工具链,在开发主机上生成适用于目标设备的可执行文件。
2. 调试工具:在嵌入式Linux系统开发过程中,调试是非常重要的一环。
常用的调试工具包括GDB(GNU调试器)和strace(系统调用跟踪工具),它们可以帮助开发人员追踪程序的执行过程和定位错误。
3. 文件系统工具:嵌入式设备的存储资源有限,需要使用文件系统来组织和管理存储的数据。
常用的文件系统工具包括mkfs(创建文件系统)、mount(挂载文件系统)以及文件传输工具(如scp和rsync)等。
嵌入式软件开发环境安装和配置信息技术有限公司2009.061.本手册之目的本手册适用于刚开始学习或从事嵌入式软件开发的人员,他们对于嵌入式软件开发环境的安装、配置知之甚少,因此安装、配置过程均给予了详细的描述。
2.所需工具及其用途采取XP + 虚拟机+ Linux + Arm-Linux-Gcc+ Source Insight + Secure CRT:✓在XP基础上安装虚拟机✓在虚拟机中安装Linux,借助Linux上的编译器编译目标机上的执行程序✓在Linux中安装Arm-Linux-Gcc,用于编译嵌入式平台上的执行程序✓在XP中安装Source Insight,用于编辑代码✓在XP中安装Secure CRT,连接到目标机,用于运行执行程序如果你能熟练使用Linux,那么你可以直接在Linux中安装、配置相应的组件、工具,不必使用XP、虚拟机,也不必安装Secure CRT。
2.1. XP操作系统原则上可不要XP操作系统(也可是其它Windows操作系统),而是直接使用Linux 操作系统。
但由于大多数人对于Windows操作系统很熟悉,Windows下的很多工具使用起来也很方便,所以采用了XP + 虚拟机+ Linux的模式。
这样我们可以在熟悉的Windows 下高效率的工作。
2.2. VMWare采用了XP + 虚拟机+ Linux的模式,所以要安装一个虚拟机,根据实际情况,这里选用VMWare6.5.2。
2.3. Linux操作系统对于Linux系统的版本没有限制,Redhat、Ubuntu、Fedora等均可,这里选用目前比较常用的Ubuntu 8.10。
Linux安装完成后,还需要配置或安装:✓配置网络:必须配置好网络,方能进行以下操作✓设置更新源:设置Linux的组建更新源,更新组件✓安装vmware tools:提供Windows与Linux的互操作性✓安装SSH:只有安装SSH后,Secure CRT才能链接到Linux✓安装NFS:用于在目标开发板上挂载Linux上的目录2.4. Arm-Linux-Gcc编译器由于嵌入式运行平台的局限性,不大可能在嵌入式运行平台中安装编译器,需要在Linux系统安装编译器来编译程序。
forARM嵌入式Linux资料说明声明:forARM所提供的所有资料都是免费,资料涉及从C语言到嵌入式Linux。
1.关于forARM:---------------------------------------------------------------------视频配套OK6410开发板、AM335X开发板、210开发板、STM32开发板淘宝店:淘宝商店:明志电子科技网址:技术支持QQ:宁静致远:506793634李强:747576767谢贤斌:173985407方强:446876407嵌入式Linux实用教程QQ群:①:284013595(500人,已满)②:271641475(500人)2.《嵌入式Linux实用教程》视频清单:第1课:Linux基本操作指令第2课:Makefile第3课:Linux常用软件第4课:U-Boot-2013.04搭建适合OK6410模板第5课:初步编译U-Boot-2013.04第6课:U-Boot-2013.04启动分析1第7课:U-Boot-2013.04启动分析2第8课:SD卡启动U-Boot原理第9课:SD卡启动U-Boot-2013.04移植1(解开众多商家SD卡启动机密)第10课:SD卡启动U-Boot-2013.04移植2(解开众多商家SD卡启动机密)第11课:SD卡启动第12课:Signal # 8 caught错误第13课:MMC驱动移植第14课:FAT文件系统第15课:U-Boot命令第16课:NAND Flash移植(1)第17课:NAND Flash移植(2)第18课:NAND Flash移植(3)第19课:DM9000网卡移植第20课:Linux-3.8.3内核介绍第21课:初步测试内核(1)第22课:初步测试内核(2)第23课:下载地址和入口地址第24课:MTD分区第25课:NAND Flash移植第26课:DM9000网卡移植第27课:使内核支持YAFFS2文件系统第28课:制作YAFFS2文件系统第29课:LCD移植第30课:字符设备驱动之LED第31课:字符设备驱动之ADC第32课:块驱动第33课:tslib安装第34课:安装Linux和embedded版本Qt-4.8.4第35课:安装QtCreator编译环境第36课:Qt初体验之Hello第37课:Qt之LED第38课:Qt之ADC第39课:项目拓展学习(1)第40课:项目拓展学习(2)第41—50课:裸板程序设计3. 嵌入式Linux实用教程软件:Ubuntu10.04.4镜像、VMware-7.0.1虚拟机、Source Insight3.5+注册码、SecureCRT_6.6.1_、SD_Writer、UltraEdit10c、USB转串口驱动、等等嵌入式Linux 常用软件。
301© Jacob Beningo 2017J. Beningo, Reusable Firmware Development , https:///10.1007/978-1-4842-3297-2IndexAAbstract Data Types (ADTs)abstractions, 80definition, 81implementation data structure, 82initialization function, 83interface specification, 81operations, 81pop method, 84stack method initialization, 83Stack_Push, 85Abstractions, see Abstract DataTypes (ADTs)Application Programming Interfaces(APIs), 23architecture, 24characteristics, 49consistent look and feel, 53const keyword, 49documentation, 53flexible and configuration, 53Micrium uc/OS-III, 54naming conventions, 50uOS III, 52comparison (API and HAL), 58designing process, 53embedded-software developers, 49FreeRTOS TaskCreate, 54HAL design, 57scope, 48ThreadX tx_thread_create, 55wrappers, 55Assertion fundamentals assert.h header file, 68definition, 68input and pre-condition, 69macro implementation, 69Automating tests, 269BBoogeymanintegration issues, 35issues, 33microcontroller vendors, 34peripheral technique, 35ramifications, 34readability issues, 35Bootloaders framework, 252CCallback functionsArrayInit function, 88definition, 86elements to random numbers, 89implementation, 87initialization code, 87instances, 86lower-level code, 87signal handler, 87Classes definition, 80Cohesion, 11Commercial off-the-shelf (COTS), 1 Coupling method, 11C programming languagebit fields, 15conditional compilation, 18data type, 13demonstration code, 13preprocessor directives, 16structures and unions, 14DData hiding, 86Designing APIapplication framework, 246creation, 247embedded applicationsadvantages, 244application framework, 244disadvantages, 244hardware abstraction layer, 243implementation, 243modifications, 245modules, 245software frameworksbootloaders, 252console applications, 250FAT file system, 254parsers, 251RTOS and schedulers, 248 Design patterns, 90–91Device driver models, 70blocking driver, 70non-blocking driver, 70polling, 71Documentation, 121C codecoding style guide, 144commenting code, 143consistent commentlocation, 146Doxygen tags, 144explanation, 143file header, 145line command, 146mathematical typeidentification, 146template creation, 145update comments, 147 Doxygen (see Doxygen) DoxyWizarddiagrams setup, 131folder structure, 127mode setup, 129output setup, 130project setup, 127run tab, 128wizard tab, 129embedded software, 121enum and struct, 132 functions, 133code block, 136description block, 135factors, 133parameter and return block, 135 pre-condition/post-conditionblock, 135related block, 136revision log, 137start block, 134load operation, 122approaches, 123single source, 123software spectrum, 123Index302main.c file, 122main page, 140modules, 137@Addtogroup comment block, 139header file, 137source files, 138reusable template, 139Doxygen, 124comment fundamentals, 131control and develop documentation, 125 installation, 126Driversabstraction and ADT, 80component definition, 76component organization, 77components, 77–78expected results andrecommendations, 91files, 77fundamental unit, 76interface, 64, 78component identification, 66design contract, 66–67hardware abstraction layer, 65lasagna software architecture, 65outputs, 67pre-conditions, 67modules, 78naming convention, 78object-oriented programming, 79procedural language, 79EEEPROM devices, See alsoMemory devicesdatasheet, 221EepromErase_t, 239EepromRegister_t definition, 226extending HAL, 237_ext file, 239feature comparison, 222files, 238interface, 224memory devices, 221repeat, 237stubs and documentation templates functions, 227Init(), 228–229Read(), 229–230Write(), 230–231target processor, 231functions, 232initialization function, 232read function, 235write function, 233testing, 237write state enumeration, 226 Embedded-software processes/codebase, 295Encapsulation, 80, 86Error handling, 89FFAT file systems, 254Firmware projectadvantages, 4benefits, 4code reuse, 1development team, 3disadvantages, 4embedded-software, 5–6architecture, 20dependencies and interactions, 19design/reuse, 18Index303formal models, 21functional boundary, 19interfaces, 19low-level driver, 19portable firmware creation, 19three-layer model, 20features, 3HAL (see Hardware AbstractionLayers (HAL))microcontrollers, 2modularity, 9module coupling and cohesion, 10project development time, 2portability issues (see C programming language)qualities of, 8software, 3smart solar panel, 7standard revisions, 12Functional testingblack-box/white-box testingmethods, 264test-driven development, 265testing process, 264GGeneral-purpose input/output (GPIO) datasheet, 167HAL interface, 169microcontrollers, 168overview, 167peripheral features, 168stubs and documentation templates, 172 Dio.c, 182Dio_Config.c, 178Dio_Config.h, 174Dio.h, 180HAL organization, 174target processor, 192ChannelRead, 195ChannelWrite, 196Dio_ChannelToggle function, 196Dio_ChannelWrite function, 196GPIO initialization, 194pointer array memory map, 193RegisterRead, 197RegisterWrite, 197repeat option, 198test harnesses, 198HHardware abstraction layer (HAL), 21, 149 application layer, 22APIs, 30 (see also ApplicationProgramming Interfaces (APIs)) architecture, 23board-support package, 22benefits, 21, 33characteristics, 36, 150C99, 38coding standards, 36debugging software, 43deterministic and well-understoodbehavior, 41error-handling and diagnosticcapabilities, 42evaluation, 44extensible, 40hardware features, 39integrated regression testing, 43integration server, 43modern compiler, 38modular and adaptable, 40Firmware project (cont.) Index304reasonable documentation andcomments, 37well-defined coding standard, 37 configuration layer, 22 comparison list, 152design process, 151all-encompassing HAL, 161core features identification, 161Doxygen, 162initialization, 164iterate, 163multiple development kits, 164naming conventions, 164register-access hooks, 162second set of eyes, 162view, 163driver layer, 22factors, 46Good, Bad, and Ugly, 33GPIO peripheral, 47interfacecallback interface, 154creation, 153developers, 155generic definition, 154peripheral features, 153 landscape, 31microcontroller peripheraldatasheet, 46, 152 middleware, 22peripheral identification, 152, 160 platform, 31potential issues (see Boogeyman) software terminology, 22stubs and documentationtemplates, 155target processor(s), 158testing, 158Hardware in-loop (HIL) testing, 266 automating tests, 269COMM port, 267components, 267debugger, 267factors, 268Python scripts, 268regression, 268I, J, K, LInheritance, 80Internet of Things (IoT), 6Invariants, 68M, NMemory devicesflash and EEPROM devices, 219internal and external devices, 220issues, 220overview, 219Memory mapCPU, 63EEPROM, 63flash memory regions, 62generic microcontroller memory, 64memory, 64microcontroller, 62peripheral memory, 63RAM, 62–63ROM, 62Memory-mapping methodologiesarrays, 106controls, 101declaration, 104direct register access, 102methods, 101Index305non-constant pointer, 104pointers, 102register bit, 103structures, 105volatile keyword, 103–104Module coupling, 11OObject-Oriented Programming (OOP), 79 Objects definition, 80P, QPolling vs. Interrupt-driven drivers, 71 attitude determination and control, 76 DMA-controlled data transfer, 75Hello World, 72interrupts, 74printf statement, 72, 74transmit interrupt frequency, 73UART transmit interrupt duration, 74 Portable firmware see Firmwareprojectcharacteristics, 27code evaluation, 26portability, 27reuse software, 25,Post- c onditions, 68Practical approachdefinition, 284desired results and outcomesbusiness perspective, managementand shareholders, 281development costs, 282identification, 280quality increases, 283time to market, 281evaluation, 284metrics, 285phases, 278recognizing design patterns, 288results, 288software practice improvement, 280templates and checklists creation, 289tracking metrics, 285unpractical environment, 277VCS (see Version-control systems (VCS)) Pre-conditions, 68Project organization, 24RReal-Time Operating System (RTOS), 249 advantages, 249compiler optimizations, 249microchip, 249scheduler, 248scheduling algorithm, 250wrapper layer, 249Regression testing, 257, 268Renesas Synergy™ platform, 272 Reusable drivers, 95const keyword, 99extern and static keywords, 95explicit, 97function and variable scope, 97global variables, 96implicit, 96programming language, 96implementation, 117memory-mapping (see Memory-mapping methodologies)timer (see Timer driver)volatile keyword, 98Memory-mapping methodologies (cont.) Index306location, 99optimization, 98prevent code optimization, 99UART Tx, 98SScheduler, see Real-Time OperatingSystem (RTOS)Serial Peripheral Interface bus (SPI) advantages, 201architecture, 202datasheet, 202features, 203hardware level, 201interface, 204repeat, 216stubs and documentation templates design patterns, 205init function, 206module files, 206transfer function, 207target processorarray mapping, 209flow chart, 213initialization function, 210Spi_Transfer function, 212–213 testing, 215Side effects, 68Standard tests, 263TTest-Driven Development (TDD), 265 Testingapplication software, 270block diagram, 270deadlock, 272events, 271reusable firmware, 271task statistics, 271automation and regression, 258development teams, 258embedded system, 257functional testing (see Functionaltesting)HIL testing, 266regression testing, 257renesas Synergy™ platform, 272standard tests, 263unit test, 258Timer driverchannel definition, 110configuration structure, 109configuration table, 108, 110design pattern, 116driver interface, 116initialization function, 112init loop code, 115overview, 107peripheral channels, 109pointer arrays, 111steps, 108UUnit testing, 258cyclomatic complexityfunction, 261if/else statements, 262linearly independent paths, 261measurements, 260nodes (program statements), 262parameters, 261tools, 263function, 259harness test, 259Index307V, W, X, Y, ZVersion-control systems (VCS) add files, 294code-comparison tools, 295commit frequently, 293log information, 293–294 process definition, 294 lock modules, 294 merging code branches, 295Index308。
Linux操作系统第一章:Linux简介与系统安装实验一:实验环境搭建一台宿主机(Windows系统)加两台虚拟机(Desktop+Server)要求:(1)掌握VMware虚拟机的安装(2)利用VMware虚拟机安装Ubuntu Linux18.04桌面版操作系统(3)利用VMware虚拟机安装Ubuntu Linux18.04服务器版操作系统(4)从宿主机登录桌面环境和服务器环境(SSH登录)(5)练习涉及到的基本命令,如apt-get、ifconfig、ssh等(6)练习vim编辑文件基本操作等Tips:(1)绘制网络拓扑图(2)把遇到的问题和如何解决记录下来。
实验环境设置☐宿主机(Windows)•网络配置VMware Network Adapter(VMnet8)☐客户机•Ubuntu-Server(ubuntu-18.04.6-live-server-amd64)•Ubuntu-Desktop(ubuntu-18.04.6-desktop-amd64)虚拟机安装安装时网络类型选择NAT方式安装完成后的两台Ubuntu虚拟机宿主机:Windows记录宿主机IP地址客户机1:Ubuntu-Server命令行模式记录IP:192.168.126.130客户机2:Ubuntu-Desktop图形化操作方法记录IP:192.168.126.131NAT模式宿主机:Windows192.168.126.1192.168.126.130192.168.126.131客户机1:Ubuntu-Server客户机2:Ubuntu-DesktopSSH服务1.安装SSH服务2.启动SSH服务3.配置SSH服务(可选)4.验证SSH服务Desktop版客户机安装SSH服务Desktop版客户机安装SSH服务:sudo apt-get install openssh-serverDesktop版客户机启动SSH服务: sudo systemctl start sshDesktop版客户机启动SSH服务: sudo systemctl start sshDesktop版客户机端修改SSH配置文件:端口22修改为1022 vi /etc/ssh/sshd_configSSH验证-从宿主机连接Desktop客户机2: ********************.126.131SSH验证-从宿主机连接Server版客户机1: ***********************.126.130Desktop版客户机查看SSH状态:记录监听端口和连接情况Server版客户端1查看SSH状态Desktop版客户机安装 net-tools:sudo apt-get install net-toolsDesktop版客户机查看IP地址: ifconfigDesktop版客户机查看网络连接情况:Netstat -aServer版客户机查看网络连接情况:Netstat -a。
基础是你已经安装了Ubuntu,以及相关软件:超级终端minicom 及C/C++ compiler environment。
在Ubuntu上可使用下面终端命令安装 minicoom和编译环境。
#sudo apt-get install minicom#sudo apt-get install build-essentialStep 1:将光盘Linux 目录中的arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz 复制到Lubuntu的当前目录下,执行解压命令:#sudo tar xvzf arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz –C /注意:C 后面有个空格,并且 C 是大写的,它是英文单词“Change”的第一个字母,在此是改变目录的意思。
这样 arm-linux-gcc 的相关文件就Copy到root用户的Opt目录中Step 2:把编译器路径加入系统环境变量,运行命令#sudo gedit ~/.bashrc编辑~/.bashrc 文件, 注意“ bashrc ” 前面有一个“ . ”,修改最后一行为export PATH=$PATH:/opt/FriendlyARM/toolschain/4.5.1/bin注意路径一定要写对,否则将不会有效。
如图,保存退出。
入arm-linux-gcc –v,会出现如下信息,这说明交叉编译环境已经成功安装。
编译链接 arm-qte-4.7.01) 解压包到自己制定的目录,例如 arm-qte-4.7.02) 终端中运行 ./build-all(首先,注意不能双击运行,必须在终端中运行;其次,不使用 sudo)大约要安装2个小时当运行到出现如下提示后:cd src/tools/bootstrap/ && make -f Makefile installmake[1]: 正在进入目录`/home/administrator/arm-qte-4.7.0/qt-everywhere-opensource-src-4.7.0/src/tools/bootstrap'make[1]: 没有什么可以做的为 `install'。
make[1]:正在离开目录`/home/administrator/arm-qte-4.7.0/qt-everywhere-opensource-src-4.7.0/src/tools/bootstrap'cd src/tools/moc/ && make -f Makefile installmake[1]: 正在进入目录`/home/administrator/arm-qte-4.7.0/qt-everywhere-opensource-src-4.7.0/src/tools/moc'mkdir: 无法创建目录“/usr/local/Trolltech”: 权限不够make[1]: *** [install_target] 错误 1make[1]:正在离开目录`/home/administrator/arm-qte-4.7.0/qt-everywhere-opensource-src-4.7.0/src/tools/moc'make: *** [sub-moc-install_subtargets-ordered] 错误 2./build-all: 第 12 行: cd: /usr/local/Trolltech/QtEmbedded-4.7.0-arm: 没有那个文件或目录在终端中运行:cd qt-everywhere-opensource-src-4.7.0sudo make install加入环境变量(步骤类似Step2,在最后一行再加入)#sudo gedit ~/.bashrcexport PATH=$PATH: /usr/local/Trolltech/QtEmbedded-4.7.0-arm/bin下载和安装 Qt SDK for Open Source C++ development on Linux/X11 32-bit - Offline Installer(已经上传到我们的共享目录中)On Linux/Unix, you need to make the file executable in order to run it. You can either do this with your desktop's file manager or, at the command line, type:在终端中运行:chmod u+x Qt_SDK_Lin32_offline_v1_1_2_en.runYou should now be able to execute the file as normal. You can do this from the command line by typing:在终端中运行:./Qt_SDK_Lin32_offline_v1_1_2_en.run随即进行图形化的Qt_SDK的安装(自己定制全安装),其包含了creator,designer等等。
Step 5:配置QT Creator以支持开发和在desktop和arm上程序的发布。
在打开的QT Creator进入tools -> options,在Qt4下加入支持ARM的qmake命令的路径,如图:然后要将交叉编译的工具链加入到Tool Chains,如下图:以后新建项目QT Creator时会自动包含对ARM的编译选项。
如果对ARM的编译失败,可以打开Projects,选择ARM的选项,展开build environment,检查PATH一项中是否有/usr/local/Trolltech/QtEmbedded-4.7.0-arm/bin,没有则加入;注意分隔用冒号。
检查编译后的文件(例如HelloARM)是否在ARM上运行的方法:#file HelloARM显示出带有ARM的信息即可。
将该文件拷贝到SD卡中可以通过minicom在板子上运行。
Step 6:配置超级终端以及通过超级终端调试在终端输入minicom –s配置端口号为ttyS0,Hardware Flow Control改为No;然后退出(不是退出minicom);minicom初始化后显示root命令行即成功。
如果不成功端口号改为ttyS1重试。
要保存配置,用sudo minicom进入进行配置。
要用minicom的指令退出,强行关闭终端会让端口无法释放。
通过minicom运行在SD卡上的程序步骤:#cd sdcard#./HelloARM –qws&可以在板子上看到运行结果。
(目前存在的问题,无法进行输入和交互. ) maybe1)需要配置目标机的环境2)需要准备一个sh文件未完待续…Step 7:部署到arm上直接运行基本原理是:修改宿主机上arm 版本的QtE-4.7.0,然后部署到目标机(arm 板)上。
宿主机上QtE-4.7.0的目录是: /usr/local/Trolltech/QtEmbedded-4.7.0-arm假设1) 我们编译的arm应用程序位于当前用户的Fshy_Arm_Build目录, 其包括两个文件:input.txt 和 test2) 我们已经在 QtE-4.7.0的demos目录中建立了应用程序的目录wudang/fshy1. 进入我们的程序的输出目录:# cd Fshy_Arm_Build2. 将input.txt 和 test 文件copy到目录# sudo cp input.txt test /usr/local/Trolltech/QtEmbedded-4.7.0-arm/demos/wudang/fshy3. 编辑部署文件,config.xml该文件位于 demos/embedded/fluidlauncher目录下# sudo gedit /usr/local/Trolltech/QtEmbedded-4.7.0-arm/demos/embedded/fluidlauncher/config.xml修改后的文件如下:<demolauncher><demos><example filename="../embeddedsvgviewer/embeddedsvgviewer" name="SVG Viewer" image="screenshots/embeddedsvgviewer.png" args="../embeddedsvgviewer/shapes.svg"/><example filename="../styledemo/styledemo" name="Stylesheets" image="screenshots/styledemo.png"/><example filename="../../deform/deform" name="Vector Deformation" image="screenshots/deform.png" args="-small-screen"/><example filename="../../pathstroke/pathstroke" name="Path Stroking" image="screenshots/pathstroke.png" args="-small-screen"/><example filename="../../wudang/fshy/test" name="String Searching" image="screenshots/wudang.jpg" args="-small-screen"/><example filename="../../../examples/widgets/wiggly/wiggly" name="Wiggly Text" image="screenshots/wiggly.png"/><example filename="../../../examples/painting/concentriccircles/concentriccircles" name="Concentric Circles" image="screenshots/concentriccircles.png"/></demos><slideshow timeout="60000" interval="10000"><imagedir dir="slides"/></slideshow></demolauncher>注意:1)需要根据应用程序,准备一张Logo图片,其大小需要符合要求,格式可以是jpg或者png等,例如 wudang.jpg2)将其copy到demos/embedded/fluidlauncher/screenshots4. 回到本用户的根目录,修改 mktarget 文件,并打包。