Code Monkey home page Code Monkey logo

mbed-os-example-atecc608a's Introduction

Mbed OS Examples for the ATECC608A secure element

The examples in this repository demonstrate how to use the ATECC608A secure element with Mbed OS. The atecc608a example demonstrates use of the ATECC608A with Mbed Crypto. Examples of how to generate a certificate using pre-provisioned ATECC608A keys and how to use ATECC608A with Mbed TLS are yet to come.

Note: To see a rendered example you can import into the Arm Online Compiler, please see our quick start.

Prerequisites

A target with I2C and power supply connections, connected to an ATECC608A secure element as shown in Hardware interface.

Note: This example enables Mbed OS PSA. It is not suitable for or compatible with TF-M which has its own PSA implementation (e.g. Arm TrustZone on Arm v8-M).

Mbed OS build tools

Mbed CLI 2

Starting with version 6.5, Mbed OS uses Mbed CLI 2. It uses Ninja as a build system, and CMake to generate the build environment and manage the build process in a compiler-independent manner. If you are working with Mbed OS version prior to 6.5 then check the section Mbed CLI 1.

  1. Install Mbed CLI 2.
  2. From the command-line, import the example: mbed-tools import mbed-os-example-atecc608a
  3. Change the current directory to mbed-os-example-atecc608a/atecc608a.

Mbed CLI 1

  1. Install Mbed CLI 1.
  2. From the command-line, import the example: mbed import mbed-os-example-atecc608a
  3. Change the current directory to mbed-os-example-atecc608a/atecc608a.

Building and running

  1. Connect a USB cable between the USB port on the board and the host computer.

  2. Run the following command to build the example project, program the microcontroller flash memory and open a serial monitor:

    • Mbed CLI 2
    $ mbed-tools compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm
    • Mbed CLI 1
    $ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm

Your PC may take a few minutes to compile your code.

Expected output

Serial Number:
01 23 BA CF BA D3 29 CA EE

Config zone: 01 23 BA CF 00 00 50 00 BA D3 29 CA EE C0 3D 00
C0 00 55 00 83 20 83 20 83 20 83 20 83 20 83 20
83 20 83 20 00 00 00 00 00 00 00 00 00 00 00 00
00 00 AF 8F FF FF FF FF 00 00 00 00 FF FF FF FF
00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF 00 00 00 00 FF FF 00 00 00 00 00 00
13 00 13 00 13 00 13 00 13 00 13 00 13 00 13 00
1C 00 10 00 10 00 10 00 10 00 10 00 10 00 1C 00

--- Device locks information ---
  - Config locked: 1
  - Data locked: 1
  - Slot 0 locked: 0
  - Slot 1 locked: 0
  - Slot 2 locked: 0
  - Slot 3 locked: 0
  - Slot 4 locked: 0
  - Slot 5 locked: 0
  - Slot 6 locked: 0
  - Slot 7 locked: 0
  - Slot 8 locked: 0
  - Slot 9 locked: 0
  - Slot 10 locked: 0
  - Slot 11 locked: 0
  - Slot 12 locked: 0
  - Slot 13 locked: 0
  - Slot 14 locked: 0
  - Slot 15 locked: 0
--------------------------------

Private key slot in use: 1, public: 9
Running tests...
test_hash_sha256 succesful!
test_sign_verify succesful!
test_export_import succesful!
test_psa_import_verify succesful!
test_write_read_slot succesful!


Available commands:
 - info - print configuration information;
 - test - run all tests on the device;
 - exit - exit the interactive loop;
 - generate_private[=%d] - generate a private key in a given slot (0-15),
                           default slot - 0.
 - generate_public=%d_%d - generate a public key in a given slot
                           (0-15, second argument) using a private key
                           from a given slot (0-15, first argument);
 - private_slot=%d - designate a slot to be used as a private key in tests;
 - public_slot=%d - designate a slot to be used as a public key in tests;
 - write_lock_config - write a hardcoded configuration to the device,
                       lock it;
 - lock_data - lock the data zone;

Hardware interface

A couple of evaluation and development kits are available for the ATECC608A secure element. To interface with an Mbed platform, you have to make I2C and power supply connections. Note that ATECC508A requires a 5V supply.

This is an example of how to connect an ATCRYPTOAUTH-XPRO-B (header) and a K64F:

ATCRYPTOAUTH-XPRO-B-K64F

For secure connections, you can prepare a shield with ATCRYPTOAUTH-XPRO-B. Most Mbed platforms support Arduino headers, and you can use an Arduino shield to prepare a shield to connect ATCRYPTOAUTH-XPRO-B to an Mbed platform.

This image shows an ATCRYPTOAUTH-XPRO-B on an Arduino shield:

ATCRYPTOAUTH-XPRO-B-Shield

Note: ATCRYPTOAUTH-XPRO-B comes with ATECC508A and ATECC608A integrated circuits (ICs). Use the J5 jumper to enable ATECC508A.

License and contributions

The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see contributing.md for more info.

This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide

mbed-os-example-atecc608a's People

Contributors

0xc0170 avatar adbridge avatar andrzejkurek avatar dgreen-arm avatar evedon avatar gpsimenos avatar guywi avatar harmut01 avatar harrisonmutai-arm avatar k-stachowiak avatar ldong-arm avatar mbedmain avatar patater avatar rajkan01 avatar rwalton-arm avatar saheerb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mbed-os-example-atecc608a's Issues

register_se_driver issue and tests failure

Description of defect

I'm trying to run this example on PORTENTA_H7 board. The board has an integrated ATECC608A (no external connection) and communication works fine. However all psa test are failing. This is the output from this example:

Serial Number:
01 23 DA 33 10 2C 40 D3 EE 

Config zone: 01 23 DA 33 00 00 60 02 10 2C 40 D3 EE 01 59 00 
C0 00 55 00 83 20 87 20 87 20 87 2F 87 2F 8F 8F 
9F 8F AF 8F 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 AF 8F FF FF FF FF 00 00 00 00 FF FF FF FF 
00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF 
FF FF FF FF 00 00 00 00 FF FF 00 00 00 00 00 00 
33 00 33 00 33 00 33 00 33 00 1C 00 1C 00 1C 00 
3C 00 3C 00 3C 00 3C 00 3C 00 3C 00 3C 00 1C 00 

--- Device locks information ---
  - Config locked: 1
  - Data locked: 1
  - Slot 0 locked: 0
  - Slot 1 locked: 0
  - Slot 2 locked: 0
  - Slot 3 locked: 0
  - Slot 4 locked: 0
  - Slot 5 locked: 0
  - Slot 6 locked: 0
  - Slot 7 locked: 0
  - Slot 8 locked: 0
  - Slot 9 locked: 0
  - Slot 10 locked: 0
  - Slot 11 locked: 0
  - Slot 12 locked: 0
  - Slot 13 locked: 0
  - Slot 14 locked: 0
  - Slot 15 locked: 0
--------------------------------

Private key slot in use: 1, public: 9
Running tests...
test_hash_sha256 succesful!
assertion failed at ./main.c:303 (actual=121 expected=0)
assertion failed at ./main.c:397 (actual=121 expected=0)


Available commands:
 - info - print configuration information;
 - test - run all tests on the device;
 - exit - exit the interactive loop;
 - generate_private[=%d] - generate a private key in a given slot (0-15),
                           default slot - 0.
 - generate_public=%d_%d - generate a public key in a given slot
                           (0-15, second argument) using a private key
                           from a given slot (0-15, first argument);
 - private_slot=%d - designate a slot to be used as a private key in tests;
 - public_slot=%d - designate a slot to be used as a public key in tests;
 - write_lock_config - write a hardcoded configuration to the device,
                       lock it;
 - lock_data - lock the data zone;

test_hash_sha256 is working correctly because is calling directly atecc608a_hash_sha256 function not going through psa API. I thought the problem could be a wrong registration parameter here:

ASSERT_SUCCESS_PSA(psa_register_se_driver(PSA_ATECC608A_LIFETIME, &atecc608a_drv_info));
because function is expecting a location value and not PSA_ATECC608A_LIFETIME, in fact with this configuration psa_get_se_driver_entry will fail because the location value is 0.

https://github.com/ARMmbed/mbed-os/blob/d1f02f3078b405624f7be0cd824cdf85d472fa34/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/mbedtls/psa_crypto_se.c#L75-L85

I'm trying to find the correct way to fix it but i need some help.

Target(s) affected by this defect ?

I've tested ti on PORTENTA_H7, but i think this issue is affecting other targets

Toolchain(s) (name and version) displaying this defect ?

gcc-arm-none-eabi-9-2019-q4-major

What version of Mbed-os are you using (tag or sha) ?

https://github.com/ARMmbed/mbed-os/#3377f083b3a6bd7a1b45ed2cea5cf083b9007527

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed --version 
1.10.4

How is this defect reproduced ?

Flash and run the example

Doesn't build with ARMC6.13

Testing Mbed OS 5.15 branch: mbed-os-5.15 and seeing link errors:

>mbed compile -t ARM -m K64F -v
[mbed] Working path "C:\OOB\mbed-os-example-atecc608a" (program)
[mbed] Exec "c:\python27\python.exe -u C:\OOB\mbed-os-example-atecc608a\mbed-os\tools\make.py -t ARM -m K64F --source . --build .\BUILD\K64F\ARM -v" in "C:\OOB\mbed-os-example-atecc608a"
Building project mbed-os-example-atecc608a (K64F, ARMC6)
Scan: mbed-os-example-atecc608a
Macros: -DTARGET_PSA -DCOMPONENT_SD=1 -DDEVICE_EMAC=1 -D__MBED__=1 -DDEVICE_USBDEVICE=1 -D__FPU_PRESENT=1 -DTARGET_Freescale -DDEVICE_PORTINOUT=1 -DTARGET_RTOS_M4_M7 -DTARGET_NAME=K64F -DDEVICE_RTC=1 -DCOMPONENT_PSA_SRV_EMUL=1 -DDEVICE_SERIAL_ASYNCH=1 -D__CMSIS_RTOS -DTOOLCHAIN_ARMC6 -DFSL_RTOS_MBED -DTARGET_KPSDK_MCUS -DDEVICE_WATCHDOG=1 -DDEVICE_USTICKER=1 -DDEVICE_CRC=1 -DDEVICE_RESET_REASON=1 -DTARGET_CORTEX_M -DTARGET_KSDK2_MCUS -DTARGET_LIKE_CORTEX_M4 -DDEVICE_ANALOGOUT=1 -DTARGET_M4 -DTARGET_K64F -DCOMPONENT_PSA_SRV_IMPL=1 -DDEVICE_SPI_ASYNCH=1 -DMBED_BUILD_TIMESTAMP=1575977212.96 -DDEVICE_PWMOUT=1 -DCOMPONENT_FLASHIAP=1 -DMBED_TICKLESS -DDEVICE_INTERRUPTIN=1 -DTARGET_Freescale_EMAC -DTARGET_CORTEX -DDEVICE_I2C=1 -DDEVICE_PORTOUT=1 -DDEVICE_I2CSLAVE=1 -D__CORTEX_M4 -DDEVICE_STDIO_MESSAGES=1 -DCPU_MK64FN1M0VMD12 -DTARGET_LIKE_MBED -DTARGET_FF_ARDUINO -DTARGET_KPSDK_CODE -DTARGET_RELEASE -DDEVICE_LPTICKER=1 -DCOMPONENT_NSPE=1 -DDEVICE_SERIAL_FC=1 -DMBED_SPLIT_HEAP -DDEVICE_TRNG=1 -D__MBED_CMSIS_RTOS_CM -DDEVICE_SLEEP=1 -DTARGET_FRDM -DTARGET_MCUXpresso_MCUS -DDEVICE_SPI=1 -DTOOLCHAIN_ARM_STD -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_FLASH=1 -DDEVICE_PORTIN=1 -DTOOLCHAIN_ARM -DTARGET_MCU_K64F -DARM_MATH_CM4
Link: mbed-os-example-atecc608a
Link: C:\Program Files\ARMCompiler6.13\bin\armlink --via .\BUILD\K64F\ARM\.link_options.txt
[DEBUG] Return: 1
[Warning] @0,0: L3912W: Option 'legacyalign' is deprecated.
[Error] @0,0: L6218E: Undefined symbol atcab_printbin_label (referred from BUILD/K64F/ARM/atecc608a/main.o).
[Error] @0,0: L6218E: Undefined symbol atcab_printbin_sp (referred from BUILD/K64F/ARM/atecc608a/main.o).
[Error] @0,0: L6218E: Undefined symbol mbedtls_psa_register_se_key (referred from BUILD/K64F/ARM/atecc608a/main.o).
[Error] @0,0: L6218E: Undefined symbol psa_register_se_driver (referred from BUILD/K64F/ARM/atecc608a/main.o).
[Error] @0,0: L6218E: Undefined symbol psa_set_key_slot_number (referred from BUILD/K64F/ARM/atecc608a/main.o).
[DEBUG] Errors: Warning: L3912W: Option 'legacyalign' is deprecated.
[DEBUG] Errors: Error: L6218E: Undefined symbol atcab_printbin_label (referred from BUILD/K64F/ARM/atecc608a/main.o).
[DEBUG] Errors: Error: L6218E: Undefined symbol atcab_printbin_sp (referred from BUILD/K64F/ARM/atecc608a/main.o).
[DEBUG] Errors: Error: L6218E: Undefined symbol mbedtls_psa_register_se_key (referred from BUILD/K64F/ARM/atecc608a/main.o).
[DEBUG] Errors: Error: L6218E: Undefined symbol psa_register_se_driver (referred from BUILD/K64F/ARM/atecc608a/main.o).
[DEBUG] Errors: Error: L6218E: Undefined symbol psa_set_key_slot_number (referred from BUILD/K64F/ARM/atecc608a/main.o).
[DEBUG] Errors: Finished: 0 information, 1 warning and 5 error messages.
Traceback (most recent call last):
  File "C:\OOB\mbed-os-example-atecc608a\mbed-os\tools\make.py", line 78, in wrapped_build_project
    *args, **kwargs
  File "C:\OOB\mbed-os-example-atecc608a\mbed-os\tools\build_api.py", line 598, in build_project
    res = toolchain.link_program(resources, build_path, name)
  File "C:\OOB\mbed-os-example-atecc608a\mbed-os\tools\toolchains\mbed_toolchain.py", line 773, in link_program
    self.link(elf, objects, libraries, lib_dirs, linker_script)
  File "C:\OOB\mbed-os-example-atecc608a\mbed-os\tools\toolchains\arm.py", line 387, in link
    self.default_cmd(cmd)
  File "C:\OOB\mbed-os-example-atecc608a\mbed-os\tools\toolchains\mbed_toolchain.py", line 825, in default_cmd
    raise ToolException(stderr)
ToolException: Warning: L3912W: Option 'legacyalign' is deprecated.
Error: L6218E: Undefined symbol atcab_printbin_label (referred from BUILD/K64F/ARM/atecc608a/main.o).
Error: L6218E: Undefined symbol atcab_printbin_sp (referred from BUILD/K64F/ARM/atecc608a/main.o).
Error: L6218E: Undefined symbol mbedtls_psa_register_se_key (referred from BUILD/K64F/ARM/atecc608a/main.o).
Error: L6218E: Undefined symbol psa_register_se_driver (referred from BUILD/K64F/ARM/atecc608a/main.o).
Error: L6218E: Undefined symbol psa_set_key_slot_number (referred from BUILD/K64F/ARM/atecc608a/main.o).
Finished: 0 information, 1 warning and 5 error messages.

[mbed] ERROR: "c:\python27\python.exe" returned error.
       Code: 1
       Path: "C:\OOB\mbed-os-example-atecc608a"
       Command: "c:\python27\python.exe -u C:\OOB\mbed-os-example-atecc608a\mbed-os\tools\make.py -t ARM -m K64F --source . --build .\BUILD\K64F\ARM -v"
       Tip: You could retry the last command with "-v" flag for verbose output
---

AC6.13:

>armclang --version
Product: ARM Compiler 6.13 Professional
Component: ARM Compiler 6.13
Tool: armclang [5d895a00]

@Patater @adbridge

Not able to generate public key - unknown error

I'm able to run the application using GCC (using PR #32) but it seems I'm failing to generate a public key on a specific slot.

Sequence:

  1. Generate private key in slot 2

    generate_private=2
    Generating a private key in slot 2... Done.
    
  2. Generate public key in slot 3 using slot from private key 2

    generate_public=2_3
    Exporting a public key from private key in slot 2... Done.
    Importing public key to slot 3... Failed! Error -134.
    
  3. Generate public key in slot 2 using slot from private key 3 (should fail and display message)

    generate_public=3_2
    Exporting a public key from private key in slot 3... Done.
    Importing public key to slot 2... Failed! Error -134.
    
  • Issue 1: it shouldn't fail in step 2. I might be doing something wrong, but I couldn't figure out from the docs
  • Issue 2: there should be a better description of the error message for both -140 and -134

@Patater @dgreen-arm @adbridge

CMake build fails with `"STREQUAL" "small" Unknown arguments specified`

Description of defect

[EXAMPLES]> INFO     In folder 'mbed-os-example-attestation'
[EXAMPLES]> INFO     In folder 'mbed-os-example-atecc608a/atecc608a'
[EXAMPLES]> INFO     Compiling mbed-os-example-atecc608a/atecc608a K64F GCC_ARM
[EXAMPLES]> INFO     Executing command 'mbed-tools compile -t GCC_ARM -m K64F -c'...

#### STDOUT ####
Configuring project and generating build system...
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: /usr/bin/python3.7 (found version "3.7.4") found components: Interpreter 
-- Checking for Python package prettytable -- found
-- Checking for Python package future -- found
-- Checking for Python package jinja2 -- found
-- Checking for Python package intelhex -- found
-- Configuring incomplete, errors occurred!
See also "/builds/workspace/mbed-os-ci_cmake-example-GCC_ARM-dev@4/examples/mbed-os-example-atecc608a/atecc608a/cmake_build/K64F/develop/GCC_ARM/CMakeFiles/CMakeOutput.log".

#### STDERR ####
CMake Error at mbed-os/tools/cmake/app.cmake:10 (include):
  include could not find load file:

    /builds/workspace/mbed-os-ci_cmake-example-GCC_ARM-dev@4/examples/mbed-os-example-atecc608a/atecc608a/.mbedbuild/mbed_config.cmake
Call Stack (most recent call first):
  CMakeLists.txt:10 (include)


CMake Error at mbed-os/tools/cmake/toolchain.cmake:103 (include):
  include could not find load file:

    /builds/workspace/mbed-os-ci_cmake-example-GCC_ARM-dev@4/examples/mbed-os-example-atecc608a/atecc608a/mbed-os/tools/cmake/toolchains/.cmake
Call Stack (most recent call first):
  mbed-os/tools/cmake/app.cmake:15 (include)
  CMakeLists.txt:10 (include)


CMake Error at mbed-os/tools/cmake/toolchain.cmake:104 (include):
  include could not find load file:

    /builds/workspace/mbed-os-ci_cmake-example-GCC_ARM-dev@4/examples/mbed-os-example-atecc608a/atecc608a/mbed-os/tools/cmake/cores/.cmake
Call Stack (most recent call first):
  mbed-os/tools/cmake/app.cmake:15 (include)
  CMakeLists.txt:10 (include)


CMake Error at mbed-os/CMakeLists.txt:8 (include):
  include could not find load file:

    /builds/workspace/mbed-os-ci_cmake-example-GCC_ARM-dev@4/examples/mbed-os-example-atecc608a/atecc608a/.mbedbuild/mbed_config.cmake


CMake Error at mbed-os/CMakeLists.txt:29 (if):
  if given arguments:

    "STREQUAL" "small"

  Unknown arguments specified


ERROR: CMake invocation failed!

More information may be available by using the command line option '-v'.

Target(s) affected by this defect ?

K64F

Toolchain(s) (name and version) displaying this defect ?

GCC_ARM

What version of Mbed-os are you using (tag or sha) ?

9bbc8c914c7e

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

Mbed CLI 2

How is this defect reproduced ?

mbed-tools compile -t GCC_ARM -m K64F -c

Secure element does not wake in Release

Description of defect

Working with ATECC I2C device, in Debug or Develop mode works like a charm, as soon as I build in Release mode, device is not seen anymore and can't talk with it.

Please see full detail and issue here and root cause and also the dirty fix, don't know who's in charge of this deep level into cryptoauthlib.

I'm opening issue here because it impact this code but do not hesitate to tag people in charge.

Target(s) affected by this defect ?

STM32WL LoRa-E5 (may be other)

Toolchain(s) (name and version) displaying this defect ?

image

What version of Mbed-os are you using (tag or sha) ?

6.14
6.15.1
master

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

Mbed Studio

How is this defect reproduced ?

Switch Build profile to Debug, Release or Develop

Failed to run mbed deploy "Cannot find the mbed tools directory"

$ mbed deploy
[mbed] Working path "C:\Source\mbed\mbed-os-example-atecc608a\atecc608a" (program)
[mbed] Updating library "mbed-os-atecc608a" to rev #754d0e42acc1
[mbed] Updating library "mbed-os-atecc608a\mbed-cryptoauthlib" to rev #f2ed31e6bdab
[mbed] Updating library "mbed-os-atecc608a\mbed-cryptoauthlib\cryptoauthlib" to rev #8ea45c5f444a
[mbed] Updating library "mbed-os" to rev #9248169f1f00
[mbed] WARNING: Cannot find the mbed tools directory in "C:\Source\mbed\mbed-os-example-atecc608a"

$ mbed compile -m k64f -t GCC_ARM
[mbed] Working path "C:\Source\mbed\mbed-os-example-atecc608a\atecc608a" (program)
[mbed] ERROR: The mbed tools were not found in "C:\Source\mbed\mbed-os-example-atecc608a".
       You can run "mbed deploy" to install dependencies and tools.

I need to .mbed file in atecc608a folder manually.

TARGET=K64F
TOOLCHAIN=GCC_ARM
ROOT=.

Doesn't build with GCC9

I installed the app and switched to branch mbed-os-5.15.
Compiled with GCC9 as specified and failed.
Environment: Windows 10

> mbed compile -t GCC_ARM -m K64F -c
...

Compile [ 99.9%]: magic.c
Compile [100.0%]: USBPhy_Kinetis.cpp
Link: mbed-os-example-atecc608a
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `atecc608a_print_serial_number':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:160: undefined reference to `atcab_printbin_sp'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `atecc608a_print_config_zone':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:172: undefined reference to `atcab_printbin_label'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `setup_key_attributes':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:356: undefined reference to `psa_set_key_slot_number'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `run_tests':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:403: undefined reference to `mbedtls_psa_register_se_key'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `main':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:613: undefined reference to `psa_register_se_driver'
collect2.exe: error: ld returned 1 exit status
[ERROR] c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `atecc608a_print_serial_number':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:160: undefined reference to `atcab_printbin_sp'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `atecc608a_print_config_zone':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:172: undefined reference to `atcab_printbin_label'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `setup_key_attributes':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:356: undefined reference to `psa_set_key_slot_number'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `run_tests':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:403: undefined reference to `mbedtls_psa_register_se_key'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: BUILD/K64F/GCC_ARM/atecc608a/main.o: in function `main':
C:\OOB\mbed-os-example-atecc608a/.\atecc608a/main.c:613: undefined reference to `psa_register_se_driver'
collect2.exe: error: ld returned 1 exit status

[mbed] ERROR: "c:\python27\python.exe" returned error.
       Code: 1
       Path: "C:\OOB\mbed-os-example-atecc608a"
       Command: "c:\python27\python.exe -u C:\OOB\mbed-os-example-atecc608a\mbed-os\tools\make.py -t GCC_ARM -m K64F --source . --build .\BUILD\K64F\GCC_ARM -c"
       Tip: You could retry the last command with "-v" flag for verbose output
---

GCC version:

>arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Components:

>mbed ls
[mbed] Working path "C:\OOB\mbed-os-example-atecc608a" (program)
mbed-os-example-atecc608a (#d38906531c2a)
|- atecc608a\mbed-os-atecc608a (#754d0e42acc1)
|  `- mbed-cryptoauthlib (#f2ed31e6bdab)
|     `- cryptoauthlib (#8ea45c5f444a)
`- mbed-os (#b14f495aa23f, tag: mbed-os-5.15.0-rc1)

@Patater @adbridge

.mbedignore should be removed

During 5.15 OOB, I found that we're using .mbedignore in this example:
https://github.com/ARMmbed/mbed-os-example-atecc608a/blob/mbed-os-5.15/.mbedignore

This is essentially removing 'unity':
https://github.com/ARMmbed/mbed-os/tree/master/features/frameworks/unity

It shouldn't be required to use .mbedignore as it's considered a hack. If this 'unity' component is really required, it would create problems for developers when starting to develop applications from scratch just using the standard API in Mbed OS.

Please consider removing this file. If required a fix in Mbed OS, please raise an issue/PR there as well.

@Patater @adbridge

Other prerequisites undefined?

I am able to build on mbed-cli for the K64F as per the example but the program fails to link when I tried NUCLEO_L476RG and NUCLEO_L432KC (the two boards I have on hand).

The issue seems to be the PSA stuff. Prior to getting to the linking stage I had a number of problems with #include "psa/xxx" lines as well.

New to mbed-os, but it seems there are other prerequsites unmentioned...

Link: atecc608a

BUILD/NUCLEO_L476RG/GCC_ARM/main.o: In function run_tests': C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\main.c:380: undefined reference to mbed_psa_reboot_and_request_new_security_state'
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\main.c:403: undefined reference to mbed_psa_reboot_and_request_new_security_state' BUILD/NUCLEO_L476RG/GCC_ARM/main.o: In function main':
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\main.c:613: undefined reference to mbed_psa_reboot_and_request_new_security_state' BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto.o: In function psa_start_key_creation':
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1612: undefined reference to psa_crypto_save_transaction' C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1615: undefined reference to psa_crypto_stop_transaction'
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1615: undefined reference to psa_crypto_transaction' BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto.o: In function psa_finish_key_creation':
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1707: undefined reference to psa_destroy_persistent_key' C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1645: undefined reference to psa_crypto_transaction'
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1710: undefined reference to psa_crypto_stop_transaction' BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto.o: In function psa_fail_key_creation':
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1753: undefined reference to psa_crypto_stop_transaction' BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto.o: In function psa_crypto_init':
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:5660: undefined reference to psa_crypto_load_transaction' BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto_se.o: In function psa_load_se_persistent_data':
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto_se.c:166: undefined reference to psa_its_get' BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto_se.o: In function psa_save_se_persistent_data':
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto_se.c:185: undefined reference to psa_its_set' collect2.exe: error: ld returned 1 exit status [ERROR] BUILD/NUCLEO_L476RG/GCC_ARM/main.o: In function run_tests':
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\main.c:380: undefined reference to mbed_psa_reboot_and_request_new_security_state' C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\main.c:403: undefined reference to mbed_psa_reboot_and_request_new_security_state'
BUILD/NUCLEO_L476RG/GCC_ARM/main.o: In function main': C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\main.c:613: undefined reference to mbed_psa_reboot_and_request_new_security_state'
BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto.o: In function psa_start_key_creation': C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1612: undefined reference to psa_crypto_save_transaction'
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1615: undefined reference to psa_crypto_stop_transaction' C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1615: undefined reference to psa_crypto_transaction'
BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto.o: In function psa_finish_key_creation': C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1707: undefined reference to psa_destroy_persistent_key'
C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1645: undefined reference to psa_crypto_transaction' C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1710: undefined reference to psa_crypto_stop_transaction'
BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto.o: In function psa_fail_key_creation': C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:1753: undefined reference to psa_crypto_stop_transaction'
BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto.o: In function psa_crypto_init': C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto.c:5660: undefined reference to psa_crypto_load_transaction'
BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto_se.o: In function psa_load_se_persistent_data': C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto_se.c:166: undefined reference to psa_its_get'
BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os/features/mbedtls/mbed-crypto/platform/COMPONENT_PSA_SRV_IMPL/psa_crypto_se.o: In function psa_save_se_persistent_data': C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a/.\mbed-os\features\mbedtls\mbed-crypto\platform\COMPONENT_PSA_SRV_IMPL/psa_crypto_se.c:185: undefined reference to psa_its_set'
collect2.exe: error: ld returned 1 exit status

[mbed] ERROR: "c:\program files\python37\python.exe" returned error.
Code: 1
Path: "C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a"
Command: "c:\program files\python37\python.exe -u C:\Users\mdrob\mbed-os-example-atecc608a\atecc608a\mbed-os\tools\make.py -t GCC_ARM -m NUCLEO_L476RG --source . --build .\BUILD\NUCLEO_L476RG\GCC_ARM"
Tip: You could retry the last command with "-v" flag for verbose output

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.