ST STM32F40 Series Reference Manual page 608

Hide thumbs Also See for STM32F40 Series:
Table of Contents

Advertisement

RM0090
Procedure where the data are loaded by software
The context can be saved only when no block is currently being processed. That is, you
must wait for DINIS = 1 (the last block has been processed and the input FIFO is empty) or
NBW ≠ 0 (the FIFO is not full and no processing is ongoing).
Context saving:
Store the contents of the following registers into memory:
Context restoring:
The context can be restored when the high-priority task is complete. Please follow the
order of the sequence below.
a)
b)
c)
You can now restart the processing from the point where it has been interrupted.
Procedure where the data are loaded by DMA
In this case it is not possible to predict if a DMA transfer is in progress or if the process is
ongoing. Thus, you must stop the DMA transfers, then wait until the HASH is ready in order
to interrupt the processing of a message.
Interrupting a processing:
The context saving and context restoring phases are the same as above (see
Procedure where the data are loaded by
Reconfigure the DMA controller so that it transfers the end of the message. You can now
restart the processing from the point where it was interrupted by setting the DMAE bit.
Note:
1
If context swapping does not involve HMAC operations, the HASH_CSR38 to
HASH_CSR50 (STM32F405xx/07xx and STM32F415xx/17xx) and HASH_CSR38 to
HASH_CSR53 (STM32F42xxx and STM32F43xxx) registers do not have to be saved and
restored.
2
If context swapping occurs between two blocks (the last block was completely processed
and the next block has not yet been pushed into the IN FIFO, NBW = 000 in the HASH_CR
HASH_IMR
HASH_STR
HASH_CR
HASH_CSR0 to HASH_CSR50 on STM32F405xx/07xx and STM32F415xx/17xx,
and HASH_CSR0 to HASH_CSR53 on STM32F42xxx and STM32F43xxx.
Write the following registers with the values saved in memory: HASH_IMR,
HASH_STR and HASH_CR
Initialize the hash processor by setting the INIT bit in the HASH_CR register
Write the HASH_CSR0 to HASH_CSR50 (STM32F405xx/07xx and
STM32F415xx/17xx), and HASH_CSR0 to HASH_CSR53 (STM32F42xxx and
STM32F43xxx) registers with the values saved in memory
Clear the DMAE bit to disable the DMA interface
Wait until the current DMA transfer is complete (wait for DMAES = 0 in the
HASH_SR register). Note that the block may or not have been totally transferred to
the HASH.
Disable the corresponding channel in the DMA controller
Wait until the hash processor is ready (no block is being processed), that is wait for
DINIS = 1
Doc ID 018909 Rev 4
Hash processor (HASH)
software).
608/1422

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F40 Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Stm32f41 seriesStm32f42 seriesStm32f43 seriesRm0090

Table of Contents

Save PDF