hw_unique_key sample can not run in NS mode

Hi ,

When i run  samples/keys/hw_unique_key  app and select  nrf9160dk_nrf9160_ns board . The app can not run into  main function  instead run into system_halt.

__WEAK void tfm_hal_system_halt(void)
{
    /*
     * Disable IRQs to stop all threads, not just the thread that
     * halted the system.
     */
    __disable_irq();

    /*
     * Enter sleep to reduce power consumption and do it in a loop in
     * case a signal wakes up the CPU.
     */
    while (1) {
        __WFE();
    }
}
 
At the same time I tested some other samples with 'CONFIG_TFM_PROFILE_TYPE_NOT_SET=y' configured, none of them work properly in non-secure mode.

Why is this happening please help.
Parents Reply
  • Yes, hw_unique_key in sdk select nrf9160dk_nrf9160 and nrf9160dk_nrf9160_ns boards both work fine on my end. 
    Selecting the nrf9160dk_nrf9160_ns board will set
    CONFIG_BUILD_WITH_TFM=y
    CONFIG_TFM_PROFILE_TYPE_NOT_SET=y

    Selecting the nrf9160dk_nrf9160 board will set
    CONFIG_MBEDTLS_PSA_CRYPTO_C=y
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_MBEDTLS_ENABLE_HEAP=y
    CONFIG_HW_UNIQUE_KEY=y
    CONFIG_HW_UNIQUE_KEY_RANDOM=y

    But we need to do it, our application runs in a non-secure program, hw_unique_key and crypto(ecdsa) in a secure program. In no-secure, the application calls hw_unique_key and crypto through the TF-M IOCTL interface.

    I have tried both configurations of nrf9160dk_nrf9160 and nrf9160dk_nrf9160_ns above, hw_unique_key is not working properly in secure application.

Children
Related