This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-AM263P: Warm reset after multishot SHA256 with DTHE accelerators

Part Number: LP-AM263P
Other Parts Discussed in Thread: SHA-256

Tool/software:

Hello,

I'm trying to set up a sha-256 hash using SDK for AM263Px v1.0.31 (on a HS-SE device) for a relatively large area of memory. Data is based in flash memory but from description on SDK pages DMA isn't set up yet, so I am copying data from flash into a local buffer first. Buffer size is currently 256b for simplicity (same as nvm page length).

Initialisation is copied from the crypto_sha_256_main.c example. I call DTHE_open() and DTHE_SHA_open() respectively, and set it up for sha256.

I then use the multishot flag with DTHE_SHA_compute() - set to FALSE initially, only setting to TRUE for the last block. There's a state manager here which sequentially steps through the image data in memory, processing it per 'chunk'. I keep the dthe_sha driver open whilst the conversion is ongoing - i.e. only call DTHE_SHA_close() once after all chunks are processed.

For the first 'chunk', i receive a positive response from DTHE_SHA_compute(). There is intermediate data in the digest, further indicating the hash calculation was done successfully.

However, at the moment, I am seeing a warm reset occur directly after the call to DTHE_SHA_compute(). Reset reason is 0xB - cause unknown. I'm a bit surprised by this, suspect there is some configuration missing somewhere - possibly from HsmRT. AFAIK the HSM watchdog (as well as all watchdogs on the R5F) are currently disabled,

Is this way of doing multishot sha256 hashing ok? Are there any steps missing from my procedure?

If so - does anyone have any pointers as to what 'unknown' reasons could be causing this warm reset?

Thanks

  • Hi again,

    Have found the cause for the warm reset, it was caused by incorrect pointer access in another area of code.

    However, two questions on the DTHE_SHA_compute() call:

    - Is there an estimate on when access through DMA access will be supported?

    - Is there a recommended buffer size for processing chunks for hashing? Without DMA, sequential writes to DTHE_SHA_writeDataBlock are done based on chunk size so it would seem there isn't any restriction on maximum chunk size. Is that the same when DMA is supported?

    Thanks