Step 2: Provision your Sidewalk endpoint and flash the binary image
After you’ve added your Sidewalk credentials, you can provision your Sidewalk endpoints and connect your device. Provision your device as a Sidewalk endpoint by using the device profile and wireless device JSON files, wireless_device.json
and device_profile.json
. For information about how you create these files, see Add your device to AWS IoT Core for Amazon Sidewalk in the AWS IoT Core Developer Guide.
This tutorial focuses on how to connect your device and programmatically run the application on your hardware development kit. You’ll use Python and Python-pip3 to run the scripts that provision the Sidewalk endpoint and connect to the hardware board. After you’ve provisioned the endpoint, to see messages that are exchanged between your device and the cloud, you register the endpoint and create a destination for your Sidewalk device.
Generate binary image
The following steps show how to generate the binary image that will be flashed on the hardware.
Install the requirements file
Use Python-pip3 to install the requirements
file from the provision
folder in your Sidewalk SDK. You’ll require this file to be installed to be able to run the provision.py
script in the next step to generate the image. Go to the Sidewalk SDK folder $[Amazon Sidewalk repository]/tools/scripts/public/provision/
, and then run the following command to install the requirements
file.
pip3 install -r requirements.txt
Generate the manufacturing binary image
Run the provision.py
script to generate the manufacturing binary image file that will be used to provision the development board that you are using as a Sidewalk endpoint. How you generate the image can vary depending on the hardware development kit (HDK) that you’re using.
Nordic Semiconductor HDK
If you’re using a HDK from Nordic Semiconductor, run the provisioning script using the device JSON files obtained from the previous steps and the configuration file for your HDK. The output of running the script is the manufacturing binary image, which you can name as mfg.bin
.
The following shows examples of generate the manufacturing binary image, mfg.bin
.
-
If you’re using the combined device JSON file that you obtained from the AWS IoT console, use the
certificate_json
parameter to specify this file as input when running the provisioning script.python3 provision.py nordic aws --output_bin mfg.bin \ --certificate_json certificate.json \ --addr 0xFF000
-
If you’re using the separate device JSON files that you obtained as responses from the
GetDeviceProfile
andGetWirelessDevice
API operations, use thewireless_device_json
anddevice_profile_json
parameters to specify these files as input when running the provisioning script.python3 provision.py aws --output_bin mfg.bin \ --wireless_device_json wireless_device.json \ --device_profile_json device_profile.json \ --addr 0xFF000
Texas Instruments HDK
If you’re using a HDK from Texas Instruments, run the provisioning script using the device JSON files obtained from the previous steps and the configuration file for your HDK. The output of running the script is the manufacturing binary image, which you can name as mfg.bin
.
The following shows examples of generate the manufacturing binary image, mfg.bin
, for P7 board:
-
If you’re using the combined device JSON file that you obtained from the AWS IoT console, use the
certificate_json
parameter to specify this file as input when running the provisioning script.python3 provision.py ti aws --output_bin mfg.bin \ --certificate_json certificate.json \ --chip P7
-
If you’re using the separate device JSON files that you obtained as responses from the
GetDeviceProfile
andGetWirelessDevice
API operations, use thewireless_device_json
anddevice_profile_json
parameters to specify these files as input when running the provisioning script.python3 provision.py ti aws --output_bin mfg.bin \ --wireless_device_json wireless_device.json \ --device_profile_json device_profile.json \ --chip P7
Silicon Laboratories HDK
If you’re using an HDK from Silicon Laboratories, first export the path to the binary file for the Simplicity Commander tool, [Path to commander bin file]
. You must then specify the MCU series chip, [Silabs mcu series]
, that you’re using. Specify the value xg21
for bg21
and xg24
for the bg24
MCU series chip.
The output of running the provisioning script is the file, mfg.s37
. The following examples show how to generate this file.
-
If you’re using the combined device JSON file that you obtained from the AWS IoT console, specify the
certificate.json
file.export COMMANDER_BIN_PATH=[Path to commander bin file] ./script/provision_silabs_aws.sh [Silabs mcu series] certificate.json
-
If you’re using the separate device JSON files that you obtained using the
GetDeviceProfile
andGetWirelessDevice
API operations, specify thedevice_profile.json
andwireless_device.json
files.export COMMANDER_BIN_PATH=[Path to commander bin file] ./script/provision_silabs_aws.sh [Silabs mcu series] device_profile.json wireless_device.json
Flash binary image
To flash the manufacturing binary image onto your HDK, which is the Sidewalk endpoint, use the provision.py
script and the device certificates in the working directory that contains the keys. For information about how to flash the image on your hardware development kit, see the vendor documentation as described below.
To make flashing easier using JLINK, you might want use the .hex
file that provision.py
generates as well instead of using binary.
Nordic Semiconductor
Login to the Nordic Semiconductor website, or create your account, and request permission to download the Amazon Sidewalk documentation and hardware and software development resources. The download instructions will be sent to your email address when approved.
To flash the binary image, use the address 0xFF000
for loading the binary image on the Nordic Semiconductor HDK. For information about flashing the binary image, see the Nordic Semiconductor documentation.
Silicon Laboratories
Login to the Silicon Laboratories website, or create your account, and open a support case that requests for GitHub access permission to download the Amazon Sidewalk documentation and hardware and software development resources. When requesting access, specify your GitHub account that links to your corporate email address. Information about the address for loading the binary file for Silicon Laboratories is already in provision/scripts/*.sh
.
For information about flashing the binary file, see the Silicon Laboratories documentation.
Texas Instruments
Login to the Texas Instruments website, or register, and request for access permission to download the Amazon Sidewalk documentation and hardware and software development resources. The download instructions will be sent to your email address when approved.
To flash the binary image, use the following address information for loading the binary image on the Nordic Semiconductor HDK.
- Texas Instruments P1 board:
0x56000
- Texas Instruments P7 board:
0xAE000
For information about flashing the binary image, see the Texas Instruments documentation.
After you’ve flashed the image onto the hardware, you register your device as a Sidewalk endpoint and add a Sidewalk destination. You then test the connectivity, exchange messages, and prototype your application on the hardware board.
Next Step: Step 3 - Register and test Sidewalk endpoint