Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning message for teensy bootloader #1065

Closed
mcuee opened this issue Aug 13, 2022 · 15 comments · Fixed by #1122
Closed

Warning message for teensy bootloader #1065

mcuee opened this issue Aug 13, 2022 · 15 comments · Fixed by #1122
Labels
bug Something isn't working

Comments

@mcuee
Copy link
Collaborator

mcuee commented Aug 13, 2022

There is a warning message for teensy bootlaoder.
avrdude.exe: WARNING: Failed to write page: hid_write/GetOverlappedResult: (0x0000001F) A device attached to the system is not functioning.

Run log with Teensy 2.0.

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude -c teensy -p m32u4 -x wait -V -U flash:w:.\Blink.ino.TEENSY2.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9587 (probably m32u4)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file .\Blink.ino.TEENSY2.hex for flash
avrdude.exe: writing 2742 bytes flash ...

Writing | ################################################## | 100% 0.26s

avrdude.exe: 2742 bytes of flash written
avrdude.exe: WARNING: Failed to write page: hid_write/GetOverlappedResult: (0x0000001F) 
A device attached to the system is not functioning.

avrdude.exe done.  Thank you.

@mcuee
Copy link
Collaborator Author

mcuee commented Aug 13, 2022

-vvvv run log shows more details.

avrdude.exe: teensy_powerdown()
avrdude.exe: teensy_reboot()
avrdude.exe: teensy_write_page(address=0xFFFFFFFF, size=0)
avrdude.exe: WARNING: Failed to write page: hid_write/GetOverlappedResult: (0x0000001F) 
A device attached to the system is not functioning.
full avrdude run log with -vvvv
PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude -c teensy -p m32u4 -x wait -V -U flash:w:.\Blink.ino.TEENSY2.hex:i -vvvv
executable_abspath = C:/work/avr/avrdude_test/avrdude_bin/avrdude.exe
executable_abspath_len = 48
executable_dirpath = C:/work/avr/avrdude_test/avrdude_bin
executable_dirpath_len = 36
sys_config = C:/work/avr/avrdude_test/avrdude_bin/avrdude.conf
sys_config_found = true


avrdude.exe: Version 7.0-20220804 (5f5002e)
             Copyright (c) Brian Dean, http://www.bdmicro.com/
             Copyright (c) Joerg Wunsch

             System wide configuration file is "C:/work/avr/avrdude_test/avrdude_bin/avrdude.conf"

avrdude.exe: teensy_setup()
avrdude.exe: teensy_parseextparams()
             Using Port                    : usb
             Using Programmer              : teensy
avrdude.exe: teensy_open("usb")
             AVR Part                      : ATmega32U4
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PA0
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             Serial program mode           : yes
             Parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :

                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom                 65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               flash                  65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00

             Programmer Type : teensy
             Description     : Teensy Bootloader
avrdude.exe: teensy_display()

avrdude.exe: teensy_enable()
avrdude.exe: teensy_initialize()
avrdude.exe: HID usage: 0x1B
avrdude.exe: Board: Teensy 2.0 (ATmega32U4)
avrdude.exe: Available flash size: 32256
avrdude.exe: Page size: 128
avrdude.exe: Signature: 0x1E9587
avrdude.exe: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude.exe: teensy_read_sig_bytes()
Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9587 (probably m32u4)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: teensy_chip_erase()
avrdude.exe: reading input file .\Blink.ino.TEENSY2.hex for flash
             with 2742 bytes in 1 section within [0, 0xab5]
             using 22 pages and 74 pad bytes
avrdude.exe: writing 2742 bytes flash ...

Writing |                                                    | 0% 0.00savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x0, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000000, size=128)
Writing | ##                                                 | 4% 0.02savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x80, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000080, size=128)
Writing | #####                                              | 9% 0.03savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x100, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000100, size=128)
Writing | #######                                            | 13% 0.05savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x180, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000180, size=128)
Writing | #########                                          | 18% 0.06savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x200, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000200, size=128)
Writing | ###########                                        | 22% 0.08savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x280, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000280, size=128)
Writing | ##############                                     | 27% 0.09savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x300, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000300, size=128)
Writing | ################                                   | 31% 0.11savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x380, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000380, size=128)
Writing | ##################                                 | 36% 0.12savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x400, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000400, size=128)
Writing | ####################                               | 40% 0.14savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x480, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000480, size=128)
Writing | #######################                            | 45% 0.15savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x500, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000500, size=128)
Writing | #########################                          | 50% 0.17savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x580, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000580, size=128)
Writing | ###########################                        | 54% 0.18savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x600, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000600, size=128)
Writing | ##############################                     | 59% 0.19savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x680, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000680, size=128)
Writing | ################################                   | 63% 0.21savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x700, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000700, size=128)
Writing | ##################################                 | 68% 0.22savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x780, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000780, size=128)
Writing | ####################################               | 72% 0.24savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x800, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000800, size=128)
Writing | #######################################            | 77% 0.25savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x880, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000880, size=128)
Writing | #########################################          | 81% 0.27savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x900, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000900, size=128)
Writing | ###########################################        | 86% 0.29savrdude.exe: teensy_paged_write(page_size=0x80, addr=0x980, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000980, size=128)
Writing | #############################################      | 90% 0.30savrdude.exe: teensy_paged_write(page_size=0x80, addr=0xA00, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000A00, size=128)
Writing | ################################################   | 95% 0.32savrdude.exe: teensy_paged_write(page_size=0x80, addr=0xA80, n_bytes=0x80)
avrdude.exe: teensy_write_page(address=0x000A80, size=128)
Writing | ################################################## | 100% 0.33s

