Generate NVM key returns HSE_SRV_RSP_INVALID_PARAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Generate NVM key returns HSE_SRV_RSP_INVALID_PARAM

Jump to solution
1,116 Views
kerti1
Contributor III

Hi,

 

I previously implemented CMAC generation and verification using a RAM key (hardcoded in the application), and it worked successfully. Now, I'm trying to switch to using a key generated by the HSE and stored in the NVM key catalog. However, when I attempt to generate the key, I receive the response HSE_SRV_RSP_INVALID_PARAM.

What could be the possible reasons for this error? Do I need to explicitly store the key in NVM after generation, or does the HSE handle that internally?

I've attached relevant code and images. Any guidance would be appreciated.

KeerthiT_0-1747138410211.pngKeerthiT_1-1747138445179.png

 

0 Kudos
Reply
1 Solution
1,091 Views
kerti1
Contributor III

Hi @lukaszadrapa ,

 

Thanks for the response. Just now I was able to generate the NVM keys. Yes, I always disable the Data cache.

2. How does your NVM key catalog look like? Is the KeyHandle correct?

   As you suggested, It is the issue of the NVM key catalog. I changed to the attached below.

KeerthiT_0-1747216941800.png

The NVM key must be empty when calling the service (it must be erased if it is not empty) and SuperUser rights are needed.

       I have superuser rights. How would i know that the NVM key is empty or not? If not how to erase it ?. I would be helpful if i get to know these.

View solution in original post

0 Kudos
Reply
3 Replies
1,097 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @kerti1 

I can't see problem in the parameters.

1. Could you try to disable data cache to confirm it is not cache issue?

2. How does your NVM key catalog look like? Is the KeyHandle correct?

HSE_SRV_ID_KEY_GENERATE service stores the key to NVM catalog, it's not done by user. The NVM key must be empty when calling the service (it must be erased if it is not empty) and SuperUser rights are needed.

Regards,

Lukas

0 Kudos
Reply
1,092 Views
kerti1
Contributor III

Hi @lukaszadrapa ,

 

Thanks for the response. Just now I was able to generate the NVM keys. Yes, I always disable the Data cache.

2. How does your NVM key catalog look like? Is the KeyHandle correct?

   As you suggested, It is the issue of the NVM key catalog. I changed to the attached below.

KeerthiT_0-1747216941800.png

The NVM key must be empty when calling the service (it must be erased if it is not empty) and SuperUser rights are needed.

       I have superuser rights. How would i know that the NVM key is empty or not? If not how to erase it ?. I would be helpful if i get to know these.

0 Kudos
Reply
1,078 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

All keys in RAM and in NVM are empty after catalog formatting. Easiest option to check if a key is empty or not: try to use such key. In your case, you can try to calculate CMAC over a few bytes. If the key is empty, you will get response HSE_ SRV_ RSP_ KEY_ EMPTY.

A key can be erased by HSE_SRV_ID_ERASE_KEY service:

lukaszadrapa_0-1747225361701.png

 Take a look at hseEraseKeySrv_t in HSE Service API reference manual for details.

Regards,

Lukas

 

0 Kudos
Reply