60.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 SHA_CR.FIRST bit 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 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 Figure 60-4).
If automatic padding is enabled, the end of SHA processing requires only one interrupt to be verified (see Figure 60-5). The DMA end of transfer is not required, so the SHA DATRDY interrupt must be enabled before starting the DMA, and the DATRDY interrupt is the only one to be verified.
