diff --git a/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/backend/cc310/cc310_backend_init.c b/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/backend/cc310/cc310_backend_init.c index e3e77f0b..05f29edb 100644 --- a/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/backend/cc310/cc310_backend_init.c +++ b/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/backend/cc310/cc310_backend_init.c @@ -57,6 +57,18 @@ void cc310_backend_enable(void); */ void cc310_backend_disable(void); +// patch start +uint32_t forceLinkingcc310BackendInit() +{ + /* + The linker does not link this file as the above two functions are found in cc310_backend_shared.c + And therefore CRYPTO_BACKEND_REGISTER does not place cc310_backend_init cc310_backend_uninit + in the crypto_data section in flash. This is a workaround for not ignoring this file. + */ + return 0; +} +//patch end + static uint32_t init_result_get(uint32_t crys_error) { uint32_t ret_val = NRF_ERROR_INTERNAL; --- a/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/nrf_crypto_init.c +++ b/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/nrf_crypto_init.c @@ -79,6 +79,11 @@ ret_code_t nrf_crypto_init(void) return ret_val; } } + // patch start +#if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_CC310) + forceLinkingcc310BackendInit(); +#endif + // patch end // Set nrf_crypto to initialized m_state = INITIALIZED; diff --git a/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/nrf_crypto_init.h b/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/nrf_crypto_init.h index 8e10ae13..a90125b0 100644 --- a/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/nrf_crypto_init.h +++ b/bsp/nRF5_SDK_15.2.0_9412b96/components/libraries/crypto/nrf_crypto_init.h @@ -136,6 +136,10 @@ bool nrf_crypto_is_initialized(void); */ bool nrf_crypto_is_initializing(void); +// patch start +uint32_t forceLinkingcc310BackendInit(); +// patch end + #ifdef __cplusplus } #endif