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

Thread: DMAChannel is broken on Teensy LC

  1. #1
    Senior Member
    Join Date
    Jan 2013
    Posts
    843

    DMAChannel is broken on Teensy LC

    DMAChannel is using a packed struct to access the DMA controller registers. GCC will often generate byte accesses for these, which will hang the CPU.

    Fix:
    https://github.com/PaulStoffregen/cores/pull/241

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,894
    Thanks TNI,

    As you know I ran into this.

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,894
    Thought I would mention, I put in a second fix to dmaChannel.h which fixed another problem with it.
    https://github.com/PaulStoffregen/cores/pull/242

    In particular if you called transferCount with the counts: 6, 512, 6
    The first call will set the iterations counters to 6
    Second to 512
    Third to 518

    It is because it was assuming that if < 512 you were using the ELINK version which only has 9 bit length and above it (IF elink is set) was the channel number to link to.

    Well when you call it with 512, it assumes 15 bit format, and so the it stores the 0x200 (512)
    When you then call it with 6, it assumes that the 0x200 bit of previous call is channel and as such just updates the 0x1ff bits of the field...

Posting Permissions

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