You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this tutorial you use Azure RTOS to connect the NXP MIMXRT1050-EVKB Evaluation kit (hereafter, the NXP EVK) to Azure IoT. The article is part of the series [Getting Started with Azure RTOS](https://go.microsoft.com/fwlink/p/?linkid=2129824). The series introduces device developers to Azure RTOS, and shows how to connect several device evaluation kits to Azure IoT.
19
+
The **Quickstart** button above provides the complete steps for creating an IoT Central application and then configuring, building and flashing the device.
19
20
20
-
You will complete the following tasks:
21
+
For guidance on connecting additional devices, see the series [Getting started with Azure RTOS](https://go.microsoft.com/fwlink/p/?linkid=2129824).
21
22
22
-
* Install a set of embedded development tools for programming the NXP EVK in C
23
-
* Build an image and flash it onto the NXP EVK
24
-
* Use Azure IoT Central to create cloud components, view properties, view device telemetry, and call direct commands.
23
+
## What you need
25
24
26
-
## Prerequisites
25
+
* The [NXP MIMXRT1060-EVK Evaluation kit](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt1050-evaluation-kit:MIMXRT1050-EVK)
26
+
* USB 2.0 A male to Micro USB male cable
27
+
* Wired Ethernet access
28
+
* Ethernet cable
27
29
28
-
* A PC running Microsoft Windows 10
29
-
*[Git](https://git-scm.com/downloads) for cloning the repository
30
-
* Hardware
31
-
32
-
> * The [NXP MIMXRT1050-EVKB](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt1050-evaluation-kit:MIMXRT1050-EVK) (NXP EVK)
33
-
> * USB 2.0 A male to Micro USB male cable
34
-
> * Wired Ethernet access
35
-
> * Ethernet cable
36
-
37
-
## Prepare the development environment
38
-
39
-
To set up your development environment, first you clone a GitHub repo that contains all the assets you need for the tutorial. Then you install a set of programming tools.
40
-
41
-
### Clone the repo for the tutorial
42
-
43
-
Clone the following repo to download all sample device code, setup scripts, and offline versions of the documentation. If you previously cloned this repo in another tutorial, you don't need to do it again.
The cloned repo contains a setup script that installs and configures the required tools. If you installed these tools in another tutorial in the getting started guide, you don't need to do it again.
54
-
55
-
> Note: The setup script installs the following tools:
> *[Termite](https://www.compuphase.com/software_termite.htm): Monitor serial port output for connected devices
59
-
60
-
To install the tools:
61
-
62
-
1. From File Explorer, navigate to the following path in the repo and run the setup script named *get-toolchain.bat*:
63
-
64
-
> *getting-started\tools\get-toolchain.bat*
65
-
66
-
1. After the installation, open a new console window to recognize the configuration changes made by the setup script. Use this console to complete the remaining programming tasks in the tutorial. You can use Windows CMD, PowerShell, or Git Bash for Windows.
67
-
1. Run the following code to confirm that CMake version 3.14 or later is installed.
There are several ways to connect devices to Azure IoT. In this section, you learn how to connect a device by using Azure IoT Central. IoT Central is an IoT application platform that reduces the cost and complexity of creating and managing IoT solutions.
78
-
79
-
To create a new application:
80
-
1. From [Azure IoT Central portal](https://apps.azureiotcentral.com/), select**My apps** on the side navigation menu.
81
-
1. Select **+ New application**.
82
-
1. Select **Custom apps**.
83
-
1. Add Application Name and a URL.
84
-
1. Choose the **Free** Pricing plan to activate a 7-day trial.
85
-
86
-

87
-
88
-
1. Select **Create**.
89
-
1. After IoT Central provisions the application, it redirects you automatically to the new application dashboard.
90
-
91
-
> Note: If you have an existing IoT Central application, you can use it to complete the steps in this article rather than create a new application.
92
-
93
-
### Create a new device
94
-
95
-
In this section, you use the IoT Central application dashboard to create a new device. You will use the connection information forthe newly created device to securely connect your physical devicein a later section.
96
-
97
-
To create a device:
98
-
1. From the application dashboard, select**Devices** on the side navigation menu.
99
-
1. Select **+ New** to bring up the **Create a new device** window.
100
-
1. Leave Device template as **Unassigned**.
101
-
1. Fill in the desired Device name and Device ID.
102
-
103
-

104
-
105
-
1. Select the **Create** button.
106
-
1. The newly created device will appear in the **All devices** list. Select on the device name to show details.
107
-
1. Select **Connect**in the top right menu bar to display the connection information used to configure the device in the next section.
108
-
109
-

110
-
111
-
1. Note the connection values forthe following connection string parameters displayedin**Connect** dialog. You'll add these values to a configuration file in the next step:
112
-
113
-
> * `ID scope`
114
-
> * `Device ID`
115
-
> * `Primary key`
116
-
117
-
## Prepare the device
118
-
119
-
To connect the NXP EVK to Azure, you'll modify a configuration file for Wi-Fi and Azure IoT settings, rebuild the image, and flash the image to the device.
1. On the NXP EVK, locate the **Reset** button, the Micro USB port, and the Ethernet port. You use these components in the following steps.
150
-
151
-

152
-
153
-
1. Connect the Micro USB cable to the Micro USB port on the NXP EVK, and then connect it to your computer. After the device powers up, a solid green LED shows the power status.
154
-
1. Use the Ethernet cable to connect the NXP EVK to an Ethernet port.
155
-
1. In File Explorer, find the binary file that you created in the previous section.
156
-
1. Copy the binary file *mimxrt1050_azure_iot.bin*
157
-
1. In File Explorer, find the NXP EVK device connected to your computer. The device appears as a drive on your system with the drive label **RT1050-EVK**.
158
-
1. Paste the binary file into the root folder of the NXP EVK. Flashing starts automatically and completes in a few seconds.
159
-
160
-
> Note: During the flashing process, a red LED blinks rapidly on the NXP EVK.
161
-
162
-
### Confirm device connection details
163
-
164
-
You can use the **Termite** utility to monitor communication and confirm that your device is set up correctly.
165
-
> Note: If you have issues getting your device to initialize or connect after flashing, see [Troubleshooting](../../docs/troubleshooting.md).
166
-
167
-
1. Start **Termite**.
168
-
1. Select **Settings**.
169
-
1. In the **Serial port settings** dialog, check the following settings and update if needed:
170
-
***Baud rate**: 115,200
171
-
***Port**: The port that your NXP EVK is connected to. If there are multiple port options in the dropdown, you can find the correct port to use. Open Windows **Device Manager**, and view **Ports** to identify which port to use.
172
-
173
-

174
-
1. Select OK.
175
-
1. Press the **Reset** button on the device. The button is located near the Micro USB connector.
176
-
1. In the **Termite** console, check the following checkpoint values to confirm that the device is initialized and connected to Azure IoT.
Keep Termite open to monitor device output in the following steps.
214
-
215
-
## Verify the device status
216
-
217
-
To view the device status in IoT Central portal:
218
-
1. From the application dashboard, select**Devices** on the side navigation menu.
219
-
1. Check the **Device status** of the device is updated to **Provisioned**.
220
-
1. Check the **Device template** of the device has updated to **Getting Stared Guide**.
221
-
222
-

223
-
224
-
## View telemetry
225
-
226
-
With IoT Central, you can view the flow of telemetry from your device to the cloud.
227
-
228
-
To view telemetry in IoT Central portal:
229
-
230
-
1. From the application dashboard, select**Devices** on the side navigation menu.
231
-
1. Select the device from the device list.
232
-
1. View the telemetry as the device sends messages to the cloud in the **Overview** tab.
233
-
1. The temperature is measured from the MCU wafer.
234
-
235
-

236
-
237
-
> Note: You can also monitor telemetry from the device by using the Termite terminal.
238
-
239
-
## Call a direct method on the device
240
-
241
-
You can also use IoT Central to call a direct method that you have implemented on your device. Direct methods have a name, and can optionally have a JSON payload, configurable connection, and method timeout. In this section, you call a method that enables you to turn an LED on or off.
242
-
243
-
To call a method in IoT Central portal:
244
-
245
-
1. Select **Command** tab from the device page.
246
-
1. Select **State** and select**Run**. There will be no change to the devkit as there isn't an available LED to toggle.
247
-
248
-

249
-
1. Unselect **State** and select **Run**. You can view the output in Termite to monitor the status of the methods.
250
-
251
-
## View device information
252
-
253
-
You can view the device information from IoT Central.
254
-
255
-
Select **About** tab from the device page.
256
-

257
-
258
-
## Debugging
259
-
260
-
For debugging the application, see [Debugging with Visual Studio Code](../../docs/debugging.md).
261
-
262
-
## Clean up resources
263
-
264
-
If you no longer need the Azure resources created in this tutorial, you can delete them from the IoT Central portal. Optionally, if you continue to another tutorial in this Getting Started guide, you can keep the resources you've already created and reuse them.
265
-
266
-
To keep the Azure IoT Central sample application but remove only specific devices:
267
-
1. Select the **Devices** tab for your application.
268
-
1. Select the device from the device list.
269
-
1. Select **Delete**.
270
-
271
-
To remove the entire Azure IoT Central sample application and all its devices and resources:
In this tutorial you built a custom image that contains Azure RTOS sample code, and then flashed the image to the NXP EVK device. You also used the IoT Central portal to create Azure resources, connect the NXP EVK securely to Azure, view telemetry, and send messages.
1. Flash the image to the device by copying the image file to the **RT1050-EVK** drive:
278
47
279
-
* For device developers, the suggested next step is to see the other tutorials in the series [Getting started with Azure RTOS](https://go.microsoft.com/fwlink/p/?linkid=2129824).
280
-
* If you have issues getting your device to initialize or connect after following the steps in this guide, see [Troubleshooting](../../docs/troubleshooting.md).
281
-
* To learn more about how Azure RTOS components are used in the sample code forthis tutorial, see [Using Azure RTOSin the Getting Started Guides](../../docs/using-azure-rtos.md).
282
-
>Note: Azure RTOS provides OEMs with components to secure communication and to create code and data isolation using underlying MCU/MPU hardware protection mechanisms. However, each OEM is ultimately responsible for ensuring that their device meets evolving security requirements.
0 commit comments