SAMA5D2 Xplained Greengrass build failure

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

Posts: 2
Joined: Mon Sep 14, 2020 5:29 pm

SAMA5D2 Xplained Greengrass build failure

Fri Sep 18, 2020 2:24 pm

Hi Forum,

I am attempting to generate an SD card image for the SAMA5d2 Xplained development board.
I have followed the steps detailed in this Microchip application note: Getting-Started-with-AWS-Greengrass-on-SAMA5D2-Application-Note-DS00003170A.pdf

The steps for obtaining and building a kernel and rfs are:

Code: Select all

Clone the following buildroot-external repository:
$ git clone git:// greengrass
Clone and checkout linux4sam_6.0 buildroot repository:
$ git clone git:// -b linux4sam_6.0
Change to the buildroot directory:
$ cd buildroot-at91/
At this time, there is a manual step required to enable SSL for the host-python package. In the Buildroot
“package/python” directory, modify the file There is a variable named
HOST_PYTHON_CONF_OPTS that contains the line –disable-ssl \. This line must be deleted in order to build
the python-cryptoauthlib package. The line below uses the “gedit” program to edit the file, but any editor will
work. After deleting the line containing “--disable-ssl”, be sure to save the file:
$ gedit package/python/
Set up the configuration for buildroot:
$ make BR2_EXTERNAL=../greengrass sama5d2_xplained_greenkey_defconfig
Make the buildroot project:
$ make
I followed these steps, but Some time later, I see:

Code: Select all

WARNING: no hash file for cryptoauthlib-pkcs11.tar.gz
>>> cryptoauthlib pkcs11 Extracting
gzip -d -c /home/neil/dl/cryptoauthlib-pkcs11.tar.gz | tar --strip-components=1 -C /home/neil/gc/IoT_Greengrass/gg_buildroot/buildroot-at91/output/build/cryptoauthlib-pkcs11   -xf -
>>> cryptoauthlib pkcs11 Patching

Applying 0001-Changed-I2C-bus-to-bus-0.patch using patch: 
patching file lib/atca_cfgs.c
Hunk #1 FAILED at 42.
1 out of 1 hunk FAILED -- saving rejects to file lib/atca_cfgs.c.rej
package/ recipe for target '/home/neil/gc/IoT_Greengrass/gg_buildroot/buildroot-at91/output/build/cryptoauthlib-pkcs11/.stamp_patched' failed
make[1]: *** [/home/neil/gc/IoT_Greengrass/gg_buildroot/buildroot-at91/output/build/cryptoauthlib-pkcs11/.stamp_patched] Error 1
Makefile:79: recipe for target '_all' failed
make: *** [_all] Error 2
When I clone the local repository, do I need to use a specific label?

Thanks for any help anyone can offer.
Location: USA
Posts: 2152
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D2 Xplained Greengrass build failure

Sun Sep 20, 2020 2:50 am

greencustard wrote: When I clone the local repository, do I need to use a specific label?
Since that project currently has no releases published or tags declared, there is nothing you could specify.
Regardless that is not the direct cause of the build failure, nor related to a solution.

In regards to the build failure, it is the cryptoauthlib package that has a version issue.
The buildroot-external-microchip-cloud project has a patch file for an unspecified version of the cryptoauthlib package.
The only "version" specification is the 'pkcs11' branch of the cryptoauthlib package.
Your build is fetching a more recent version of the cryptoauthlib package than expected, and then the attempt to apply the patch fails.

You could try to guess which earlier release matches the version that was originally used for that Greengrass document, and then specify & download it from ... ree/pkcs11.

Or you could try manually applying the patch (which seems to be trivial, consisting of changing just one character of one line in one file) to the version that you have already downloaded/extracted. Then indicate that the patching step was completed, and resume with the build:

Code: Select all

$ vi output/build/cryptoauthlib-pkcs11/lib/atca_cfgs.c     # manually apply the patch to line 45
$ touch output/build/cryptoauthlib-pkcs11/.stamp_patched
$ make

Posts: 2
Joined: Mon Sep 14, 2020 5:29 pm

Re: SAMA5D2 Xplained Greengrass build failure

Mon Sep 21, 2020 2:53 pm

Thank you for your help on this. I shall try your suggestions and report my findings.

Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 1 guest