Hi, Alice-san;
Almost one month, no supporting reply from NXP TechSupport staffs...
I got a very little progress, but not yet solved by question and problems around DMA usage in LPC865.
In the follwing report, I put MY understanding and comments around DMAC in LPC8xx serise DMAC. If I'm wrong, any corrections and commets are very welcome.
Before describing DMA and Bus performance issues, I found some in the other area in LPC865.
○SPI transfer clock
To have 13.3Mbps ( a little bit faster than I3C ) by SPI Tx, I tried to set dividing elements feeding clock to SPI. 13.3MHz is 120MHz/9, I'd done also LPC845.
When I watch the SPI1.SCK, I found very narrow SCK clock on LPC865.
Also found that the contiguous SPI Tx (MOSI output) by DMA occasionally missing.
At first, I doubt some DMA management condition change in LPC865 causes this.
But, I found the other reasons seen only on LPC865, not in LPC845.
Following is a close-up around LPC865's SPI clock source path.
"PLL Divider" is newly placed before the path to FRG.

I initially set SYSPLLDIV as just 1/1 .
Because my reference implemetation on LPC845, this element was NOT implemented in LPC845. So, 1/9 dividing was done by FRG and worked on LPC845.
But when I watched narrow duty SPI1.SCK wave form on LPC865, I tried to employ this PLL Divider to have 1/9 from PLL output.
When I set 1/3 for PLL divider and another 1/3 division inside FRG, SPI MOSI and SCK output are working seamlessly contiguous as I expected. DMA is employed for SPI Tx with endless Ping-Pong loop scenario.
So, this would be one of the hidden causes that I could NOT get 13.3Mbps SPI Tx.
I guess several small points changed in LPC865 are meaningfull by SOME reasons in LPC865. But, at the same time, SOME other changes considered "risk-less" might effect unexpectedly worse...
After above changes, I could confrim SPI Tx seamlessly driven by DMAC (only by itself) really works.
As the next step, tried to add some other DMA events with DMA channels.
As one of them I've been trying to the MUX'ed trigger event from FTM.
To have cascaded PWM timer behavor only by employing single FTM,
Another DMA channel triggered by FTM's INIT_TRIG, update its SWOCTRL, update sequence is pre-coded table in Flash ROM, by self-linked descriptor for endless behavior.
The destination SWOCTRL register in FTM is NOT on the APB where SPI is located but on AHB ( then via AIPS-Lite bridge) By employing SWOCTRL register, unused FTM output can be used like a DMA-driven GPIO.
I set the FTM's PWM cycle (by its MOD register) as 22 * 16 SPI bit time.
One PWM output is let FTM to generate by itself and another virtually-cascaded PWM output wave from is generated as the result of update sequence of its SWOCTRL register.
SPI is set in 16bit framing RXIGNORE for Tx-Only. endless circular Ping-pong scenario crosslinked descriptor sets; Asynmetric 16 Tx and 6 Tx for easy distinguish of by-Ping / by-Pong from the MOSI wave form with FTM-related PWM output signals
With the CNTIN.INIT value set as 0, FTMx_INIT_ITRIG is connected thru DMA_ITRIG_INMUX[n] to free DMA channel n with no dedicated peripheral hardware request enabled, only by hardware trigger from DMA_ITRIG_MUX[n].
Let me confirm trig/req for DMAC (commonly to LPC-8xx serise).
One is from SPI Tx hardware REQUEST to its dedicated DMA channel.
("REQUEST" is basically level-sensitive, acknowledge signal from DMAC may clear it internally)
The other is a TRIG event signal from FTM.
TRIG is basically a edge-sensitive, no acknowledge is required from DMAC.
User manulas published from NXP sometimes do not explain those clearly, a little bit fuzzy and confusing....
If my understandng about those is wrong, please correct --> To NXP TechSupport staffs.
Anyway, I then tried to employ two DMA channels; one by REQUEST and nother by TRIG.
Regarding those occerence, 22 times of REQUEST from SPI Tx occur during one TRIG interval rom FMT.
In case where multiple DMA channels (requests/triggers) are employed, the priority setting of each channel is to be carefully set with the othres',
Here, I would like to ask to NXP TechSupport and confirm.
To proseed implementation design above, explanation for "TRIGTYPE" field in DMA channel configuration should be read carefully.
But, as far as I've tested in LPC8xx serise DMAC, the explanation seen there seems to be opposite each other...
When I employ Timer-related event(essentially an edge-trigger signal in nature), I need to set that field as a "1" to get expected behavor in LPC8xx. On the other hands, when I employ peripheral request, I need to set "0".
I've been believing this issue is already well-known among LPC8xx custommers....Am I wrong?
Going back to DMA usage with FMT and SPI issue...
The occurence ratio is 1:22.
SPI Tx has one-frame-deep buffer before shift-register portion of SPI peripheral inside. As I set 16bit framing for SPI, LPC865 system running at 60MHz core/AHB clock, this time depth would be (1/13.3Mbps)*16 --> 1.2us --> 73.4 AHB cycles.
Here, I need precise number of cycles that one DMA transfer consumes.
During this 73 AHB cycle period, I need to complete at least two DMA trarnsfers; each of them is just a single transfer, not burst.
Regarding priority, if I expect less-jitter on pseudo cascaded PWM done by SWOCTRL write access by DMA triggered from FTM, I think priority for thet DMA channel must be higher than that of the DMA channel working to SPI Tx.
I do NOT think that 73 AHB cycles is hopeless value for two DMA channel acitivities.
But, unfortunately, I could not get acceptable result....
Then, what are observed ?
SPI Tx MOSI and SCK signals are good as expected. No extra slack time, small-enough jitter etc... When I observe with PWM generated by purely by FTM, the time relation among them are stablly constant.
But, for SWOCTRL-ed pseudo PWM output done by another DMA channel is sometimes, somehow missing or almost no signal flip observed on the pin...
Even the DMA priority for that is set higher...
I remember that the priority field in LPC845 is three bit long, not two bit as LPC865.
So, I guess some modifications are also made around or inside DMAC of LPC865, its priority arbitration logic as well... .
Additionally, in order to get hits of causes for this behavior, I intensionally set none-ZERO DIVVAL in SPI peripheral. Doing this reduces the occurence of the DMA request from SPI Tx less frequently.
The result are....
When I set that larger DIVVAL than 0x15, I could observe the closer PWM wave frequency as expected.
But, if DIVVAL is equal or less than 0x15, pseudo PWM wave is no longer observed.
From those results, I guess that if the request trigger timing from FTM conflicts with the request level pulse from SPI Tx, the fact that FTM trigger issued is completely ignored. The more often conflict, the longer interval seen on preudo PWM output signal.
I understand these results very serious at this moment.
ITRIG-type event signaling MAY always ignored/lost by any dedicated REQUESTs from pre-wired peripherals.
Probably, something is wrong in my understandings and trial methods and conditions.
If anyone of you TechSupport team find some, let me correct.
Regards,