Hi,
I'm trying to use Emios PWM (OPWMB mode) and feed them with DMA. I have set up a test application that has two DMA buffers configured in scatter gather mode. When the first one is finished playing, the second one is being played. Right now, I don't update the buffers but in the final application, while a buffer is being played, the other one will get updated and buffers will be played in loop.
I'm using S32 Design Studio 3.5 and S32K3XX Real-Time Drivers AUTOSAR R21-11 Version 5.0.0.
I've set up the DMA channel 0 in scatter gather mode with 2 elements (2 buffers of 128 elements each). The source is a buffer of int16 therefore the "source signed offset" is set to 2 and "transfer size" is also set to 2. The destination is an Emios register (IP_EMIOS_0->CH.UC[1].B) therefore, the "destination signed offset" is set to 0 and "transfer size" is set to 2. Since the source buffers have 128 elements, the "source last address adjustment" is set to -256 (128 * sizeof(int16)).
The PWM is set to trigger a DMA request (Flag Event response -> EMIOS_PWM_IP_DMA_REQUEST).
I've attached my test application which runs on a S32K312EVB-Q172 board. Right now, the buffers don't play in a loop, they should be played only once but they are not being played at all. I check with an oscilloscope and I don't see the PWM duty cycle changing
My question is how to configure the DMAMUX to link Emios PWM with DMA channel 0? I don't see where I can configure this. Is it even possible what I'm trying to do? If not, do you have another solution to propose?
Thanks for your help!
Hugo