avrdude.exe: 2742 bytes of flash written
avrdude.exe: teensy_powerdown()
avrdude.exe: teensy_reboot()
avrdude.exe: teensy_write_page(address=0xFFFFFFFF, size=0)
avrdude.exe: WARNING: Failed to write page: hid_write/GetOverlappedResult: (0x0000001F) A device attached to the system is not functioning.
avrdude.exe: teensy_disable()
avrdude.exe: teensy_close()

avrdude.exe done.  Thank you.

avrdude.exe: teensy_teardown()

@mcuee
Copy link
Collaborator Author

mcuee commented Aug 13, 2022

The same happens to Teensy++ 2.0 as well.


PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude -c teensy -p usb1286 -x wait -V 
-U flash:w:.\Blink.ino.TEENSY2PP.hex:i -vvvv
...
avrdude.exe: 2950 bytes of flash written
avrdude.exe: teensy_powerdown()
avrdude.exe: teensy_reboot()
avrdude.exe: teensy_write_page(address=0xFFFFFFFF, size=0)
avrdude.exe: WARNING: Failed to write page: hid_write/GetOverlappedResult: (0x0000001F)
 A device attached to the system is not functioning.
avrdude.exe: teensy_disable()
avrdude.exe: teensy_close()

avrdude.exe done.  Thank you.

avrdude.exe: teensy_teardown()

@mcuee mcuee added the bug Something isn't working label Aug 14, 2022
@MCUdude
Copy link
Collaborator

MCUdude commented Aug 14, 2022

@mcuee can you check if you get the same warning when using @mariusgreuel's Avrdude fork?

@mcuee
Copy link
Collaborator Author

mcuee commented Aug 14, 2022

@mcuee can you check if you get the same warning when using @mariusgreuel's Avrdude fork?

Same issue.

PS C:\work\avr\avrdude_test\avrdude_win\out\build\x64-Debug\src\Debug> .\avrdude -c teensy 
-p m32u4 -x wait -V -U flash:w:.\Blink.ino.TEENSY2.hex:i
avrdude.exe: No device found, waiting for device to be plugged in...
avrdude.exe: Press CTRL-C to terminate.

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.08s

avrdude.exe: Device signature = 0x1e9587 (probably m32u4)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file ".\Blink.ino.TEENSY2.hex"
avrdude.exe: writing flash (2742 bytes):

Writing | ################################################## | 100% 0.44s

avrdude.exe: 2742 bytes of flash written
avrdude.exe: WARNING: Failed to write page: A device attached to the system is not functioning.

avrdude.exe done.  Thank you.

Detail log shows the same as well.

avrdude.exe: 2742 bytes of flash written
avrdude.exe: teensy_powerdown()
avrdude.exe: teensy_reboot()
avrdude.exe: teensy_write_page(address=0xFFFFFFFF, size=0)
avrdude.exe: WARNING: Failed to write page: A device attached to the system is not functioning.
avrdude.exe: teensy_disable()
avrdude.exe: teensy_close()

avrdude.exe done.  Thank you.

avrdude.exe: teensy_teardown()

I also tried the previous release of the fork and the results are the same.

PS C:\work\avr\avrdude_test\avrdude_binary_archive\avrdude-v6.3.1.1-windows> .\avrdude -c teensy 
-p m32u4 -x wait -V -U flash:w:.\Blink.ino.TEENSY2.hex:i
avrdude.exe: No device found, waiting for device...
avrdude.exe: Press CTRL-C to terminate.

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9587 (probably m32u4)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file ".\Blink.ino.TEENSY2.hex"
avrdude.exe: writing flash (2742 bytes):

Writing | ################################################## | 100% 0.30s

avrdude.exe: 2742 bytes of flash written

avrdude.exe: safemode: Fuses OK (E:FF, H:FF, L:FF)
avrdude.exe: WARNING: Failed to write page: A device attached to the system is not functioning.

