JulesvanHoren (Customer) asked a question.

Unkown USB device when connecting the P1AM-100

I installed the board manager en libraries of the P1AM-100 and it worked for a few hours.

Suddenly after installing an other library (Adafruit_NeoPixel_ZeroDMA + a few others which it needed) the port in the arduino IDE got grey. I checked in my device manager and it said: "unknown usb device (device descriptor request failed)"

 

I feel like it was just a conincidence that the problems occured after installing the libaries.

Plugging the P1AM-100 in different computers also results into a "USB device not recognized" warning.

 

What I've tried:

I uninstalled everything and re-installed it but it didn't work,

I also tried other cables but no succes.

Windows is up to date.

 

Does anyone have an idea on how to solve this?

 

And could the P1AM-100 be broken already after a few hours? And is there a way to recognize if it's broken?

 

Thanks in advanced!

 

Jules

 

 


  • JulesvanHoren (Customer)

    1. // This is a PARED-DOWN NeoPixel example for the Adafruit_NeoPixel_ZeroDMA
    2. // library, demonstrating pin declarations, etc. For more complete examples
    3. // of NeoPixel operations, see the examples included with the 'regular'
    4. // Adafruit_NeoPixel library.
    5.  
    6. // Also requires LATEST Adafruit_NeoPixel and Adafruit_ZeroDMA libraries.
    7. #include <P1AM.h>
    8. #include <Adafruit_NeoPixel.h>
    9. #include <Adafruit_NeoPixel_ZeroDMA.h>
    10.  
    11. /* DMA NeoPixels work ONLY on SPECIFIC PINS:
    12. Feather M0: pins 5, 6, 12 and MOSI*.
    13. Feather M0 Express: pins 6, 12 and MOSI*.
    14. Feather M4: pins 12, A2, A4 and MOSI*.
    15. ItsyBitsy M0: pins 5, 12 and MOSI*.
    16. ItsyBitsy M4: pins 2, 5, 12 and MOSI*.
    17. Metro M0 or Arduino Zero: pins 5, 12 and MOSI*.
    18. Metro M4: pins 6, 11, A3 and MOSI*.
    19. Metro M4 AirLift: pins 6, 11 and MOSI*.
    20. Grand Central: pins 11, 14, 23 and MOSI*.
    21. HalloWing M0: pins 4 (NEOPIX), 6 and MOSI*.
    22. HalloWing M4: pins 6, 8, A5 and MOSI*.
    23. MONSTER M4SK: pin 2.
    24. PyPortal, PyPortal Titano: pin 3 (SENSE connector).
    25. PyGamer, PyGamer Advance: pins 12 and A4.
    26. PyBadge, PyBadge AirLift: pins A4, MOSI*.
    27. Crickit M0: pins 8, 11, A8 and A11.
    28. Trellis M4: pin 10 (keypad NeoPixels).
    29. Circuit Playground M0: pin A2.
    30. Trinket M0: pin 4 (can't use with I2C, SPI or Serial1 active).
    31. Gemma M0: pin D0 (can't use with I2C, SPI or Serial1 active).
    32. QT Py: MOSI* and pin 16 (underside pad, can't use w/optional SPI flash).
    33. * If using the MOSI pin on these boards, the corresponding SPI
    34. peripheral is not usable.
    35. */
    36.  
    37. #define PIN 6//12
    38. #define NUM_PIXELS 30
    39.  
    40. Adafruit_NeoPixel_ZeroDMA strip(NUM_PIXELS, PIN, NEO_GRB);
    41.  
    42. void setup() {
    43. strip.begin();
    44. strip.setBrightness(32);
    45. strip.show();
    46. }
    47.  
    48. void loop() {
    49. uint16_t i;
    50.  
    51. // 'Color wipe' across all pixels
    52. for(uint32_t c = 0xFF0000; c; c >>= 8) { // Red, green, blue
    53. for(i=0; i<strip.numPixels(); i++) {
    54. strip.setPixelColor(i, c);
    55. strip.show();
    56. delay(50);
    57. }
    58. }
    59.  
    60. // Rainbow cycle
    61. uint32_t elapsed, t, startTime = micros();
    62. for(;;) {
    63. t = micros();
    64. elapsed = t - startTime;
    65. if(elapsed > 5000000) break; // Run for 5 seconds
    66. uint32_t firstPixelHue = elapsed / 32;
    67. for(i=0; i<strip.numPixels(); i++) {
    68. uint32_t pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
    69. strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
    70. }
    71. strip.show();
    72. }
    73. }

    Hi,

    I didn't know yet about this option.

    Thanks for your feedback!

     

    Jules

    Expand Post
    Selected as Best
  • Garry (Customer)

    Hi JulesvanHoren,

    I would try putting your P1AM into bootloader mode.

     

    Quickly double-tapping the reset button will put the board into bootloader mode. This mode is indicated by a "breathing" pattern on the yellow LED. This mode can be used to recover a board that has reached a hard fault due to bad code. Once in this state, the COM port will change so it is required that you select the new COM port from the tools menu and re-upload your code.

    https://facts-engineering.github.io/modules/P1AM-100/P1AM-100.html

     

    If this does not work then try reinstalling the drivers.

    https://facts-engineering.github.io/faqs.html

     

    Just a couple of thoughts.

    Let us know how you make out.

    Regards,

    Garry

     

    https://accautomation.ca/series/productivity-open-arduino-compatible-industrial-controller/

    Expand Post
  • Garry (Customer)

    Note: Not all USB cables are the same. Make sure you are not using a charging cable only.

    This should not be the case because you have indicated that communication has been established before.

    Garry

    • JulesvanHoren (Customer)

      Update it works now!

       

      I've restarted everyting and dubbel tapped the reset button and came back 30 min later and it worked again.

       

      Thanks a lot!

       

      Do you have any idea on what caused it? How can you prevent a "hard fault due to bad code"

       

      Kind regards,

       

      Jules van Horen

      Expand Post
  • JulesvanHoren (Customer)

    Hi Garry,

     

    Thanks a lot for your reaction!

     

    The following appears when going into the "breathing mode"

    The "USB device not recognized" disappears but the IDE gets stuck on uploading.

     

    How do i know when the bootloader is finished? How long should it stay in the bootloading mode?

     

    If I press the reset Button once again then the "USB device not recognized" comes back.

    It seems that currently my laptop is recognizing the module during boatloading only.

     

    Thanks in advanced!

     

    Kind regards,

     

    Jules van Horen

    Expand Post
    • Bootloader connection
  • JulesvanHoren (Customer)

    The following code wil result in "a hard fault due to bad code" it seems.

    How can this be prevented.

    In the

    • Results in faulty code
      • ADC Community_02 (Automationdirect.com)

        Please post your code using the </> code snippet option when creating a post. Then others can copy and paste this into their IDE.

      • JulesvanHoren (Customer)

        1. // This is a PARED-DOWN NeoPixel example for the Adafruit_NeoPixel_ZeroDMA
        2. // library, demonstrating pin declarations, etc. For more complete examples
        3. // of NeoPixel operations, see the examples included with the 'regular'
        4. // Adafruit_NeoPixel library.
        5.  
        6. // Also requires LATEST Adafruit_NeoPixel and Adafruit_ZeroDMA libraries.
        7. #include <P1AM.h>
        8. #include <Adafruit_NeoPixel.h>
        9. #include <Adafruit_NeoPixel_ZeroDMA.h>
        10.  
        11. /* DMA NeoPixels work ONLY on SPECIFIC PINS:
        12. Feather M0: pins 5, 6, 12 and MOSI*.
        13. Feather M0 Express: pins 6, 12 and MOSI*.
        14. Feather M4: pins 12, A2, A4 and MOSI*.
        15. ItsyBitsy M0: pins 5, 12 and MOSI*.
        16. ItsyBitsy M4: pins 2, 5, 12 and MOSI*.
        17. Metro M0 or Arduino Zero: pins 5, 12 and MOSI*.
        18. Metro M4: pins 6, 11, A3 and MOSI*.
        19. Metro M4 AirLift: pins 6, 11 and MOSI*.
        20. Grand Central: pins 11, 14, 23 and MOSI*.
        21. HalloWing M0: pins 4 (NEOPIX), 6 and MOSI*.
        22. HalloWing M4: pins 6, 8, A5 and MOSI*.
        23. MONSTER M4SK: pin 2.
        24. PyPortal, PyPortal Titano: pin 3 (SENSE connector).
        25. PyGamer, PyGamer Advance: pins 12 and A4.
        26. PyBadge, PyBadge AirLift: pins A4, MOSI*.
        27. Crickit M0: pins 8, 11, A8 and A11.
        28. Trellis M4: pin 10 (keypad NeoPixels).
        29. Circuit Playground M0: pin A2.
        30. Trinket M0: pin 4 (can't use with I2C, SPI or Serial1 active).
        31. Gemma M0: pin D0 (can't use with I2C, SPI or Serial1 active).
        32. QT Py: MOSI* and pin 16 (underside pad, can't use w/optional SPI flash).
        33. * If using the MOSI pin on these boards, the corresponding SPI
        34. peripheral is not usable.
        35. */
        36.  
        37. #define PIN 6//12
        38. #define NUM_PIXELS 30
        39.  
        40. Adafruit_NeoPixel_ZeroDMA strip(NUM_PIXELS, PIN, NEO_GRB);
        41.  
        42. void setup() {
        43. strip.begin();
        44. strip.setBrightness(32);
        45. strip.show();
        46. }
        47.  
        48. void loop() {
        49. uint16_t i;
        50.  
        51. // 'Color wipe' across all pixels
        52. for(uint32_t c = 0xFF0000; c; c >>= 8) { // Red, green, blue
        53. for(i=0; i<strip.numPixels(); i++) {
        54. strip.setPixelColor(i, c);
        55. strip.show();
        56. delay(50);
        57. }
        58. }
        59.  
        60. // Rainbow cycle
        61. uint32_t elapsed, t, startTime = micros();
        62. for(;;) {
        63. t = micros();
        64. elapsed = t - startTime;
        65. if(elapsed > 5000000) break; // Run for 5 seconds
        66. uint32_t firstPixelHue = elapsed / 32;
        67. for(i=0; i<strip.numPixels(); i++) {
        68. uint32_t pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
        69. strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
        70. }
        71. strip.show();
        72. }
        73. }

        Hi,

        I didn't know yet about this option.

        Thanks for your feedback!

         

        Jules

        Expand Post
        Selected as Best
      • FACTS_AdamC (AutomationDirect)

        If you remove the P1AM.h include, does it work?

10 of 13