2411131_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2411131_en-US

2411131_en-US

Timer triggers DMA transfer

Hello,

I'm currently working with an MCXN947 microcontroller.

I'm trying to trigger a DMA transfer into a sample buffer via a CTIMER match interrupt.

The idea is to write into the sample buffer the state of a GPIO register (specifically the input values of some pins) via DMA at every x timer intervals (specifically every 10 us).

I can confirm that my GPIO pin is correctly configured as an input.

I can confirm that my timer is working correctly and triggering a match at every 10 us.

I can confirm that my DMA transfers are working correctly because the buffer gets filled up with values.

I can confirm that the source address (GPIO PDIR reg) is correctly set in the DMA configuration.

I can confirm that my destination address is also correctly set in the DMA configuration as it is always in between the start and end address of my buffer (meaning it increments and wraps around correctly).

But for some reason, the wrong values are being copied into the buffer. I can see in my debugger that the value of the register I'm trying to transfer is 0x00020000 (pin 17 is high, the rest are low). However, my buffer is only being filled with 0s. It's a uint32_t type buffer of 512 elements initialized all at 0xFF. As the DMA transfers increment, the whole buffer progressively gets filled with 0x0 and not the expected value of 0x00020000 (which never changes - pin 17 is always high).

Do you have any idea what causes this? Or if I'm possibly missing something?

Here are my driver configurations:

Timer:
CTIMER0
kCTIMER_Match_1
CTIMER0_IRQn (triggering callback on interrupt is optional but I use it in my code for debugging purposes)

DMA:
DMA0
kDma0RequestMuxCtimer0M1
kINPUTMUX_Ctimer0M1ToDma0Ch8Ena
EDMA_0_CH8_IRQn (triggering callback on interrupt is optional but I use it in my code for debugging purposes)

GPIO:
GPIO3
PORT3
Pin 17

Here are the states of the registers right before I start sampling

reg_gpio3.pngreg_gpio3.pngreg_gpio3.pngreg_gpio3.pngreg_gpio3.pngreg_gpio3.pngreg_port3.pngreg_port3.pngreg_port3.pngreg_port3.pngreg_port3.pngreg_port3.pngreg_edma0_ch8.pngreg_edma0_ch8.pngreg_edma0_ch8.pngreg_edma0_ch8.pngreg_edma0_ch8.pngreg_edma0_ch8.pngreg_inputmux0_dma.pngreg_inputmux0_dma.pngreg_inputmux0_dma.pngreg_inputmux0_dma.pngreg_inputmux0_dma.pngreg_inputmux0_dma.pngreg_inputmux0_timer.pngreg_inputmux0_timer.pngreg_inputmux0_timer.pngreg_inputmux0_timer.pngreg_inputmux0_timer.pngreg_inputmux0_timer.pngreg_ctimer0.pngreg_ctimer0.pngreg_ctimer0.pngreg_ctimer0.pngreg_ctimer0.pngreg_ctimer0.png


 

 

 

 

 

 

MCXNRe: Timer triggers DMA transfer

Hello @jabitbe2_jcplc 

Could you please share your project with us? I would like to try to reproduce the issue and investigate it on my side.

Thank you.

Best Regards,
Alice

Re: Timer triggers DMA transfer

Hello,

Due to IP I cannot send you my whole project. However, I can give you a c file that contains my setup in a little application. The GPIO, DMA and TIMER configurations are the same I have on my side. The file is in attachment.

Re: Timer triggers DMA transfer

Hello @jabitbe2_jcplc 

The MCXN947 supports TrustZone and security attribution control.

If the access originates from a security domain that does not match the pin's security configuration, read and write operations to the corresponding GPIO registers may be ineffective.

Could you please verify whether the GPIO3 Pin 17 corresponding bit is configured to allow Non-Secure access and test again?

If the bit is currently configured as Secure-only, the unexpected GPIO behavior may be related to the TrustZone security settings.


Thank you.

BR

Alice

タグ(1)
評価なし
バージョン履歴
最終更新日:
昨日
更新者: