cancel
Showing results for 
Search instead for 
Did you mean: 

Azure IoT Central B-U585I-IOT02A Secure Quick Connect

Alnur ELBERIER
Associate II
A simple guide to quickly and freely connect your B-U585I-IOT02A to Azure IoT Central

1. Introduction
The following tutorial outlines how to connect the B-U585I-IOT02A Discovery Kit to Azure IoT Central with the X-CUBE-AZURE package using the following technologies:  

2. Getting started   

2.1 Hardware setup   

You need to plug your STM32U5 development board into a USB port on your PC using the USB 2.0 male to Micro USB male cable (as picture below). Windows should recognize the STM32U5 as a generic USB device. A 2.4 GHz Wi-Fi router connected to the internet with DHCP enabled and the router’s SSID and password is also required for the STM32U5 discovery kit to connect to the cloud.
1399.jpg

2.2 Install STM32Programmer

2.3 Install Python and Pyserial

  • Python  >= version 3.9
    • Ensure that both Python and pip are added to path in installation
  • Pyserial >= version 3.4
    • python -m pip install pyserial

2.4 Install Azure CLI

2.5 Download and unzip the project

Download the project zip here and unzip it into a folder of your choice, we recommend: C:\. 
NOTE: If you unzip the IAR project where it has a long file path it may not build correctly.  

 
 

3. Connecting the STM32U5 to Azure IoT Central


A Python script has been provided to streamline the setup process. This reference design works with both a paid Azure subscription and a free trial application. This article outlines the free configuration but additional documentation for a paid subscription can be found in the X-CUBE-AZURE package.

3.1 Running the Quick Connect script – Free Azure account

The block diagram below illustrates the progression of the script for a free Azure subscription:
1400.png
 
  1. Before you run the script, please check that you satisfy the following checklist:
    1. Your board is connected to your PC
    2. No app or a script with an open com port with the board
    3. Only one STM32 board connected to your PC
    4. 2.4 GHz Wi-Fi
    5. The correct AZ CLI version (az --version)
    6. No free central applications already exist in your account. Free applications are limited to one per account. Please refer to troubleshoot section on how to delete an app
 
  1. Navigate to C:\U5-TFM\STM32Cube_FW_U5_V1.1.1\Projects\B-U585I-IOT02A\Applications\TFM\AzureScripts

1402.png
 
  1. Open a PowerShell window in this directory

1403.png
 
  1. Enter the command python .\STM32U5_QuickConnect.py

1405.png
 
  1. Enter ‘n’ into the console to confirm that you will be using a Free Trial Azure IoT Central Application.

Note: This trial application will only allow for 5 devices and will expire after 7 days.
1407.png
 
  1. If not already logged in, in your browser, the script prompts you to log in to a Microsoft account in your browser.
  1. You are redirected to the following Azure IoT Central Application creation webpage. Copy the unique URL name from the browser.

1409.png
  1. Select the ‘Free’ button and then select ‘Create’ in your browser.

1410.png
 
  1. Paste the application URL name into the PowerShell window and press Enter.

1411.png
 
  1. Proceed to enter the SSID and Password for a 2.4GHz Wi-Fi network.
 
  1. The script will again prompt you login with a Microsoft account in a popup browser window.
 
  1. The central application management page pops up in your browser and the script will prompt you to copy the ID from your browser paste it into the console.

1412.png
  1. The script will now execute autonomously to configure your environment.
 
  1. The script sets the correct option bytes, flash the firmware image to the board, and use the provided information to connect the STM32U5 to your 2.4GHz Wi-Fi network.
 
  1. The script collects the X.509 Certificate from STSAFE-A110. The certificate Common Name is used as the device RegistrationID and will have the following format: "eval3-0102D095415CD42AA20139"
 
  1. The script will then configure all the required Azure IoT Central resources for the application that is opened in your browser.

1413.png
 
  1. The script will then provision a new device in your central application and then configure the STM32U5 to connect and communicate telemetry data to that device. If you navigate to the Devices tab in the central application, you will see that the STM32U5 is connected after a short delay.
 
 

4. Additional questions?

Refer to the documentation in the X-CUBE-AZURE Package for additional support
Version history
Last update:
‎2022-07-21 04:03 AM
Updated by: