takashi kadono / Mbed OS Nucleo446_SSD1331

Dependencies:   ssd1331

Committer:
kadonotakashi
Date:
Wed Oct 10 00:33:53 2018 +0000
Revision:
0:8fdf9a60065b
how to make mbed librry

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kadonotakashi 0:8fdf9a60065b 1 # Guidelines for porting Cryptocell to Mbed OS
kadonotakashi 0:8fdf9a60065b 2
kadonotakashi 0:8fdf9a60065b 3 Cryptocell (CC) 310 is a hardware accelerator that can be ported to several boards, assuming these boards have CC 310 embedded in their hardware.
kadonotakashi 0:8fdf9a60065b 4
kadonotakashi 0:8fdf9a60065b 5 The CC 310 driver consists of three libraries:
kadonotakashi 0:8fdf9a60065b 6
kadonotakashi 0:8fdf9a60065b 7 * A common core library(`libcc_core.a`).
kadonotakashi 0:8fdf9a60065b 8 * A platform-specific TRNG library, containing TRNG-related information, for sampling sufficient entropy on the specific platform(`libcc_trng.a`).
kadonotakashi 0:8fdf9a60065b 9 * A platform-specific library containing extra information, such as the CC register's base addresses on the specific board. (`libcc_ext.a`)
kadonotakashi 0:8fdf9a60065b 10
kadonotakashi 0:8fdf9a60065b 11 To port your CC 310 driver to Mbed OS on your specific target, do the following:
kadonotakashi 0:8fdf9a60065b 12
kadonotakashi 0:8fdf9a60065b 13 1. In `targets.json` add the following to your target:
kadonotakashi 0:8fdf9a60065b 14 * `MBEDTLS_CONFIG_HW_SUPPORT` to `macros_add` key. This instructs Mbed TLS to look for an alternative cryptographic implementation.
kadonotakashi 0:8fdf9a60065b 15 * `CRYPTOCELL310` to `feature`. Use this in your common code that you need to remove from compilation in case CC exists in your board. Use `#if !defined(FEATURE_CRYPTOCELL310)` and `#if defined(FEATURE_CRYPTOCELL310)`.
kadonotakashi 0:8fdf9a60065b 16 1. In `objects.h`, include `objects_cryptocell.h`. You can use the `FEATURE_CRYPTOCELL310` precompilation check as defined above.
kadonotakashi 0:8fdf9a60065b 17 1. In `features/cryptocell/FEATURE_CRYPTOCELL310/TARGET_<target name>`, add your platform-specific libraries for all toolchains in `TOOLCHAIN_ARM`, `TOOLCHAIN_GCC_ARM` and `TOOLCHAIN_IAR` respectively.
kadonotakashi 0:8fdf9a60065b 18 1. Add your CC setup code:
kadonotakashi 0:8fdf9a60065b 19 * Implement `crypto_platform_setup()` and `crypto_platform_terminate()` to enable CC on your platform, in case you have board-specific setup functionality, required for CC setup. You MUST call 'SaSi_LibInit()` and 'SaSi_LibFini()' respectively in these functions.
kadonotakashi 0:8fdf9a60065b 20 * Define `crypto_platform_ctx` in `crypto_platform.h` in a way that suits your implementation.
kadonotakashi 0:8fdf9a60065b 21