Skip to content

Commit 7cc5960

Browse files
authored
Merge pull request #180325 from timlt/nxp-iar
Update NXP 1060 for iar
2 parents d338787 + b619068 commit 7cc5960

File tree

7 files changed

+176
-10
lines changed

7 files changed

+176
-10
lines changed
111 KB
Loading
112 KB
Loading
30 KB
Loading
87.4 KB
Loading
160 KB
Loading

articles/iot-develop/quickstart-devkit-nxp-mimxrt1060-evk.md

Lines changed: 166 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,35 @@ ms.author: timlt
66
ms.service: iot-develop
77
ms.devlang: c
88
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.
1025
---
1126

1227
# Quickstart: Connect an NXP MIMXRT1060-EVK Evaluation kit to IoT Central
1328

1429
**Applies to**: [Embedded device development](about-iot-develop.md#embedded-device-development)<br>
1530
**Total completion time**: 30 minutes
1631

32+
:::zone pivot="iot-toolset-cmake"
1733
[![Browse code](media/common/browse-code.svg)](https://github.com/azure-rtos/getting-started/tree/master/NXP/MIMXRT1060-EVK)
34+
:::zone-end
35+
:::zone pivot="iot-toolset-iar-ewarm"
36+
[![Browse code](media/common/browse-code.svg)](https://github.com/azure-rtos/samples/)
37+
:::zone-end
1838

1939
In this quickstart, you use Azure RTOS to connect the NXP MIMXRT1060-EVK Evaluation kit (hereafter, the NXP EVK) to Azure IoT.
2040

@@ -24,6 +44,7 @@ You will complete the following tasks:
2444
* Build an image and flash it onto the NXP EVK
2545
* Use Azure IoT Central to create cloud components, view properties, view device telemetry, and call direct commands
2646

47+
:::zone pivot="iot-toolset-cmake"
2748
## Prerequisites
2849

2950
* A PC running Windows 10
@@ -173,14 +194,118 @@ You can use the **Termite** app to monitor communication and confirm that your d
173194
174195
Keep Termite open to monitor device output in the following steps.
175196
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.
215+
216+
[!INCLUDE [iot-develop-embedded-create-central-app-with-device](../../includes/iot-develop-embedded-create-central-app-with-device.md)]
217+
218+
## Prepare the device
219+
220+
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).
250+
251+
|Constant name|Value|
252+
|-------------|-----|
253+
| `ENDPOINT` | "global.azure-devices-provisioning.net" |
254+
| `ID_SCOPE` | {*Your ID scope value*} |
255+
| `REGISTRATION_ID` | {*Your Device ID value*} |
256+
| `DEVICE_SYMMETRIC_KEY` | {*Your Primary key value*} |
257+
258+
> [!NOTE]
259+
> 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
284+
Start Provisioning Client...
285+
[INFO] IoTProvisioning client connect pending
286+
Registered Device Successfully.
287+
IoTHub Host Name: iotc-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azure-devices.net; Device ID: mydevice.
288+
Connected to IoTHub.
289+
Sent properties request.
290+
Telemetry message send: {"temperature":22}.
291+
Received all properties
292+
[INFO] Azure IoT Security Module message is empty
293+
Telemetry message send: {"temperature":22}.
294+
Telemetry message send: {"temperature":22}.
295+
```
296+
297+
Keep the terminal open to monitor device output in the following steps.
298+
299+
:::zone-end
300+
176301
## Verify the device status
177302
178303
To view the device status in IoT Central portal:
179304
1. From the application dashboard, select **Devices** on the side navigation menu.
180305
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**.
182307
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":::
184309
185310
## View telemetry
186311
@@ -193,37 +318,69 @@ To view telemetry in IoT Central portal:
193318
1. View the telemetry as the device sends messages to the cloud in the **Overview** tab.
194319
1. The temperature is measured from the MCU wafer.
195320
321+
:::zone pivot="iot-toolset-cmake"
196322
:::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
200327
201328
## Call a direct method on the device
202329
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.
204331

205332
To call a method in IoT Central portal:
333+
:::zone pivot="iot-toolset-cmake"
206334

207335
1. Select the **Command** tab from the device page.
208336
1. In the **State** dropdown, select **True**, and then select **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.
209337
210338
:::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":::
211339
212340
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
213360

214361
## View device information
215362

216363
You can view the device information from IoT Central.
217364

218365
Select **About** tab from the device page.
219366

367+
:::zone pivot="iot-toolset-cmake"
220368
:::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
221373

222374
## Troubleshoot and debug
223375

224376
If you experience issues building the device code, flashing the device, or connecting, see [Troubleshooting](troubleshoot-embedded-device-quickstarts.md).
225377

378+
:::zone pivot="iot-toolset-cmake"
226379
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
227384

228385
## Clean up resources
229386

@@ -240,9 +397,9 @@ In this quickstart, you built a custom image that contains Azure RTOS sample cod
240397
As a next step, explore the following articles to learn more about using the IoT device SDKs to connect devices to Azure IoT.
241398

242399
> [!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)
244401
> [!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)
246403

247404
> [!IMPORTANT]
248405
> 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.

articles/zone-pivot-groups.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,4 +1463,13 @@ groups:
14631463
- id: client-clitier
14641464
title: CLI
14651465
- id: client-portaltier
1466-
title: Azure portal
1466+
title: Azure portal
1467+
# Owner: timlt
1468+
- id: iot-develop-nxp-toolset
1469+
title: IoT Devices
1470+
prompt: Choose a build environment
1471+
pivots:
1472+
- id: iot-toolset-cmake
1473+
title: CMake
1474+
- id: iot-toolset-iar-ewarm
1475+
title: IAR EWARM

0 commit comments

Comments
 (0)