How to integrate AWS IoT Greengrass on top of openSTLinux distribution

Revision as of 18:57, 2 December 2019 by Registered User

1. Article purpose[edit source]

The purpose of this article is to explain how to integrate Amazon Web Service (AWS) IoT Greengrass[1] on top of OpenSTLinux, included the security part with the connection to a Hardware Security Module (a TPMv2.0).

This article explains step by step how to add the yocto "meta-demo-aws" on top of openSTLinux distribution, to configure the image to add or not the extra elements for executing the AWS greengrass certification tests.

2. Prerequisites[edit source]

2.1. Hardware prerequisites[edit source]

  • STM32MP157C-DK2
STM32MP157C-DK2
  • STM32MP157V-EV1

2.2. Software prerequisites[edit source]

The STM32MP1 Distribution Package must be install on your host. To do this follow the procedure described in the Install the STM32MP1 OpenSTLinux distribution article.

2.3. Software update with meta-st-demo-aws[edit source]

1.Clone following git repository into [your STM32MP1 Distribution path]/layers/meta-st/

git clone ssh://${USER}@gerrit.st.com:29418/stm32mpuapp/meta/meta-st-stm32mpu-app-aws.git meta-st-demo-aws

2.Update of the meta-security layer to support the pkcs11 with tpm2

cd [your STM32MP1 Distribution path]/layers/meta-security
git chekout warrior
(commit : 4f7be0d252f68d8e8d442a7ed8c6e8a852872d28)

3.Enable TPM build This step is optional and require a TPM expansion board : STPM4RasPI expansion board[2]

Apply the following patch in the file [your STM32MP1 Distribution path]/layers/meta-st/meta-st-openstlinux/conf/distro/include/openstlinux.inc

DISTRO_FEATURES_append = " tpm2 "

4.Setup the build environment Executes the command, on the host :

source [your STM32MP1 Distribution path]/layers/meta-st/scripts/envsetup.sh

Select your DISTRO (ex: openstlinux-weston) and Select the demo-aws MACHINE (ex: stm32mp1-demo-aws)

5.Build the image The image is configured by default to include elements for the execution of the AWS greengrass test. If you don't want this you can delete it from the image. In the file recipes-st/images/st-image-demo-aws.bb delete ${IMAGE_AWSGREENGRASSTEST_PART} in CORE_IMAGE_EXTRA_INSTALL definition.

In the folder [your STM32MP1 Distribution path]//build-openstlinuxweston-stm32mp1-demo-aws Executes the command :

bitbake st-image-demo-aws

6.Flash the sdscard Use the programmer tool STM32CubeProgrammer The tsv file FlashLayout_sdcard_ stm32mp157c-demo-aws-mx-trusted.tsv is located in [your STM32MP1 Distribution path]/build-openstlinuxweston-stm32mp1-demo-aws/tmp-glibc/deploy/images/stm32mp1-demo-aws/flashlayout_st-image-demo-aws


3. References[edit source]

  1. Amazon Web Service (AWS) IoT Greengrass [1]
  2. STPM4RasPI expansion board