Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: DMA - Masked writes?

  1. #1
    Junior Member
    Join Date
    Nov 2018
    Posts
    3

    DMA - Masked writes?

    Is it possible to cause each write of a DMA operation to be masked to only affect certain bits in the destination instead of entire bytes at a time? I've looked in the processor documentation and couldn't find anything to suggest functionality exists to support this.

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,773
    No. The bitband feature can help, maybe. I think it can be used with DMA too, but I'm not sure and have not tried it.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,691
    I'm also curious to hear if DMA to the bitband works. I'm going to guess the answer will be no, since the bitband is implemented inside the ARM core.

    Likewise, I've occasionally wondered if DMA can access stuff on the ARM private peripheral bus inside the ARM code (all the addresses that begin 0xE...), but never bothered to actually test it.

    One other thing to remember is the bitband is a M4-only feature. I already miss is greatly when working with the new M7 chip.
    Last edited by PaulStoffregen; 11-19-2018 at 12:14 PM.

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,773
    Ok, at least on a MK60 it does NOT work:
    https://community.nxp.com/thread/447766

  5. #5
    Junior Member
    Join Date
    Nov 2018
    Posts
    3
    Thanks for the responses! I'm using a Teensy 3.6, so I'll give it a shot when I have a chance and let you know the results.

  6. #6
    Junior Member
    Join Date
    Nov 2018
    Posts
    3
    Unfortunately, it doesn't appear that it's possible to DMA write to the bitband region. Not only did my actual attempts all fail, but I think the documentation tells us that directly:
    System 32-bit Address Range: 0x4200_00000x43FF_FFFF
    Destination Slave: Aliased to AIPS and GPIO bitband
    Access: Cortex-M4 core only

    The "Access" section shows "All masters" and specifically "DMA" for other memory regions.

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,098
    I clicked Frank's link - one of the links on that page was :: Kinetis MK66, DMA to read GPIO

    No simple answer and it quickly runs to uTasker and other dev tools for any attempt at a solution. Not sure if it offers any useful info … or if that question from Luis there somehow is PJRC's Anythony as it seems similar in focus and timing ...

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,691
    DMA to the GPIO pin set, clear & toggle registers definitely does work. Maybe not as convenient as the bitband for certain things. Also only a solution for GPIO output, not a general way to access all peripheral registers like the bitband.

  9. #9
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,773
    The VGA Output by qix67 uses DMA to GPIO and is awesome - runs entirely "in hardware". Impressive, what is possible with DMA.
    https://forum.pjrc.com/threads/45916...3-6-VGA-driver
    ...just by configuring some registers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •