Direct memory access (DMA)

nRF5340 Product Specification

CRYPTOCELL support direct memory access (DMA) to allow cryptographic operations on memory mapped regions without involving the CPU.

The following table indicates which memory is accessible by CRYPTOCELL DMA engines.

Table 1. DMA transaction types
Memory type Read Write
SRAM Yes Yes
Flash Yes Yes

Data stored in a memory type not accessible by CRYPTOCELL DMA engines must be copied to an accessible memory type before it can be processed by the CRYPTOCELL subsystem. Maximum DMA transaction size is limited to 216-1 bytes.

The CRYPTOCELL DMA engine can also run in Bypass mode, meaning data is read and written without being piped through a cryptographic engine. Thus CRYPTOCELL can act as a general purpose DMA engine for moving data.

Operating the DMA engines in Bypass mode involve the following steps:
  1. Enable DMA engines clock using register DMA_CLK.
  2. Configure cryptographic control for Bypass mode using register CRYPTO_CTL.
  3. Set the the output destination address and size of the receiving buffer.
  4. Start the DMA transaction by configuring the input source address and the number of bytes to transfer.
  5. Status of the DMA transaction can be monitored by either polling register DOUT_DMA_MEM_BUSY, or by unmasking the interrupt for field DOUT_TO_MEM_MASK in register IMR.

See DIN DMA engine and DOUT DMA engine for more information.