1. Home
  2. Docs
  3. Code Overview
  4. DMA Streams

DMA Streams

Direct Memory Access (DMA) can be used in combination with UART ports to create what we call DMA Streams. These are high speed pipelines that can be used to carry data across the array. Once configured, DMA streams carry data across the array without intervention from the MCUs involved. This means that messages transferred through DMA streams will not be parsed and routed. The default mode for module ports after startup is backend messaging. However, they can be configured in DMA stream via various APIs. 

You can build a single-cast DMA stream (i.e., single source port to single destination port) using the following API:

BOS_Status StartScastDMAStream(uint8_t srcP, uint8_t srcM, uint8_t dstP, uint8_t dstM, uint8_t direction, uint32_t count, uint32_t timeout, uint8_t stored)

where:

  • srcM: source module ID
  • dstM: destination module ID
  • srcP: source module port (stream source)
  • dstP: destination module port (stream destination)
  • direction: DMA stream direction: FORWARD, BACKWARD, BIDIRECTIONAL
  • count: number of bytes to transfer (0xFFFFFFFF for infinite bytes)
  • timeout: transfer timeout in msec (0xFFFFFFFF for infinite time)
  • stored: store the stream in emulated EEPROM so that it’ll be re-initiated again on startup (true or false)

The stream stops after count bytes or timeout time is reached, whichever happens first. Once stopped, all involved module ports restore back their normal messaging functionality. There are three DMA streams available for user setup in each module. You can check the status of module ports and streams in the CLI using status command, or in your code using the portStatus[] array.

How can we help?