DSP EDMA Learning and questions

Source: Internet
Author: User

EDMA is a data transmission mode that uses EDMA to establish a direct data transfer channel between external devices and memory without CPU intervention, saving CPU time.

The EDMA controller mainly consists of two parts: the transmission controller and the channel controller. The transfer controller contains the data to be transferred, and the channel controller is passed a trigger event or it receives a transmission request TR, which realizes the entry into the transmission. Note that its transmission is primarily a feature of event triggering.

There are three ways to trigger EDMA:

1, the most important through external events to trigger a TR;

2. Trigger another interlock trigger mode after completion of a specified transmission;

3, CPU trigger, through the event set register ESR write number, general tune trial.

The EDMA has 1 D and 2D two modes of transmission. The data of 1D is composed of block-"frame-" element and 2D data is composed of block-"array-" element.

Each peripheral has a register, and the EDMA register is as follows:

eSeL: Sets the mapping relationship between the EDMA event and the channel (some DSP models are fixed mappings);

PQSR: Indicates the state, indicating whether the transmit register is empty at each priority level;

CIPR: Indicates the channel interrupt pending state;

CIER: To enable or shield the channel to interrupt;

CCER: To enable or shield the channel chain;

ER: Represents a state that represents a captured event;

EER: Enable or mask every event in ER;

ECR: Clears events that have been triggered;

ESR: Triggers a transfer request.

There is also a very important channel parameter ram, usually called Param, including the OPT channel option parameter, SRC source address parameter, DST destination address parameter, CNT, IDX, Rld, and so on. This register is explicitly configured in the program, and unlike the previous ones, it should all be written in the CSL function.


The process of the program I explained by an example. This instance will be implemented when the FIFO is full, triggering EDMA to read the FIFO data via emif-"EDMA into memory.

Hardware, note the FIFO and DSP EMIF interface connection, especially to the FIFO full signal and DSP external interrupt pin connected, so full signal can be used as external GPIO trigger interrupt.

Software programming is divided into the following parts:

1. Initialization part:

(1) the initialization of CSL;

(2) Initialization of interrupt registers, such as setting interrupt vectors, first prohibiting all interrupt sources, etc.;

(3) Emif initialization, that is, function Emif_config (&myconfig), in which the MYCONFIG structure is configured according to EMIF knowledge points.

2. Set EDMA Interrupt:

void Irq_map (Uint32 eventid,int intnumber);//Bind interrupt event and interrupt number

For a EDMA interrupt number of 8, it should be written (the interrupt number depends on the model):

Irq_map (edmaint,8);

3. Configure and open the EDMA channel:

(1) The register should be emptied and the interrupt should be disabled before configuration:

Edma_clearpram (0x00000000);

Emda_intdisable (7);//gpio external trigger event, so the event number can be 7, corresponding to the Gpio event 7/External Interrupt 7

(2) Open channel return handle: Edma_handle edma_open (int chanum,uint32 flags);

The first parameter is the event number of the channel setting, the second parameter is unified to Edma_open_reset, and a series of initialization work.

Because this is the GPIO external trigger event, the event number is 7 and is therefore written as:

HEdma7 = Edma_open (Edma_cha_extint7,edma_open_reset);

(3) configuration EDMA, through the structure of the body.

Note that this configuration function requires a handle and struct two parameters: void Edma_config (Edma_handle hedma,edma_config *config);

Then you need to configure the structure, a total of opt, SRC, DST, CNT, IDX, Rld six registers, formatted with the EMIF configuration format.

(4) enable the EDMA transmission to end the interrupt, allowing the end of a single transmission to produce an interrupt.

Edma_intenable (7);

(5) Enable the transmission channel of EDMA event number and enable EDMA transmission.

Edma_enablechannel (HEDMA7);

Irq_enable (Edmaint);

4. You can write an interrupt service program to indicate what happens when an interrupt occurs.

Edma_inthandler edma_inthook (int tccnum,edma_inthandler funcaddr);

For example, this example can be written as: Edma_inthook (7,myled) {}

Note that this program is implemented by the interrupt handler function, that is, what to do after the EDMA transfer is completed, and the transmission process is automatically completed by event triggering, without the display of read and write.


Note that the order of the entire program flow is very EDMA, to interrupt the set-up process, are first initialized-"Prohibit big interrupt-" Prohibit small interrupt-"set map, etc.-" open small interrupt-"the order of opening large interrupts." You should also pay attention to the wording of the interruption.


There are still a lot of questions for EDMA, such as:
1, in the actual configuration EDMA time only explicitly configured Param, and others did not see. Although it is obvious that some CSL functions are definitely set for a certain bit of a register, it is not certain that this is true.

2, the previous section of the EMIF program does not use the EDMA, is not to show that its read and write is through the CPU, need to take the address to fetch data.

Wait a minute.


Expansion: When multiple sets of EDMA are required, multiple sets of param need to be defined, and the last parameter of each group linkaddress to another param, like the structure of a linked list. The entire program is used in the form of arrays and for loops, refer to the document "EDMA use Details".


Add: See the function of software triggering EDMA in another place: Edma_setchannel (...)




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.