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

Thread: WS2812SERIAL error with DMAChannel.h

  1. #1
    Junior Member
    Join Date
    Jul 2019
    Posts
    11

    WS2812SERIAL error with DMAChannel.h

    Hello PJRC,

    I am experiencing a DMAChannel.h error while using PJRC product WS2812Serial open source code. Uploading with Arduino IDE 1.8.13 to a Adafruit Qt Py (SAMD21). Data out connected from TX / A6 / D6 - Transmit (output) for Serial1 to the Data in WS2812 LED strip.

    Here is the open source code with the DMAChannel.h error message pasted below:

    /* WS2812Serial BasicTest Example

    Test LEDs by turning then 7 different colors.

    This example code is in the public domain. */

    #include <WS2812Serial.h>

    const int numled = 64;
    const int pin = 6;

    // Usable pins:
    // Teensy LC: 1, 4, 5, 24
    // Teensy 3.2: 1, 5, 8, 10, 31 (overclock to 120 MHz for pin 8)
    // Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48
    // Teensy 3.6: 1, 5, 8, 10, 26, 32, 33
    // Teensy 4.0: 1, 8, 14, 17, 20, 24, 29, 39
    // Teensy 4.1: 1, 8, 14, 17, 20, 24, 29, 35, 47, 53

    byte drawingMemory[numled*3]; // 3 bytes per LED
    DMAMEM byte displayMemory[numled*12]; // 12 bytes per LED

    WS2812Serial leds(numled, displayMemory, drawingMemory, pin, WS2812_GRB);

    #define RED 0xFF0000
    #define GREEN 0x00FF00
    #define BLUE 0x0000FF
    #define YELLOW 0xFFFF00
    #define PINK 0xFF1088
    #define ORANGE 0xE05800
    #define WHITE 0xFFFFFF

    // Less intense...
    /*
    #define RED 0x160000
    #define GREEN 0x001600
    #define BLUE 0x000016
    #define YELLOW 0x101400
    #define PINK 0x120009
    #define ORANGE 0x100400
    #define WHITE 0x101010
    */

    void setup() {
    leds.begin();
    }

    void loop() {
    // change all the LEDs in 1.5 seconds
    int microsec = 1500000 / leds.numPixels();

    colorWipe(RED, microsec);
    colorWipe(GREEN, microsec);
    colorWipe(BLUE, microsec);
    colorWipe(YELLOW, microsec);
    colorWipe(PINK, microsec);
    colorWipe(ORANGE, microsec);
    colorWipe(WHITE, microsec);
    }

    void colorWipe(int color, int wait) {
    for (int i=0; i < leds.numPixels(); i++) {
    leds.setPixel(i, color);
    leds.show();
    delayMicroseconds(wait);
    }
    }

    Here is a copy of the error message:

    Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Adafruit QT PY (SAMD21), Small (-Os) (standard), Arduino, Off"

    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\jlcel\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\jlcel\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\jlcel\Documents\Arduino\libraries -fqbn=adafruit:samd:adafruit_qtpy_m0pt=small,usbstack=arduino,debug=off -vid-pid=239A_80CB -ide-version=10813 -build-path C:\Users\jlcel\AppData\Local\Temp\arduino_build_94 9448 -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS.path=C:\Users\jlcel\AppD ata\Local\Arduino15\packages\adafruit\tools\CMSIS\ 5.4.0 -prefs=runtime.tools.CMSIS-5.4.0.path=C:\Users\jlcel\AppData\Local\Arduino15\ packages\adafruit\tools\CMSIS\5.4.0 -prefs=runtime.tools.bossac.path=C:\Users\jlcel\App Data\Local\Arduino15\packages\arduino\tools\bossac \1.8.0-48-gb176eee -prefs=runtime.tools.bossac-1.7.0-arduino3.path=C:\Users\jlcel\AppData\Local\Arduino 15\packages\arduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=C:\Users\jlcel\AppData\Local\Arduino 15\packages\arduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\jlcel\AppData\Local\Arduino15\pa ckages\adafruit\tools\arm-none-eabi-gcc\9-2019q4 -prefs=runtime.tools.arm-none-eabi-gcc-9-2019q4.path=C:\Users\jlcel\AppData\Local\Arduino15 \packages\adafruit\tools\arm-none-eabi-gcc\9-2019q4 -prefs=runtime.tools.openocd.path=C:\Users\jlcel\Ap pData\Local\Arduino15\packages\arduino\tools\openo cd\0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=C:\Users\jlcel\AppData\Local\Arduino 15\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\jlcel\AppData\Local\Arduino15\ packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=C:\Users\jlcel\AppData\Local\Arduino15\ packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.arduinoOTA.path=C:\Users\jlcel \AppData\Local\Arduino15\packages\arduino\tools\ar duinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\jlcel\AppData\Local\Arduino15\ packages\arduino\tools\arduinoOTA\1.2.1 -verbose C:\Users\jlcel\AppData\Local\Temp\arduino_modified _sketch_438503\BasicTest.ino

    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\jlcel\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\jlcel\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\jlcel\Documents\Arduino\libraries -fqbn=adafruit:samd:adafruit_qtpy_m0pt=small,usbstack=arduino,debug=off -vid-pid=239A_80CB -ide-version=10813 -build-path C:\Users\jlcel\AppData\Local\Temp\arduino_build_94 9448 -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS.path=C:\Users\jlcel\AppD ata\Local\Arduino15\packages\adafruit\tools\CMSIS\ 5.4.0 -prefs=runtime.tools.CMSIS-5.4.0.path=C:\Users\jlcel\AppData\Local\Arduino15\ packages\adafruit\tools\CMSIS\5.4.0 -prefs=runtime.tools.bossac.path=C:\Users\jlcel\App Data\Local\Arduino15\packages\arduino\tools\bossac \1.8.0-48-gb176eee -prefs=runtime.tools.bossac-1.7.0-arduino3.path=C:\Users\jlcel\AppData\Local\Arduino 15\packages\arduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=C:\Users\jlcel\AppData\Local\Arduino 15\packages\arduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\jlcel\AppData\Local\Arduino15\pa ckages\adafruit\tools\arm-none-eabi-gcc\9-2019q4 -prefs=runtime.tools.arm-none-eabi-gcc-9-2019q4.path=C:\Users\jlcel\AppData\Local\Arduino15 \packages\adafruit\tools\arm-none-eabi-gcc\9-2019q4 -prefs=runtime.tools.openocd.path=C:\Users\jlcel\Ap pData\Local\Arduino15\packages\arduino\tools\openo cd\0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=C:\Users\jlcel\AppData\Local\Arduino 15\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\jlcel\AppData\Local\Arduino15\ packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=C:\Users\jlcel\AppData\Local\Arduino15\ packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.arduinoOTA.path=C:\Users\jlcel \AppData\Local\Arduino15\packages\arduino\tools\ar duinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\jlcel\AppData\Local\Arduino15\ packages\arduino\tools\arduinoOTA\1.2.1 -verbose C:\Users\jlcel\AppData\Local\Temp\arduino_modified _sketch_438503\BasicTest.ino

    Using board 'adafruit_qtpy_m0' from platform in folder: C:\Users\jlcel\AppData\Local\Arduino15\packages\ad afruit\hardware\samd\1.6.4

    Using core 'arduino' from platform in folder: C:\Users\jlcel\AppData\Local\Arduino15\packages\ad afruit\hardware\samd\1.6.4

    Detecting libraries used...

    "C:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\tools\\arm-none-eabi-gcc\\9-2019q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"BasicTest.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10813 -DARDUINO_QTPY_M0 -DARDUINO_ARCH_SAMD -DCRYSTALLESS -DADAFRUIT_QTPY_M0 -D__SAMD21E18A__ -DARM_MATH_CM0PLUS -DUSB_VID=0x239A -DUSB_PID=0x80CB -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"QT Py M0\"" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -Os -DCRYSTALLESS -DADAFRUIT_QTPY_M0 -D__SAMD21E18A__ -DARM_MATH_CM0PLUS -DUSB_VID=0x239A -DUSB_PID=0x80CB -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"QT Py M0\"" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\tools\\CMSIS\\5.4.0/CMSIS/Core/Include/" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\tools\\CMSIS\\5.4.0/CMSIS/DSP/Include/" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\arduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\variants\\q tpy_m0" "C:\\Users\\jlcel\\AppData\\Local\\Temp\\arduino_b uild_949448\\sketch\\BasicTest.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

    Alternatives for WS2812Serial.h: [WS2812Serial-master]

    ResolveLibrary(WS2812Serial.h)

    -> candidates: [WS2812Serial-master]

    "C:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\tools\\arm-none-eabi-gcc\\9-2019q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"BasicTest.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10813 -DARDUINO_QTPY_M0 -DARDUINO_ARCH_SAMD -DCRYSTALLESS -DADAFRUIT_QTPY_M0 -D__SAMD21E18A__ -DARM_MATH_CM0PLUS -DUSB_VID=0x239A -DUSB_PID=0x80CB -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"QT Py M0\"" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -Os -DCRYSTALLESS -DADAFRUIT_QTPY_M0 -D__SAMD21E18A__ -DARM_MATH_CM0PLUS -DUSB_VID=0x239A -DUSB_PID=0x80CB -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"QT Py M0\"" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\tools\\CMSIS\\5.4.0/CMSIS/Core/Include/" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\tools\\CMSIS\\5.4.0/CMSIS/DSP/Include/" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\arduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\cores\\ardu ino" "-IC:\\Users\\jlcel\\AppData\\Local\\Arduino15\\pack ages\\adafruit\\hardware\\samd\\1.6.4\\variants\\q tpy_m0" "-IC:\\Users\\jlcel\\Documents\\Arduino\\libraries\\ WS2812Serial-master" "C:\\Users\\jlcel\\AppData\\Local\\Temp\\arduino_b uild_949448\\sketch\\BasicTest.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

    Alternatives for DMAChannel.h: []

    ResolveLibrary(DMAChannel.h)

    -> candidates: []

    In file included from C:\Users\jlcel\AppData\Local\Temp\arduino_modified _sketch_438503\BasicTest.ino:7:

    C:\Users\jlcel\Documents\Arduino\libraries\WS2812S erial-master/WS2812Serial.h:28:10: fatal error: DMAChannel.h: No such file or directory

    28 | #include "DMAChannel.h"

    | ^~~~~~~~~~~~~~

    compilation terminated.

    Using library WS2812Serial-master in folder: C:\Users\jlcel\Documents\Arduino\libraries\WS2812S erial-master (legacy)

    exit status 1

    Error compiling for board Adafruit QT PY (SAMD21).





    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,116
    My guess is it is very unlikely that this will ever work on a different platform such as SAMD21...

    The code is setup to directly talk to the hardware registers for the different Teensy LC, 3.x and T4 boards.
    The Github page shows the c

    However that is not to say someone could not make a version of this work with the a different platform like the SAMD, it is just I would guess that it would require someone interested in the other platform to do do the work and maybe Paul might take a Pull Request... But again I am just guessing.

  3. #3
    Junior Member
    Join Date
    Jul 2019
    Posts
    11
    I was using it with my Teensy 4.0 and other Arduino boards, and it worked great! I am experimenting with the SAMD21 for a very small project. I posted in this forum because the github WS2812Serial issues Paul guides to post here regarding this code. I am not sure how to make a Pull Request, but it sounds like that is what is needed for this to every work. How do I make a Pull Request?

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,116
    Quote Originally Posted by LEDLI! View Post
    I was using it with my Teensy 4.0 and other Arduino boards, and it worked great! I am experimenting with the SAMD21 for a very small project. I posted in this forum because the github WS2812Serial issues Paul guides to post here regarding this code. I am not sure how to make a Pull Request, but it sounds like that is what is needed for this to every work. How do I make a Pull Request?
    The idea is that you (or someone), creates a fork the github project and make the changes needed to make the code work (I typically do in a new branch) and then you then push up your changes to your fork of the github project and when you are happy with those changes, you create a Pull Request back to the "Upstream" fork (i.e. the master project) that forked from. And if the Owner of that library likes the changes They can accept that request and merge those changes in.

    The real question would be is there someone who understands the SAMD processor well enough including their DMA setup as well as their Serial ports to make it work. I am not much help here as I don't have any of the boards nor the underlying knowledge of those chips.

    But you might get lucky and someone else here does.

  5. #5
    Junior Member
    Join Date
    Jul 2019
    Posts
    11
    Update,

    Now I am getting the DMAChannel.h error with an Arduino Nano. Can anyone help me with this?

  6. #6
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,325
    A Nano has DMA?!?

    Just use a Teensy to fix this error..

  7. #7
    Junior Member
    Join Date
    Jul 2019
    Posts
    11
    Thank you. I see now. No DMA with Nano.

  8. #8
    Junior Member
    Join Date
    Jul 2019
    Posts
    11
    When using my Teensy 4.0, if I have more than 70 LED's and using FastLED to control them, the LED's flicker. Actually, the LED's flicker with other controllers too, if I have more than 70 LED's. Is that normal?

    That's why I include WS2812SERIAL because it fixes the flickering. I am wondering if there is another problem I don't yet see.

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,224
    Try this:

    Code:
    #define FASTLED_ALLOW_INTERRUPTS 0
    #include <FastLED.h>
    The FASTLED_ALLOW_INTERRUPTS define must come before including FastLED.h, otherwise it has no effect.

    This advice is specific to Teensy. For Arduino Nano or Adafruit's products, ask on the Arduino or Adafruit forums.

  10. #10
    Junior Member
    Join Date
    Jul 2019
    Posts
    11
    The original question was in regards to the WS2812SERIAL library Non-Blocking WS2812B / NeoPixel LEDs Library with SAMD21. Will the SAMD21 be included in the WS2812SERIAL library any time soon or is it only for Teensy products.?

  11. #11
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,325
    It is for Teensy only.

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,224
    Quote Originally Posted by LEDLI! View Post
    Will the SAMD21 be included in the WS2812SERIAL library any time soon
    No, SAMD will never be supported by WS2812Serial.

    Again, for Arduino Nano or Adafruit's products, ask on the Arduino or Adafruit forums.

Posting Permissions

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