avrdude.exe done.  Thank you.

Detail log shows the same issue.

avrdude.exe: 2742 bytes of flash written

avrdude.exe: teensy_read_byte(desc=lfuse, addr=0x0)
avrdude.exe: safemode read 1, lfuse value: ff
avrdude.exe: teensy_read_byte(desc=lfuse, addr=0x0)
avrdude.exe: safemode read 2, lfuse value: ff
avrdude.exe: teensy_read_byte(desc=lfuse, addr=0x0)
avrdude.exe: safemode read 3, lfuse value: ff
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: teensy_read_byte(desc=hfuse, addr=0x0)
avrdude.exe: safemode read 1, hfuse value: ff
avrdude.exe: teensy_read_byte(desc=hfuse, addr=0x0)
avrdude.exe: safemode read 2, hfuse value: ff
avrdude.exe: teensy_read_byte(desc=hfuse, addr=0x0)
avrdude.exe: safemode read 3, hfuse value: ff
avrdude.exe: safemode: hfuse reads as FF
avrdude.exe: teensy_read_byte(desc=efuse, addr=0x0)
avrdude.exe: safemode read 1, efuse value: ff
avrdude.exe: teensy_read_byte(desc=efuse, addr=0x0)
avrdude.exe: safemode read 2, efuse value: ff
avrdude.exe: teensy_read_byte(desc=efuse, addr=0x0)
avrdude.exe: safemode read 3, efuse value: ff
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: safemode: Fuses OK (E:FF, H:FF, L:FF)
avrdude.exe: teensy_powerdown()
avrdude.exe: teensy_reboot()
avrdude.exe: teensy_write_page(address=0xFFFFFFFF, size=0)
avrdude.exe: WARNING: Failed to write page: A device attached to the system is not functioning.
avrdude.exe: teensy_disable()
avrdude.exe: teensy_close()

avrdude.exe done.  Thank you.

avrdude.exe: teensy_teardown()

@mcuee
Copy link
Collaborator Author

mcuee commented Aug 14, 2022

Somehow it does not work under Linux.

Edit: sorry this is a known issue, I need to use -F.

mcuee@UbuntuSwift3:~/build/avr/avrdude_bin$ ./avrdude -C ./avrdude.conf -c teensy -p m32u4 -x wait -vvvv
sys_config = ./avrdude.conf
sys_config_found = false


avrdude: Version 7.0-20220804 (5f5002e)
         Copyright (c) Brian Dean, http://www.bdmicro.com/
         Copyright (c) Joerg Wunsch

         System wide configuration file is "./avrdude.conf"
         User configuration file is "/home/mcuee/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

avrdude: teensy_setup()
avrdude: teensy_parseextparams()
         Using Port                    : usb
         Using Programmer              : teensy
avrdude: teensy_open("usb")
avrdude: No device found, waiting for device to be plugged in...
avrdude: Press CTRL-C to terminate.
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         PollIndex                     : 3
         PollValue                     : 0x53
         ...
         ...
         Programmer Type : teensy
         Description     : Teensy Bootloader
avrdude: teensy_display()

avrdude: teensy_enable()
avrdude: teensy_initialize()
avrdude: WARNING: Cannot detect board type (HID usage is 0)
avrdude: HID usage: 0x00
avrdude: Board: Unknown Board
avrdude: Available flash size: 32256
avrdude: Page size: 128
avrdude: Signature: 0x1E0000
avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude: teensy_read_sig_bytes()
Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e0000
avrdude: Expected signature for ATmega32U4 is 1E 95 87
         Double check chip, or use -F to override this check.
avrdude: teensy_powerdown()
avrdude: teensy_disable()
avrdude: teensy_close()

avrdude done.  Thank you.

avrdude: teensy_teardown()

After using -F there will be the same warning message.

mcuee@UbuntuSwift3:~/build/avr/avrdude_bin$ ./avrdude -c teensy -p m32u4 -x wait -V -F 
-U flash:w:./Blink.ino.TEENSY2.hex:i -vvvv
....... (skipped) ....

avrdude: 2742 bytes of flash written
avrdude: teensy_powerdown()
avrdude: teensy_reboot()
avrdude: teensy_write_page(address=0xFFFFFFFF, size=0)
avrdude: WARNING: Failed to write page: hid_error is not implemented yet
avrdude: teensy_disable()
avrdude: teensy_close()

avrdude done.  Thank you.

avrdude: teensy_teardown()

@mcuee
Copy link
Collaborator Author

mcuee commented Aug 14, 2022

@mariusgreuel
hidapi issue reported to hidapi project.

@mcuee
Copy link
Collaborator Author

mcuee commented Aug 14, 2022

@mariusgreuel
A simple fix is to prefer hidapi-hidraw to hidapi-libusb.

