Learn together Azure Sphere (2) - Azure Sphere development environment and prepare statements equipment

This section are as follows:

First, install Development Kit (paper windows version, for example)

Second, the new Azure Sphere Development Board to manually update the operating system Azure Sphere

Third, the configuration and Azure Sphere extended VS Code

Fourth, the statement Azure Sphere device (herein are to demonstrate a new device)

       Create a user account and log on to the Microsoft Azure Sphere services;

       User (Microsoft account) to create a tenant;

       Disclaimer: The Azure Sphere device ID is bound to tenants, this process is also known as unclaimed;

V. configure the device via WIFI network

Sixth, enable the development of applications on the device

 

Video Tutorial:

You can watch a video explaining the B station: https://www.bilibili.com/video/av98009311/

Photo explanation:

First, install the development tools (paper windows version, for example)

Reference documents: https://docs.microsoft.com/zh-cn/azure-sphere/install/install-sdk

Azure Sphere Development board interface into the computer will be prompted three com port, as shown in the Device Manager via USB:

img-c2c4db95-ce68-4787-9f8f-163b4fc7774f.png

If another error occurs, or see less than three COM ports, refer to troubleshoot Windows installation problems for help.

 

Azure Sphere SDK for Windows platform there are two types, only the installation of a class can not be installed at the same time two :

Azure Sphere 1. for Visual Studio SDK:

           Use Visual studio development, need:  Visual Studio Enterprise, Professional or Community 2019 version 16.4 or later.

           Use Visual Studio Code development.

2. for Windows Azure Sphere SDK:

            Use the Windows command prompt development;

            Use Visual Studio Code development.

In this paper, the use of "for Windows Azure Sphere SDK" + VS Code development. 

 

SDK Download: https://docs.microsoft.com/zh-cn/azure-sphere/install/install-sdk#azure-sphere-sdk-for-windows

SDK installation:

img-67cf3336-9166-4df2-b0c2-3c10b512a3e7.png

 

img-fc160699-36aa-41c1-9b86-bad7a3f3373c.png

After installation is complete, the Start menu, the program as shown below:

img-bfe9afd A-be24-4cd2-92bf-9c3ee950f24a.png

 

Second, the new Azure Sphere Development Board to manually update the operating system Azure Sphere

Installation of the board's back button cell

img-4f841183-3311-48d6-9757-c30cc47aeb44.png

Connected to a Windows computer via the included USB cable

img-535bb2ba-c8bb-4393-9db8-e70c80e885d2.png

 

For unused Azure Sphere Development Board, for the first time, you need to refer to the following documents Azure Sphere OS upgrade:

https://docs.microsoft.com/zh-cn/azure-sphere/resources/update-old-seeed-os

The upgrade process is simple:

1. 打开Azure Sphere Develop Command Prompt

2. Enter the command and waits for the successful implementation: azsphere device recover

  img-76fc42ad-b0d7-41ba-a947-b721a7a6dac4.png

 

Third, the configuration and Azure Sphere extended VS Code

 

VS Code Azure Sphere mounting extensions:

img-b84aa5dd-f7ee-4432-b247-68862f4de74b.png

 

对于本文中的“用于Windows的Azure Sphere SDK” 和VS Code 开发应用程序,还需要安装如下两个程序:

1. CMake  https://cmake.org/download/

2. Ninja    https://github.com/ninja-build/ninja/releases

具体参见微软官网:https://docs.microsoft.com/zh-cn/azure-sphere/install/development-environment-windows#use-vs-code-with-the-azure-sphere-sdk-for-windows

对于CMake的安装,直接下一步下一步就可以了:

img-d3b450a5-7e09-4735-89a2-858a89554592.png

 

对于Ninja,需要解压到某目录后,设置环境变量:

img-be637cf5-a004-4acc-a7a4-b064a6b9d6b1.png

img-cbde67b6-4ff5-4fcf-afc0-6ae342bc24b5.png

 

Azure Sphere 开发板支持两种应用程序:

1.高级应用程序

2.RTApp实时应用程序

实时应用程序主要利用MCU中的两个ARM Cortex-M4 处理器在实时操作系统上RTOS进行开发,本系列文章暂时不做该内容的介绍。

截至到此,我们已经配置完成了开发高级应用程序的环境,对于RTApp的开发环境配置,本文不再介绍,请参见官网:

https://docs.microsoft.com/zh-cn/azure-sphere/install/development-environment-windows#real-time-capable-application-development

 

四、声明 Azure Sphere 设备(本文中均以一个新设备来进行演示)

       使用Microsoft 账户创建用户并登录到Azure Sphere 服务;

       使用用户(Microsoft 账户)创建租户;

       声明:将Azure Sphere 设备ID绑定到租户,该过程也称为认领;

 

三个步骤的最终目的就是声明设备,声明设备是将设备ID和Azure Sphere 租户绑定,也称之为“认领”的过程,一旦绑定,即使你将Azure Sphere 设备进行二次销售,该绑定也不能修改。

关于声明的详细步骤,请参见官网:https://docs.microsoft.com/zh-cn/azure-sphere/install/claim-device

本文中,简化了官网文档,仅假设我们操作的设备是一台全新的Azure Sphere,故而很多步骤是不需要操作的。

1. 通过命令登录Azure Shpere,对于刚装好SDK并第一次使用SDK,使用 --newuser 参数以及 Microsoft 帐户电子邮件地址可以创建一个账户并登录:

azsphere login --newuser <email-address>

按照提示输入Microsoft 账户的密码:

img-62058dd7-af4e-4335-b78f-b194d0c96065.png

 

同意授权:

img-1e53ab6b-7df0-45bd-a6ba-3dfc5de7b3c2.png

img-0bcc0e3e-f8d4-4f92-a0d8-e898f894ace0.png

 

登录成功之后:

  • 如果你有权访问单个租户,则默认选中该租户,此时可继续执行下一步。

  • 如果你无权访问任何租户,则需要创建租户

  • 如果以前已将 Azure Sphere 与 19.09 SDK(或早期版本)配合使用,则可能需要迁移租户

  • 如果你有权访问多个租户,则需要选择一个。 有关详细信息,请参阅 azsphere tenant select 选择租户后,请继续执行下一步。

在本例中,这是我们第一次使用Azure Sphere,故而没有权限访问任何Azure Sphere 租户,需要先进行创建:

执行如下命令:

azsphere tenant create --name <my-tenant>

The <my-tenant> substituted with a name recognizable to other users, for example, "Contoso Ltd" or "Contoso Dishwasher Division".  If the name contains spaces, enclose it in quotation marks.  All names must be unsigned alphanumeric characters.

img-02960db0-9e34-403c-a651-c0fcd0990712.png

After the tenant is created, run the following command claimed device, the claim is successful, the device can not migrate again to the other tenants.

azsphere device claim

img-9a0232a4-db7a-444c-b4bd-9b6eab85b0dc.png

 

V. configure the device via WIFI network

 

Wifi configuration using the following command:

azsphere device wifi add --ssid <yourSSID> --psk <yourNetworkKey>

 

img-3acbbc6d-3a76-4a15-b943-381ee43a69f0.png

Configuration display state unknown is a normal phenomenon, use the following command to query network status again:

azsphere device wifi show-status

img-dfed2a6f-3814-4056-ba07-ec02a7898ceb.png

Use the following command to check the OS version Azure Sphere Development Board:

azsphere device show-deployment-status

In this example it is 20.01 as of the latest version 2020.03 of the month, is our beginning of this article manually upgrade to the latest version.

img-9921db8f-09d2-4abf-8ee8-bbb37dda6517.png

 

Under normal circumstances, the Azure Sphere each boot device will automatically check for updates, if a long time for the shutdown, the device will check for 24 hours, if an update will be automatically downloaded and installed, this process may be 15-20 minutes to install When finished, the device may restart.

Sixth, enable the development of applications on the device

 

Run the following command on the boot device application development

azsphere device enable-development

img-d5ae10fe-8c28-40ad-8a34-340af9e786bf.png

The process will download configuration files to configure the development board, and installation and commissioning services on the local Windows system.

 


Guess you like

Origin blog.51cto.com/10117438/2480966