8.7.4.9.3 DMA Mode
The DMA can be used in association with the SHA to perform the algorithm on a complete message without any action by the software during processing.
SHA_MR.SMOD must be configured to 2.
The DMA must be configured with non-incremental addresses.
The start address of any transfer descriptor must be set to point to the SHA_IDATAR0.
The DMA chunk size must be set to transfer, for each trigger request, 16 words of 32 bits.
The FIRST bit of SHA_CR must be set before starting the DMA when the first block is transferred.
The DMA generates an interrupt when the end of buffer transfer is completed but the SHA processing is still in progress. The end of SHA processing is indicated by the flag DATRDY in the SHA_ISR.
If automatic padding is disabled, the end of SHA processing requires two interrupts to be verified. The DMA end of transfer interrupt must be verified first, then the SHA DATRDY interrupt must be enabled and verified (see the figure Interrupts Processing with DMA).
If automatic padding is enabled, the end of SHA processing requires only one interrupt to be verified. The DMA end of transfer is not required, so the SHA DATRDY interrupt must be enabled prior to start the DMA and DATRDY interrupt is the only one to be verified (see the figure Interrupts Processing with DMA and Automatic Padding).