We are migrating from HSE FW v2.6.0 to HSE FW v2.40.0 while maintaining the same Qi key provisioning and Secure Boot flow.
With HSE FW v2.6.0, the complete provisioning sequence executes successfully:
With HSE FW v2.40.0, all provisioning steps complete successfully until Secure Boot configuration is started.
During Secure Boot configuration the following API fails:
| HseStatus : 2848 |
| bit 0 : 0 RFU |
| bit 1 : 0 HSE_SHE_STATUS_SECURE_BOOT |
| bit 2 : 0 HSE_SHE_STATUS_SECURE_BOOT_INIT |
| bit 3 : 0 HSE_SHE_STATUS_SECURE_BOOT_FINISHED |
| bit 4 : 0 HSE_SHE_STATUS_SECURE_BOOT_OK |
| bit 5 : 1 HSE_STATUS_RNG_INIT_OK |
| bit 6 : 0 HSE_STATUS_HOST_DEBUGGER_ACTIVE |
| bit 7 : 0 HSE_STATUS_HSE_DEBUGGER_ACTIVE |
| bit 8 : 1 HSE_STATUS_INIT_OK |
| bit 9 : 1 HSE_STATUS_INSTALL_OK |
| bit 10 : 0 HSE_STATUS_BOOT_OK |
| bit 11 : 1 HSE_STATUS_CUST_SUPER_USER |
| bit 12 : 0 HSE_STATUS_OEM_SUPER_USER |
| bit 13 : 0 HSE_STATUS_FW_UPDATE_IN_PROGRESS |
| bit 14 : 0 RFU |
| bit 15 : 0 RFU |
| smrCoreStatus_Get : |
| smrCoreStatus[1] : 0 , smrCoreStatus[0] : 0 |
| smrStatus[1] : 0 , smrStatus[0] : 0 |
| ImportPlainSymKeyReqMuChannel-hseResp: 0x55a5aa33 |
| LoadBootMacKey-hseResp: 0x55a5aa33 |
| Generic_ImportKeys-hseResp: 0x55a5aa33 |
| KeyProvisioningForJTAG-status: 1 |
| SecureBootConfiguration-hseResp: 0x55a5aa33 |
| KeyProvisioningToHseNVM-status: 1 |
| NON_SECURE_IVT-BLOCK1-hseResp: 0x55a5aa33 |
| SECURE_IVT-BLOCK0-hseResp: 0x55a5aa33 |
| writeDefaultData |
| Running Secure Boot CFG program |
| Hse-FW Version : 0.13.0.2.6.0 , full mem |
| using interface version : 0.13.0.2.6.0 |
| HseStatus : 2862 |
| bit 0 : 0 RFU |
| bit 1 : 1 HSE_SHE_STATUS_SECURE_BOOT |
| bit 2 : 1 HSE_SHE_STATUS_SECURE_BOOT_INIT |
| bit 3 : 1 HSE_SHE_STATUS_SECURE_BOOT_FINISHED |
| bit 4 : 0 HSE_SHE_STATUS_SECURE_BOOT_OK |
| bit 5 : 1 HSE_STATUS_RNG_INIT_OK |
| bit 6 : 0 HSE_STATUS_HOST_DEBUGGER_ACTIVE |
| bit 7 : 0 HSE_STATUS_HSE_DEBUGGER_ACTIVE |
| bit 8 : 1 HSE_STATUS_INIT_OK |
| bit 9 : 1 HSE_STATUS_INSTALL_OK |
| bit 10 : 0 HSE_STATUS_BOOT_OK |
| bit 11 : 1 HSE_STATUS_CUST_SUPER_USER |
| bit 12 : 0 HSE_STATUS_OEM_SUPER_USER |
| bit 13 : 0 HSE_STATUS_FW_UPDATE_IN_PROGRESS |
| bit 14 : 0 RFU |
| bit 15 : 0 RFU |
| smrCoreStatus_Get : |
| smrCoreStatus[1] : 0 , smrCoreStatus[0] : 0 |
| smrStatus[1] : 1 , smrStatus[0] : 1 |
| HseStatus : 2912 |
| bit 0 : 0 RFU |
| bit 1 : 0 HSE_SHE_STATUS_SECURE_BOOT |
| bit 2 : 0 HSE_SHE_STATUS_SECURE_BOOT_INIT |
| bit 3 : 0 HSE_SHE_STATUS_SECURE_BOOT_FINISHED |
| bit 4 : 0 HSE_SHE_STATUS_SECURE_BOOT_OK |
| bit 5 : 1 HSE_STATUS_RNG_INIT_OK |
| bit 6 : 1 HSE_STATUS_HOST_DEBUGGER_ACTIVE |
| bit 7 : 0 HSE_STATUS_HSE_DEBUGGER_ACTIVE |
| bit 8 : 1 HSE_STATUS_INIT_OK |
| bit 9 : 1 HSE_STATUS_INSTALL_OK |
| bit 10 : 0 HSE_STATUS_BOOT_OK |
| bit 11 : 1 HSE_STATUS_CUST_SUPER_USER |
| bit 12 : 0 HSE_STATUS_OEM_SUPER_USER |
| bit 13 : 0 HSE_STATUS_FW_UPDATE_IN_PROGRESS |
| bit 14 : 0 RFU |
| bit 15 : 0 RFU |
| smrCoreStatus_Get : |
| smrCoreStatus[1] : 0 , smrCoreStatus[0] : 0 |
| smrStatus[1] : 0 , smrStatus[0] : 0 |
| UML SW Version : WSB00.3B_UART_ENABLE |
| Running Secure Boot CFG program |
| Hse-FW Version : 0.13.0.2.40.0 , full mem |
| using interface version : 0.13.0.2.40.0 |
| HseStatus : 2848 |
| bit 0 : 0 RFU |
| bit 1 : 0 HSE_SHE_STATUS_SECURE_BOOT |
| bit 2 : 0 HSE_SHE_STATUS_SECURE_BOOT_INIT |
| bit 3 : 0 HSE_SHE_STATUS_SECURE_BOOT_FINISHED |
| bit 4 : 0 HSE_SHE_STATUS_SECURE_BOOT_OK |
| bit 5 : 1 HSE_STATUS_RNG_INIT_OK |
| bit 6 : 0 HSE_STATUS_HOST_DEBUGGER_ACTIVE |
| bit 7 : 0 HSE_STATUS_HSE_DEBUGGER_ACTIVE |
| bit 8 : 1 HSE_STATUS_INIT_OK |
| bit 9 : 1 HSE_STATUS_INSTALL_OK |
| bit 10 : 0 HSE_STATUS_BOOT_OK |
| bit 11 : 1 HSE_STATUS_CUST_SUPER_USER |
| bit 12 : 0 HSE_STATUS_OEM_SUPER_USER |
| bit 13 : 0 HSE_STATUS_FW_UPDATE_IN_PROGRESS |
| bit 14 : 0 RFU |
| bit 15 : 0 RFU |
| smrCoreStatus_Get : |
| smrCoreStatus[1] : 0 , smrCoreStatus[0] : 0 |
| smrStatus[1] : 0 , smrStatus[0] : 0 |
| ImportPlainSymKeyReqMuChannel-hseResp: 0x55a5a399 |
ECU getting stuck in secure boot only
Hi @ShrikantM
Could you please share your key catalogs as well as the parameters used in the ImportPlainSymKeyReqMuChannel() function call? The reported error indicates that one or more HSE request parameters are invalid.
BR, VaneB
Thank you for sharing the information. Based on your configuration, I have the following observations:
#define NVM_AES128_BOOT_KEY GET_KEY_HANDLE(HSE_KEY_CATALOG_ID_NVM, 1, 1)However, according to your NVM key catalog configuration, the AES key group is the third group (NvmKeyGroup_2). Based on this configuration, the correct definition for NVM_AES128_BOOT_KEY should be: GET_KEY_HANDLE(HSE_KEY_CATALOG_ID_NVM, 2, 0)Hi @VaneB ,
We are using below key catalogs:
/* Table containing NVM key catalog entries */
const hseKeyGroupCfgEntry_t aHseNvmKeyCatalog[] =
{
/* NvmKeyGroup_0 */
{(HSE_MU0_MASK), HSE_KEY_OWNER_CUST, HSE_KEY_TYPE_SHE, 1U, 128U, {0U, 0U}},
/* NvmKeyGroup_1 */
{(HSE_MU0_MASK), HSE_KEY_OWNER_CUST, HSE_KEY_TYPE_ECC_PAIR, 1U, 256U, {0U, 0U}},
/* NvmKeyGroup_2 */
{(HSE_MU0_MASK), HSE_KEY_OWNER_CUST, HSE_KEY_TYPE_AES, 1U, 256U, {0U, 0U}},
/* Marker to end the key catalog */
{0U, 0U, 0U, 0U, 0U, {0U, 0U}}
};
/* Table containing RAM key catalog entries */
const hseKeyGroupCfgEntry_t aHseRamKeyCatalog[] =
{
/* RamKeyGroup_0 */
{(HSE_MU0_MASK), HSE_KEY_OWNER_CUST, HSE_KEY_TYPE_SHE, 1U, 128U, {0U, 0U}},
/* Marker to end the key catalog */
{0U, 0U, 0U, 0U, 0U, {0U, 0U}}
};
For below function we receive HSE_SRV_RSP_INVALID_PARAM
hseSrvResponse_t Generic_ImportKeys(void)
{
hseSrvResponse_t srvResponse = HSE_SRV_RSP_GENERAL_ERROR;
/*Import key linked with SMR#0*/
srvResponse = ImportPlainSymKeyReqMuChannel(
MU0,
1U,
NVM_AES128_BOOT_KEY,
HSE_KEY_TYPE_AES,
( HSE_KF_USAGE_VERIFY ),
0U,
aesEcbKeyLength,
aesEcbKey,
TRUE
);
ASSERT(HSE_SRV_RSP_OK == srvResponse );
if(HSE_SRV_RSP_OK != srvResponse)
goto exit;
/* load keys for SHE secure boot */
srvResponse = LoadBootMacKey();
ASSERT(HSE_SRV_RSP_OK == srvResponse );
if(HSE_SRV_RSP_OK != srvResponse)
goto exit;
exit:
return srvResponse;
}
Please check attached global_defs.h for more details about the parameters.
Thanks and Regards,
Swapnil Gawade
According to your description, I noticed that you appear to have combined the DemoApp framework with the Hse_Ip drivers. Is my understanding correct? If so, what modifications have been applied?
Also, have you disabled the data cache in your project? This is a common cause of the HSE_SRV_RSP_INVALID_PARAM error. All data objects used for communication with HSE must be forced to non-cacheable memory.
I also noticed that you are passing HSE_DTCM_ADDR(pHseSrvDesc) as the pHseSrvDesc parameter to the Hse_Ip_ServiceRequest() function. Please refer to the thread HSE_ReadAdkp returning HSE_SRV_RSP_INVALID_ADDR, where my colleague explains some considerations regarding the use of HSE with DTCM memory.
You may also want to take a look at Hse_Ip_ToAHBAddress(), which converts a local address into an HSE host address when TCM support is enabled. It could be useful in this scenario.
Hi @VaneB ,
As per your suggestion I have done the changes, but it also gives similar response as HSE_SRV_RSP_INVALID_PARAM (0x55a5a399).
After debugging we found that it, in ImportPlainSymKeyReqMuChannel(...)->EraseKeyReq(targetKeyHandle, HSE_ERASE_NOT_USED))->HSE_Send(muIf, muChannelIdx, gSyncTxOption, pHseSrvDesc)->Hse_Ip_ServiceRequest(u8MuInstance, u8MuChannel, pHseIp_Request , HSE_DTCM_ADDR(pHseSrvDesc))->Mu_Ip_SetTxRegister(Hse_Ip_apMuBase[u8MuInstance], u8MuChannel, (uint32)pHseSrvDesc) retruns response as HSE_SRV_RSP_INVALID_PARAM (0x55a5a399).
The parameters of pHseSrvDesc are added in attached Mu_Ip_SetTxRegister-pHseSrvDesc.xlsx.
Thanks and Regards,
Swapnil Gawade