Welcome to the start of the Embedded in Embedded program. 欢迎来到EiE课程。
In this course we’re going to take you through everything you need to get up and running a development environment for ARM Cortex processors. 首先，我将带大家一起了解一下运行ARM Cortex处理器开发环境需要的所有准备。
In this first lesson, we’ll look at installing the two main pieces of software you will need to access the EiE firmware and start writing and debugging code. 在第一节课里，我们先安装访问EiE固件和编写/调试代码所需要的两个主要软件。
All of this can be done without any hardware using a simulator that is built in to the design software. 所有这些不需要使用任何硬件，仅使用设计软件内置的模拟器即可。
However, if you already have an EiE development board, you can use that and see the results on your hardware. 如果你已经有了开发板，你可以通过它观察实际的结果。
Please do not plug in your development board yet if you have one! 现在请暂时不要连接你的开发板！
We want to make sure that the drivers you’ll need are in place and ready to go. 我们需要先确认是否已正确安装了驱动。
A great thing about embedded systems development is that there are a ton of software tools available with free versions that anyone can access. 对嵌入式系统开发极有利的一点就是，有无数可以使用的免费工具软件。
The main development software we use in EIE is called “IAR Workbench.” EiE使用的主开发软件叫做“IAR Workbench (工作台)”。
You will see another popular IDEs for ARM processors called KEIL, 你们很快会接触到另一个ARM处理器的IDE（集成开发环境）叫做“KEIL”
and there is a gcc compiler that you can access through various front ends like Eclipse. 以及Eclipse这种可以通过多种前端访问的编译器
Each has advantages and disadvanges. 每一种都是各有利弊。
The free versions of IAR and KEIL have a code size limit of 32kB – lots of space to build a fully functional system. IAR和KEIL免费版代码大小限制为32KB – 对一个功能完整的系统来说根本不够。
IAR and KEIL are very similar, but we stay with IAR is because versions exists for other non-ARM processors that we use ( like the MSP-430), so having a common platform is really helpful. IAR和KEIL很类似，但是我们多使用IAR，因为使用一个通用平台以兼容其它非IAR处理器是很重要的。
It is fairly simple to port between different IDEs, but you must make sure various high level settings are the same and any compiler-specific directives or special instructions match the IDE you are using. 在不同的IDE之间转换并非难事，但你必须确保不同环境中高级设置的一致性，以及各种专用指令和特殊指令与你当前的IDE相匹配。
So head on over to IAR.com and click on the link here that says IAR Embedded Workbench. 进入IAR.com点击IAR Embedded Workbench。
That will take you to another screen here and you need to scroll down to the Free trials button. Then click Download software. It’s a big download – over 1Gig, so hopefully you have a high speed connection. 转入另一页面，向下翻页至Free trials按钮，点击下载。文件较大（约1G），希望网速够快~ Run the file once you have it. It has to unpack itself which also takes a long time. 下载完后运行，自解压时间也较长。 Once that’s done, install the main program first. If you already have an IAR installation on your computer, a window will appear to tell you. We suggest installing a new instance which is what we do since we have different software that we are working on specific for each verison. 结束后，先安装主程序；如果你电脑上已经安装了IAR，会有弹出窗口提示。我们建议进行全新安装，以保证使用的版本一致。 Next you have the window for where to install the software and then you must accept the license agreement. We like to choose where to install, so create a directory like EWARM_8_10_1 that is specific to this version. 下一步，选择安装位置，接受安装条款。可以新建一个像名为EWARM_8_10_1的文件夹专门安装这个版本的程序。 Click next. For the driver selection window, you might as well keep them all. 点击下一步。在安装位置选择窗口，你也可以使用所有默认设置。 Click next. If you want to change where the software links appear in Windows you can do that but we don’t usually care so click next. Everything should be done so you can now click Install. Again, this takes a long time so you can pause the video now while it installs. We’ll jump forward to when it’s done. 点击下一步。如果你想更改软件链接位置，在这里可以设置；多数情况下我们默认进入下一步。点击开始安装，时间也比较长，你可以暂停录像等待安装结束。 You’ll probably get a message about USB dongle drivers. This matters if you buy a real license and get a hardware USB dongle with the key. Since it’s unlikely you will do this, skip it by choosing “No.” Depending on your system, you might see Visual C++ being installed. In the final window, you don’t need to view the release notes but we do want to launch IAR. 你们可能会碰到插入电子狗的提示信息，如果你购买了正版的就按提示继续。如果没有的话，选择“No”。根据你的系统情况，你可能需要安装VC++。最后，可以忽略版本注释，进入IAR。 IAR will start loading and you’ll also get several windows popping up as all of the other debugging drivers install. They are not dangerous to your computer or anything like that, and do not take up very much space so just click through to accept them. Our system already has those drivers so you will that we choose Cancel on most so we don’t waste time. IAR开始载入，你们会碰到几个弹窗，是提示安装其它一些调试驱动的。所有安装的东西对你们的电脑没有任何不良影响，而且占用空间也不大，点击确认一并都装了。如果我们系统已经安装了这些驱动，就选择取消以节省时间。 I still want to come back to the main screen and install the programmer drivers for JLink. Open the folder for J-Link and run the InstDrivers executable. You won’t see much happening even if you click it many times. All it does is quickly copy some files over. As long as that’s done you should be good to go. You can close all of the installation programs then flip back to IAR. 回到主界面，安装link。打开Jlink文件夹，运行InstDrivers。你们基本看不到什么安装过程，因为只是一些快速的文件复制而已。安装完后，你们的准备工作就全部就绪了。关闭所有安装界面，进入IAR。 Keep in mind this Example projects that you might want to come back to one day. It is available under Help > Information Center. 记住这个项目示例，因为以后你们可能随时来回顾它，它在Help菜单下->Information Center中。 What we really want to do is find License Manager under the Help menu. License manager might start automatically the first time you run IAR but if it doesn’t you can launch it yourself. It’s a very slow program but you only have to do this once. 我们要做的是在Help菜单中找到“License Manager”，在第一次运行IAR时也可能自动触发，如果没有的话我们需要手动打开。过程很漫长，但你们必须做一次。 Once the license manager is running, choose License > Get Evaluation License. “License Manager”运行后，选择License->Get Evaluation License。 Click the Register button to open the registration page. Make sure you choose “32kB Kickstart” edition. Don’t worry about this limitation. You can, if you want, choose “Time limited” which is a full version but only good for 30 days. So it’s suggested to choose Code Size limited for all of EiE. 点击“Register”按钮打开注册页面，确认你选择的是“32KB Kickstart”版本。不用在意这个限制；你也可以选“时间限制”完整版，但只能用30天。建议选代码大小限制的版本。 Put in the stuff you need – the places with the stars are required. The most important field is your email address because the license will be sent there, so make sure it is correct. Add your phone number and feel free to put the EiE website in. Choose College / University for industry. The processor we use is from Atmel, though this doesn’t really matter. 填写信息 – 带星号的必填。最重要的是确保你的email地址正确无误，因为证书会发去那里。填写你的电话号码，可以填写EiE网址。选择学校。我们使用的处理器是Atmel的，这并不重要。 All the other buttons: give the least information as possible. We suggest you indicate you already use the product to avoid sales calls from IAR. When it’s all done, click Submit. This will open another webpage and you should get an email. 其它按钮：尽量简单填写即可，建议你们表明已经使用了该产品，以免IAR的查访电话。完成以后，点击提交，转入另个页面并收到一封邮件。 Click the link in the email and you will get to a final webpage where you can copy and paste the code provided. Find the License Manger window that is still open and paste your key into the space provided. Confirm the details and then click next which will take some more time to generate the final keys that are specific to your computer. 点击邮件中的链接，进入最后的页面，复制页面中的代码，到“License Manager”中粘贴，确认所有信息，点击下一步进行注册校验。 Once it is all finished, you get a confirmation and return to the main License Manager window. You should see a green square which indicate that your license has been successfully activated. 结束后，系统确认并返回“License Manager”主窗口，你们可以看到一个绿方框表示你的证书已经被成功激活了。 Exit License manager. That is all we will do with IAR for. Next we want to install Github and look at how we access the EiE code base to get the lastest firmware. 退出“License Manager”，下一步，我们将安装Github，以及学习如何访问EiE代码库以获取最新版本固件。 Open Github.com in your browser. In the website search bar, look for “Desktop.” There are two parts to this: a local version that will run on your machine and a cloud component. Everything is open source and stored in a “respository” which is just a word for a collection of code. You can look at this if you want, but really we do this just because it’s the easiest way to find the link to the software. Click the link and that will take you to the download page. 进入github.com，搜索“Desktop”。该访问由本地电脑+云端组件两部分共同运行完成。所有信息都是开放的，储存在“资源库”中。我们这么做仅是为了便捷的找到软件的链接，点击链接进入下载页面。 Click the download button. When it’s done, run the executable. While that’s happening, you need to create a user account on Github.com. If you already have one, just sign in. If you need to create one, click “Sign up” and follow the steps. 点击下载按钮，完成后运行执行文件。需要先建一个Github用户账号，如果已经有账号，请登录。如没有，点击创建按步进行。 When finished, return to the Github desktop installation where you can sign-in to the desktop application. Use the same username and password as you have for Github.com. 账号创建成功后，返回Github桌面登录界面，使用创建的账号登录。 On the following configuration screen, just leave it defaulted and click Continue. We prefer to not send data, so we make sure the box is not checked and click finish. 接下来进入配置界面，使用默认设置，继续。建议不发送数据，选择相应选项，点击完成。 Now we are at the screen where you can import code repositories. You will use the existing EiE repository that’s online. Go back to Github and make sure you are signed in. At the top left, enter “Engenuics” in the search area. The first hit should be a link to Engenuics/Razor_Atmel. 现在我们位于代码库导入窗口，你可以使用现有的在线EiE资源库。回到Github，确认处于登录状态，在左上位置搜索栏里输入“Engenuics”，第一个搜索结果应该是“Engenuics/Razor Atmel”的链接。 Click the green button and choose Open in Desktop. You will be asked to choose a folder. Make sure you choose an easy folder to get to because you will use it often. We recommend \\EiE\EiE_Git. 点击绿色按钮，选择在桌面打开，会有提示选择一个文件夹，确保你们选择一个简单目录的文件夹，因为以后将会经常需要打开。建议\\EiE\EiE Git。 Ours is already downloaded from before so we are just updating. This takes an exact copy of the whole repository which takes a little bit of time. When it’s finished, you will see a screen like this. A repository is a collection of different “branches” which are versions of the code based on the “master” branch. We will use these in different modules of EiE. We will see this more in other lessons. 我们之前已经下载了，现在只需更新。完成后，看到这样的窗口。资源库是一个各种“分支”的集合，是基于“主干”的不同代码版本。我们将在不同的EiE模块中分别使用到，到时候再细说。 That’s it for this lesson! 本节课到此结束！