The following example shows the steps required to start a DMA channel thread using the debug instruction registers.
- Create a program for the DMA channel.
- Store the program in a region of system memory.
Use one of the APB interfaces on the DMAC to program a DMAGO instruction as follows:
- Poll the dmac.DBGSTATUS register to ensure that debug is idle, that is, the
dbgstatus bit is
0. Refer to the Debug Status register in Register Details. - Write to the dmac.DBGINST0 register and enter
the:
- Instruction byte
0encoding for DMAGO. - Instruction byte
1encoding for DMAGO. - Debug thread bit to
0. This selects the DMA manager. Refer to the Debug Instruction-0 register in Register Details.
- Instruction byte
- Write to the dmac.DBGINST1 register with the DMAGO instruction byte [5:2] data,
refer to the Debug Instruction-1 register in Register Details.
These four bytes must be set to the address of the first instruction in the
program that was written to system memory in Step 2.
Instruct the DMAC to execute the instruction that the debug instruction registers contain:
- Write a
0to the dmac.DBGCMD register. The DMAC starts the DMA channel thread and sets the dbgstatus bit to1. Refer to the Debug Command register in Register Details. After the DMAC completes execution of the instruction, it clears the dbgstatus bit to0.