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
Copy file name to clipboardExpand all lines: articles/iot-develop/quickstart-devkit-nxp-mimxrt1060-evk.md
+166-9Lines changed: 166 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,35 @@ ms.author: timlt
6
6
ms.service: iot-develop
7
7
ms.devlang: c
8
8
ms.topic: quickstart
9
-
ms.date: 06/04/2021
9
+
ms.date: 11/16/2021
10
+
zone_pivot_groups: iot-develop-nxp-toolset
11
+
12
+
# Owner: timlt
13
+
# - id: iot-develop-nxp-toolset
14
+
# title: IoT Devices
15
+
# prompt: Choose a build environment
16
+
# pivots:
17
+
# - id: iot-toolset-cmake
18
+
# title: CMake
19
+
# - id: iot-toolset-iar-ewarm
20
+
# title: IAR EWARM
21
+
# - id: iot-toolset-mcuxpresso
22
+
# title: MCUXpresso
23
+
24
+
#Customer intent: As a device builder, I want to see a working IoT device sample connecting to IoT Hub and sending properties and telemetry, and responding to commands. As a solution builder, I want to use a tool to view the properties, commands, and telemetry an IoT Plug and Play device reports to the IoT hub it connects to.
10
25
---
11
26
12
27
# Quickstart: Connect an NXP MIMXRT1060-EVK Evaluation kit to IoT Central
In this quickstart, you use Azure RTOS to connect the NXP MIMXRT1060-EVK Evaluation kit (hereafter, the NXP EVK) to Azure IoT.
20
40
@@ -24,6 +44,7 @@ You will complete the following tasks:
24
44
* Build an image and flash it onto the NXP EVK
25
45
* Use Azure IoT Central to create cloud components, view properties, view device telemetry, and call direct commands
26
46
47
+
:::zone pivot="iot-toolset-cmake"
27
48
## Prerequisites
28
49
29
50
* A PC running Windows 10
@@ -173,14 +194,118 @@ You can use the **Termite** app to monitor communication and confirm that your d
173
194
174
195
Keep Termite open to monitor device output in the following steps.
175
196
197
+
:::zone-end
198
+
:::zone pivot="iot-toolset-iar-ewarm"
199
+
200
+
201
+
## Prerequisites
202
+
203
+
* A PC running Windows 10 or Windows 11
204
+
205
+
* Hardware
206
+
207
+
* The [NXP MIMXRT1060-EVK](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/mimxrt1060-evk-i-mx-rt1060-evaluation-kit:MIMXRT1060-EVK) (NXP EVK)
208
+
* USB 2.0 A male to Micro USB male cable
209
+
* Wired Ethernet access
210
+
* Ethernet cable
211
+
212
+
* IAR Embedded Workbench for ARM (IAR EW). You can download and install a [14-day free trial of IAR EW for ARM](https://www.iar.com/products/architectures/arm/iar-embedded-workbench-for-arm/).
213
+
214
+
* Download the [Azure_RTOS_6.1_MIMXRT1060_IAR_Samples_2021_11_03.zip](https://github.com/azure-rtos/samples/releases/download/v6.1_rel/Azure_RTOS_6.1_MIMXRT1060_IAR_Samples_2021_11_03.zip) file and extract it to a working directory. Choose a directory with a short path to avoid compiler errors when you build.
In this section you use IAR EW IDE to modify a configuration file for Azure IoT settings, build the sample client application, then download and run it on the device.
221
+
222
+
### Connect the device
223
+
224
+
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. All three are highlighted in the following picture:
225
+
226
+
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/nxp-evk-board.png" alt-text="Locate key components on the NXP EVK board":::
227
+
228
+
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.
229
+
1. Use the Ethernet cable to connect the NXP EVK to an Ethernet port.
230
+
231
+
### Configure, build, flash, and run the image
232
+
233
+
1. Open the **IAR EW** app on your computer.
234
+
235
+
1. Select **File > Open workspace**, navigate to the *mimxrt1060\iar* folder in the working folder where you extracted the zip file, and open the ***azure_rtos.eww*** workspace file.
236
+
237
+
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/open-project-iar.png" alt-text="Open the IAR workspace":::
238
+
239
+
1. Right-click the **sample_azure_iot_embedded_sdk_pnp** project in the left **Workspace** pane and select **Set as active**.
240
+
241
+
1. Expand the project, then expand the **Sample** subfolder and open the *sample_config.h* file.
242
+
243
+
1. Near the top of the file uncomment the `#define ENABLE_DPS_SAMPLE` directive.
244
+
245
+
```c
246
+
#define ENABLE_DPS_SAMPLE
247
+
```
248
+
249
+
1. Set the Azure IoT device information constants to the values that you saved after you created Azure resources. The `ENDPOINT` constant is set to the global endpoint for Azure Device Provisioning Service (DPS).
> The`ENDPOINT`, `ID_SCOPE`, and `REGISTRATION_ID` values are set in a `#ifndef ENABLE_DPS_SAMPLE` statement. Make sure you set the values in the `#else` statement, which will be used when the `ENABLE_DPS_SAMPLE` value is defined.
260
+
261
+
1. Save the file.
262
+
263
+
1. Select **Project > Batch Build**. Then select **build_all** and **Make** to build all projects. You will see build output in the **Build** pane. Confirm the successful compilation and linking of all sample projects.
264
+
265
+
1. Select the green **Download and Debug** button in the toolbar to download the program.
266
+
267
+
1. After the image has finished downloading, Select **Go** to run the sample.
268
+
269
+
1. Select **View > Terminal I/O** to open a terminal window that prints status and output messages.
270
+
271
+
### Confirm device connection details
272
+
273
+
In the terminal window, you should see output like the following, to verify that the device is initialized and connected to Azure IoT.
274
+
275
+
```output
276
+
DHCP In Progress...
277
+
IP address: 192.168.1.24
278
+
Mask: 255.255.255.0
279
+
Gateway: 192.168.1.1
280
+
DNS Server address: 192.168.1.1
281
+
SNTP Time Sync...0.pool.ntp.org
282
+
SNTP Time Sync successfully.
283
+
[INFO] Azure IoT Security Module has been enabled, status=0
Keep the terminal open to monitor device output in the following steps.
298
+
299
+
:::zone-end
300
+
176
301
## Verify the device status
177
302
178
303
To view the device status in IoT Central portal:
179
304
1. From the application dashboard, select **Devices** on the side navigation menu.
180
305
1. Confirm that the **Device status** is updated to **Provisioned**.
181
-
1. Confirm that the **Device template** is updated to **Getting Started Guide**.
306
+
1. Confirm that the **Device template** is updated to **Thermostat**.
182
307
183
-
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/iot-central-device-view-status.png" alt-text="Screenshot of device status in IoT Central":::
308
+
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/iot-central-device-view-iar-status.png" alt-text="Screenshot of device status in IoT Central":::
184
309
185
310
## View telemetry
186
311
@@ -193,37 +318,69 @@ To view telemetry in IoT Central portal:
193
318
1. View the telemetry as the device sends messages to the cloud in the **Overview** tab.
194
319
1. The temperature is measured from the MCU wafer.
195
320
321
+
:::zone pivot="iot-toolset-cmake"
196
322
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/iot-central-device-telemetry.png" alt-text="Screenshot of device telemetry in IoT Central":::
197
-
198
-
> [!NOTE]
199
-
> You can also monitor telemetry from the device by using the Termite app.
323
+
:::zone-end
324
+
:::zone pivot="iot-toolset-iar-ewarm"
325
+
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/iot-central-device-telemetry-iar.png" alt-text="Screenshot of device telemetry in IoT Central":::
326
+
:::zone-end
200
327
201
328
## Call a direct method on the device
202
329
203
-
You can also use IoT Central to call a direct method that you've 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.
330
+
You can also use IoT Central to call a direct method that you've implemented on your device. Direct methods have a name, and can optionally have a JSON payload, configurable connection, and method timeout.
204
331
205
332
To call a method in IoT Central portal:
333
+
:::zone pivot="iot-toolset-cmake"
206
334
207
335
1. Select the **Command** tab from the device page.
208
336
1. In the **State** dropdown, select**True**, and thenselect**Run**. There will be no change on the device as there isn't an available LED to toggle; however, you can view the output in Termite to monitor the status of the methods.
209
337
210
338
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/iot-central-invoke-method.png" alt-text="Screenshot of calling a direct method on a device in IoT Central":::
211
339
212
340
1. In the **State** dropdown, select **False**, and then select **Run**.
341
+
:::zone-end
342
+
:::zone pivot="iot-toolset-iar-ewarm"
343
+
344
+
1. Select the **Command** tab from the device page.
345
+
346
+
1. In the **Since** field, use the date picker and time selectors to set a time, then select **Run**.
347
+
348
+
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/iot-central-invoke-method-iar.png" alt-text="Screenshot of calling a direct method on a device in IoT Central":::
349
+
350
+
1. You can see the command invocation in the terminal. In this case, because the sample thermostat application prints a simulated temperature value, there won't be minimum or maximum values during the time range.
351
+
352
+
```output
353
+
Received command: getMaxMinReport
354
+
```
355
+
356
+
> [!NOTE]
357
+
> You can also view the command invocation and response on the **Raw data** tab on the device page in IoT Central.
358
+
359
+
:::zone-end
213
360
214
361
## View device information
215
362
216
363
You can view the device information from IoT Central.
217
364
218
365
Select **About** tab from the device page.
219
366
367
+
:::zone pivot="iot-toolset-cmake"
220
368
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/iot-central-device-about.png" alt-text="Screenshot of device information in IoT Central":::
369
+
:::zone-end
370
+
:::zone pivot="iot-toolset-iar-ewarm"
371
+
:::image type="content" source="media/quickstart-devkit-nxp-mimxrt1060-evk/iot-central-device-about-iar.png" alt-text="Screenshot of device information in IoT Central":::
372
+
:::zone-end
221
373
222
374
## Troubleshoot and debug
223
375
224
376
If you experience issues building the device code, flashing the device, or connecting, see [Troubleshooting](troubleshoot-embedded-device-quickstarts.md).
225
377
378
+
:::zone pivot="iot-toolset-cmake"
226
379
For debugging the application, see [Debugging with Visual Studio Code](https://github.com/azure-rtos/getting-started/blob/master/docs/debugging.md).
380
+
:::zone-end
381
+
:::zone pivot="iot-toolset-iar-ewarm"
382
+
For help debugging the application, see the selections under **Help**in**IAR EW for ARM**.
383
+
:::zone-end
227
384
228
385
## Clean up resources
229
386
@@ -240,9 +397,9 @@ In this quickstart, you built a custom image that contains Azure RTOS sample cod
240
397
As a next step, explore the following articles to learn more about using the IoT device SDKs to connect devices to Azure IoT.
241
398
242
399
> [!div class="nextstepaction"]
243
-
> [Connect a simulated device to IoT Central](quickstart-send-telemetry-central.md)
400
+
> [Connect a device to IoT Central](quickstart-send-telemetry-central.md)
244
401
> [!div class="nextstepaction"]
245
-
> [Connect a simulated device to IoT Hub](quickstart-send-telemetry-iot-hub.md)
402
+
> [Connect a device to IoT Hub](quickstart-send-telemetry-iot-hub.md)
246
403
247
404
> [!IMPORTANT]
248
405
> 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