mcuee@UbuntuSwift3:~/build/avr/avrdude$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5efc8d4..2250065 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,8 +38,8 @@ option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
 if(WIN32)
     # Prefer static libraries over DLLs on Windows
     option(USE_STATIC_LIBS "Use static libraries" ON)
-else()
-    option(USE_STATIC_LIBS "Use static libraries" OFF)
+#else()
+#    option(USE_STATIC_LIBS "Use static libraries" OFF)
 endif()
 
 include(CheckIncludeFile)

In that case, we do not need to use -F anymore. I have not set up the proper udev rule so that I need to use sudo for the hidapi hidraw backend.

mcuee@UbuntuSwift3:~/build/avr/avrdude$ sudo ./build_linux/src/avrdude -c teensy 
-p m32u4 -x wait -V -U ../avrdude_bin/Blink.ino.TEENSY2.hex 
avrdude: No device found, waiting for device to be plugged in...
avrdude: Press CTRL-C to terminate.

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: input file ../avrdude_bin/Blink.ino.TEENSY2.hex auto detected as Intel Hex
avrdude: reading input file ../avrdude_bin/Blink.ino.TEENSY2.hex for flash
avrdude: writing 2742 bytes flash ...

Writing | ################################################## | 100% 0.20s

avrdude: 2742 bytes of flash written
avrdude: WARNING: Failed to write page: Protocol error

avrdude done.  Thank you.

@mcuee
Copy link
Collaborator Author

mcuee commented Aug 15, 2022

Answer from hidapi developer.
libusb/hidapi#443 (comment)

This is a known and documented issue:

https://github.com/libusb/hidapi/blob/c3ae3d0b582ba5e6b26af603aea37d988e7eda7b/libusb/hid.c#L729

As I mentioned here - now there is a workaround (ask for USAGE after the device is open).

The new work-around requires the latest hidapi git -- or the upcoming hidapi 0.13 release.

@mariusgreuel
Copy link
Contributor

Answer from hidapi developer

Thanks for contacting them. I will give their suggestions a shot.

@mariusgreuel
Copy link
Contributor

There is a warning message for teensy bootlaoder.
A device attached to the system is not functioning.

It seems that your PC is a bit more picky then mine about USB communication. I suspect when the AVR reboots it does not properly reply to the control packet.

It does not happen on my PC. Could you share some details about the make of your PC? Are you using a VM? Just wondering what CPU/USB chipset it has.

Also, does the Teensy successfully reboot? A simply workaround would be to just suppress the warning for the reboot.

@mcuee
Copy link
Collaborator Author

mcuee commented Sep 25, 2022

Interesting that you do not have issues with your PC.

My Acer Swift 3 laptop: dual boot Windows 11 or Ubuntu 20.04, not using VM.
Processor 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz 2.42 GHz
Installed RAM 16.0 GB

Standard Microsoft Windows xHCI driver and USB 3.0 root driver for Intel chipset.

More detail HW info: Tiger Lake-LP USB 3.2 Gen 2x1 xHCI Host Controller
https://linux-hardware.org/?probe=93680a7429

mcuee@UbuntuSwift3:~$ lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 9, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 9, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 3: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 3: Dev 3, If 2, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 5: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
    |__ Port 5: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 7: Dev 5, If 0, Class=Vendor Specific Class, Driver=, 480M
    |__ Port 10: Dev 6, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 10: Dev 6, If 1, Class=Wireless, Driver=btusb, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
mcuee@UbuntuSwift3:~$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 1c7a:0575 LighTuning Technology Inc. EgisTec EH575
Bus 003 Device 004: ID 04f2:b6dd Chicony Electronics Co., Ltd HD User Facing
Bus 003 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 003 Device 009: ID 16c0:0486 Van Ooijen Technische Informatica Teensyduino RawHID
Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 003 Device 006: ID 8087:0026 Intel Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 05e3:0612 Genesys Logic, Inc. Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
mcuee@UbuntuSwift3:~$ sudo hw-probe
[sudo] password for mcuee: 
Executing hw-probe -all -upload

Probe for hardware ... Ok
Reading logs ... Ok
Uploaded to DB, Thank you!

Probe URL: https://linux-hardware.org/?probe=93680a7429

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 10, 2022

A simply workaround would be to just suppress the warning for the reboot.

@mariusgreuel That is a good workaround. I agree with this.

@MCUdude
Copy link
Collaborator

MCUdude commented Oct 10, 2022

A simply workaround would be to just suppress the warning for the reboot.

A PR would be nice! 😀

@mariusgreuel
Copy link
Contributor

@mcuee I was unable to reproduce the problem, however, this PR should fix the warning you see. Could you please give this a try?

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 12, 2022

@mariusgreuel
Yes, PR #1122 is good. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants