MSPM0G3507: DMA write GPIO failure

Part Number: MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG

Hello,

When I try to write GPIO via DMA, after official init SYSCONFIG_WEAK void SYSCFG_DL_DMA_init() I have also:

    DL_GPIO_enableDMAAccess(GPIOA, DL_GPIO_PIN_3);     
    DL_DMA_setSrcAddr(DMA, DMA_CH0_CHAN_ID, (uint32_t)&gPA3_CLR);
    DL_DMA_setDestAddr(DMA, DMA_CH0_CHAN_ID, (uint32_t)&GPIOA->DOUTCLR31_0);

In advanced it has been confirmed that DMA0 work correctly for data transfer by replaced src/dest address with pre-set fixed addr. to fixed addr. at least the DMA trigger happened and static src data(0x12345678) been transfered to dest(printout to check) successfully, just not sure the DMA 'repeat single' setting correct or not cause static data used to verify the data transfer, maybe it just transfer for only once.  should i use fill data extend mode or block to block mode, or any other more missed please help.

Thanks

  • As far as I know, the DMA can only write to DOUT31_0, and can't read from any of the GPIO registers. TRM (SLAU846C) says "The GPIO peripheral allows the DMA write-access to the DOUT31_0 register." and others on the Forum have observed that it means Precisely that.

    See also:  MSPM0L1306: DMA GPIO Input Source Address Error 

  • This answer is of no help.

    TRM and those mentioned and did not mentioned DMA threads in E2E have been reviewed before asking the question.

    Confirmed software can write PA3 high/low correctly before DMA code snippet running,nothing say GPIO 'read'.

    Anybody else can help? for this general issue. thanks.

  • Hi,

    If you simply want to use DMA to transfer 32-bit data to another location, then the signal mode with Fixed. Add to Fixed. Add is sufficient, as it will only perform the transfer once. It depends on your specific needs.

    Back to the GPIO with DMA, as Bruce has mentioned, DMA can only write, "read" is not allowed for DMA to access GPIO, which is described in the E2E Bruce shared.

    Zoey.

  • The TRM says you can write to DOUT31_0 [Ref TRM (SLAU846C) Sec 9.2.5]. The code you posted is writing to DOUTCLR31_0.

  • Yeah tried different addressing mode got same result. 

    Regards

  • If consider more you may know its not feasible way to use DOUT31_0 register to 'clear one pin' by DMA transfer, bitwise operation only feasible by lines of code, isn't it?  that's why here code is intended to DOUTCLR31_0.

  • You can use DMA to control GPIO, but you cannot read the GPIO state via DMA. Hopefully, this clarifies things a bit. 

    For a single pin, you cannot transmit a single bit. Therefore, to control a single pin, you can use DMA to write 32-bit data, but the data will be different between consecutive transfers.