KL81 MDHA issue

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

KL81 MDHA issue

639 Views
daweiy
Contributor I

Hi,

I use KL81's SHA256 to calculate Flash's Hash. It works fine with some data in RAM. But when I tried to calculate my whole firmware's SHA256, I got some problems.The firmware is running in flash, starts from 0x00000000.

When I use the LTC driver to do the calculation, I found one of the functions, LTC_DRV_hash_update(), has a check on input buffer:

if ((NULL == ctx) || (NULL == input))
{
    return kStatus_LTC_InvalidInput;
}

So my calculation failed because the input address is 0. I tried to remove this check, the code stuck in function ltc_drv_wait().

If I changed the input address from 0 to 0x4, the code stuck in function ltc_drv_wait() as well.

If I copy my firmware from Flash to a big buffer in RAM and calculate the SHA256, the code hang in ltc_drv_wait() as well. 

The code size is 0x8A30 bytes. It looks like if the code try to calculate the hash of itself, the LTC module cannot finish the calculation.

 Did anyone has this problem before?

Regards,

Dawei

0 Kudos
5 Replies

506 Views
daweiy
Contributor I

One thing I found this morning was if the data length is 0xfef, SHA256 works, not hang. If the data length is 0xff0, code hang in ltc_drv_wait().

0 Kudos

506 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Dawei,

So far, the KSDK software version is V2.2, which with many difference about LTC module driver.

We would recommend to update the KSDK software to the latest V2.2 .

About the current version LTC driver, please try with below ways:

1> Remove "NULL == input" in <hash.c> file;

2> Modify “#undef SECLIB_LTC_DRV_INTERRUPT_MODE” in ltc_driver.c

Wish it helps.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

506 Views
daweiy
Contributor I

Hi Ma,

Thanks for the reply. I am using Kinetis SDK v1.3 for KL81. Can you please give me a link of Kinetis SDK v2.2 for KL81? Thanks.

0 Kudos

506 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Dawei,

I am checking with our marketing team to provide the latest version KSDK for KL81 software to you.

Thank you for the patience.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

506 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Dawei,

Sorry for the later reply.

I am checking this issue with Kinetis product team and will let you know later.

Thank you for the patience.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos