Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE
Hi there,
We are still working on integrating ethercat slave stack code (SSC) with our motor servo control.
The SSC has 2 parts:
(1) receiving interrupt from ethercat slave controller (ESC) for cyclic data exchange
(2) infinite loop function in main for one time data transfer.
Both parts will communicate with ESC via EMIF.
We are worried with the following scenario. Let say 16bit EMIF for async ram, If (2) is half way of an r/w operation (e.g. reading an int array with for loop) and there is an interrupt from (1).
My question is:
(a) Will (2)'s r/w be suspended or corrupted? (by corrupt I mean like when SPI r/w who must have atomic access or the operation will be meaningless)
(b) Which r/w operation from (1) or (2) will be prioritized?
My guess:
(guess for a) Won't corrupt, CPU will finished the current 16 bit r/w, suspend (2), run (1)'s ISR, then resume with what's in (2)
(guess for b) based on (guess for a), CPU will prioritize (1)'s operation
Which my guess is based on TMS320F2837xD reference manual and this post e2e.ti.com/.../685593. I understnad this post was asking something quite similar but it is on sync ram. I would like to know do async ram work the same way?
Also we are concerned because in SSC's hardware abstraction layer, r/w functions for (1) and (2) to ESC are separated. All r/w function for (2) will disable interrupt first before the actual operation. This make sense for SPI but if (guess for a) and (guess for b) are true why same treatment EMIF then?
Additionally I have also consider using CLA or DMA. But I imageine there will be the following difficulties, please correct me if I am wrong:
(CLA) CLA's program need to occupy a whole LSx ram, data though can be mixed with CPU's program/data in other LSx RAM. But we are already running low on LSx RAM.
(DMA) DMA can only access GSx RAM, but CPU's program & data reside in LSx RAM. So even DMA do the EMIF r/w, there need to be an buffer on GSx ram. CPU need to do another r/w itself to copy the result to/from LSx RAM
Based on my concern with (CLA) and (DMA), I have also consider moving some of the sections in link cmd file to GSx RAM, by doing so:
(consq for CLA) can spare a LSx RAM for CLA's program
(consq for DMA) DMA can directly access CPU program's data?
Is this possible? Even if so will there be any adverse effect (e.g. slower perofrmance)? Since in controlSUITE, none of the link cmd file utilize GSx RAM (beside the DMA example) which seems like a waste for such big chunk of memory. Also I am having a hard time decipheriing the meaning of different sections in link cmd file, where can I look for related info?
Thanks for reading. Any reply is appreciated :D