error sending reboot command to /dev/hidraw4

Status
Not open for further replies.

wolfv

Well-known member
My Teensy LC and loader were working yesterday, now it gets an error sending reboot command to /dev/hidraw4.
From Arduino IDE, File > Examples > 01.Basics > Blink
Then click Upload. The resulting error message is:
Code:
Arduino: 1.8.5 (Linux), TD: 1.42, Board: "Teensy LC, Serial, 48 MHz, Smallest Code, US English"

/opt/arduino-1.8.5/arduino-builder -dump-prefs -logger=machine -hardware /opt/arduino-1.8.5/hardware -tools /opt/arduino-1.8.5/tools-builder -tools /opt/arduino-1.8.5/hardware/tools/avr -built-in-libraries /opt/arduino-1.8.5/libraries -libraries /home/wolfv/Documents/Arduino/libraries -fqbn=teensy:avr:teensyLC:usb=serial,speed=48,opt=osstd,keys=en-us -ide-version=10805 -build-path /tmp/arduino_build_137928 -warnings=all -build-cache /tmp/arduino_cache_485240 -verbose /opt/arduino-1.8.5/examples/01.Basics/Blink/Blink.ino
/opt/arduino-1.8.5/arduino-builder -compile -logger=machine -hardware /opt/arduino-1.8.5/hardware -tools /opt/arduino-1.8.5/tools-builder -tools /opt/arduino-1.8.5/hardware/tools/avr -built-in-libraries /opt/arduino-1.8.5/libraries -libraries /home/wolfv/Documents/Arduino/libraries -fqbn=teensy:avr:teensyLC:usb=serial,speed=48,opt=osstd,keys=en-us -ide-version=10805 -build-path /tmp/arduino_build_137928 -warnings=all -build-cache /tmp/arduino_cache_485240 -verbose /opt/arduino-1.8.5/examples/01.Basics/Blink/Blink.ino
Using board 'teensyLC' from platform in folder: /opt/arduino-1.8.5/hardware/teensy/avr
Using core 'teensy3' from platform in folder: /opt/arduino-1.8.5/hardware/teensy/avr
Detecting libraries used...
"/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w  -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m0plus -fsingle-precision-constant -D__MKL26Z64__ -DTEENSYDUINO=142 -DARDUINO=10805 -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-I/opt/arduino-1.8.5/hardware/teensy/avr/cores/teensy3" "/tmp/arduino_build_137928/sketch/Blink.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w  -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m0plus -fsingle-precision-constant -D__MKL26Z64__ -DTEENSYDUINO=142 -DARDUINO=10805 -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-I/opt/arduino-1.8.5/hardware/teensy/avr/cores/teensy3" "/tmp/arduino_build_137928/sketch/Blink.ino.cpp" -o "/tmp/arduino_build_137928/preproc/ctags_target_for_gcc_minus_e.cpp"
"/opt/arduino-1.8.5/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_137928/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/opt/arduino-1.8.5/hardware/teensy/../tools/precompile_helper" "/opt/arduino-1.8.5/hardware/teensy/avr/cores/teensy3" "/tmp/arduino_build_137928" "/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -Os --specs=nano.specs -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m0plus -fsingle-precision-constant -D__MKL26Z64__ -DTEENSYDUINO=142 -DARDUINO=10805 -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-I/opt/arduino-1.8.5/hardware/teensy/avr/cores/teensy3" "/tmp/arduino_build_137928/pch/Arduino.h" -o "/tmp/arduino_build_137928/pch/Arduino.h.gch"
Using previously compiled file: /tmp/arduino_build_137928/pch/Arduino.h.gch
"/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++" -c -Os --specs=nano.specs -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m0plus -fsingle-precision-constant -D__MKL26Z64__ -DTEENSYDUINO=142 -DARDUINO=10805 -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-I/tmp/arduino_build_137928/pch" "-I/opt/arduino-1.8.5/hardware/teensy/avr/cores/teensy3" "/tmp/arduino_build_137928/sketch/Blink.ino.cpp" -o "/tmp/arduino_build_137928/sketch/Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-gcc" -Os --specs=nano.specs -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=1534211464 "-T/opt/arduino-1.8.5/hardware/teensy/avr/cores/teensy3/mkl26z64.ld" -lstdc++  -mthumb -mcpu=cortex-m0plus -fsingle-precision-constant -o "/tmp/arduino_build_137928/Blink.ino.elf" "/tmp/arduino_build_137928/sketch/Blink.ino.cpp.o" "/tmp/arduino_build_137928/../arduino_cache_485240/core/core_teensy_avr_teensyLC_usb_serial,speed_48,opt_osstd,keys_en-us_6010e3e74486a956d991e12861411f25.a" "-L/tmp/arduino_build_137928" -larm_cortexM0l_math -lm
"/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "/tmp/arduino_build_137928/Blink.ino.elf" "/tmp/arduino_build_137928/Blink.ino.eep"
"/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "/tmp/arduino_build_137928/Blink.ino.elf" "/tmp/arduino_build_137928/Blink.ino.hex"
"/opt/arduino-1.8.5/hardware/teensy/../tools/stdout_redirect" "/tmp/arduino_build_137928/Blink.ino.lst" "/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-objdump" -d -S -C "/tmp/arduino_build_137928/Blink.ino.elf"
"/opt/arduino-1.8.5/hardware/teensy/../tools/stdout_redirect" "/tmp/arduino_build_137928/Blink.ino.sym" "/opt/arduino-1.8.5/hardware/teensy/../tools/arm/bin/arm-none-eabi-objdump" -t -C "/tmp/arduino_build_137928/Blink.ino.elf"
"/opt/arduino-1.8.5/hardware/teensy/../tools/teensy_post_compile" "-file=Blink.ino" "-path=/tmp/arduino_build_137928" "-tools=/opt/arduino-1.8.5/hardware/teensy/../tools/" "-board=TEENSYLC"
Sketch uses 6600 bytes (10%) of program storage space. Maximum is 63488 bytes.
Global variables use 2088 bytes (25%) of dynamic memory, leaving 6104 bytes for local variables. Maximum is 8192 bytes.
/opt/arduino-1.8.5/hardware/teensy/../tools/teensy_post_compile -file=Blink.ino -path=/tmp/arduino_build_137928 -tools=/opt/arduino-1.8.5/hardware/teensy/../tools -board=TEENSYLC -reboot -port=/sys/devices/pci0000:00/0000:00:14.0/usb2/2-4 -portlabel=/dev/hidraw4 (Teensy LC) Keyboard -portprotocol=Teensy 
error sending reboot command to /dev/hidraw4
Teensy did not respond to a USB-based request to enter program mode.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
the selected serial port Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
 does not exist or your board is not connected
Invalid library found in /home/wolfv/Documents/Arduino/libraries/keybrd_knuckle: /home/wolfv/Documents/Arduino/libraries/keybrd_knuckle
Invalid library found in /home/wolfv/Documents/Arduino/libraries/keybrd_knuckle: /home/wolfv/Documents/Arduino/libraries/keybrd_knuckle
I followed the instructions on https://www.pjrc.com/teensy/troubleshoot.html > Teensy Not Recognized by Teensy Loader
And still get the same error.

When I press the button on Teensy, the Teensy Loader window briefly says, "Programming" then "Reboot OK".

The Teensy is part of a keyboard, and it is typing letters as intended, so that proves that Teensy is plugged in, recognized by the operating system, and the keyboard program was not overwritten by boot loader.

What else can I trouble shoot?
 
Last edited:
I will try to answer the best I can.

Does it work to complete reprogramming when the button is pressed?
Not sure what "work to complete reprogramming" means.
The Teensy did not get reprogrammed. The old program still runs on Teensy. It did not get overwritten with the new Blink program.

Does it work to program and then reprogram a simple blink without button when made Serial?
From Arduino IDE: Tools > USB Type: "Serial"
No blink.

I see from output this is on Linux.
Yes, Fedora 28.
Arduino 1.8.5 with Teensyduino 1.42.
 
When upload fails pressing the button on the T_LC should cause the T_LC to go into programming mode and take new code.

Did you try pushing the button at that point?

I think that is noted in the link - also a button press held during plugging in the T_LC?

Unless there is a hardware error - the problem may be a USB stack that isn't fully responsive with the current code - or a LINUX thing
 
UPDATE:

I plugged in a different Teensy LC and the Blink program loaded & ran nice.
Then I plug in the bad Teenly LC again and get the same "error sending reboot command to /dev/hidraw4".
 
UPDATE:

I plugged in the "bad" Teensy and tried the Teensy button again, and this time it worked. Blink loaded and the LED blinked.
I edit the Blink sketch to blink faster and reloaded, it loaded without an error message, and Blink blinked faster.
I don't know what changed. I didn't reboot or restart the Arduino IDE. Both Teensy LCs work fine now.
 
Yup, that's why every Teensy has a button dedicated to entering programming mode. There isn't any dedicated USB-serial chip which always communicates, like on Arduino Uno. When Teensy gets loaded with "bad" code, which can be as simple as leaving interrupts disabled or entering a sleep mode without a way to wake up, there's no way for Teensy hear the USB communication requesting it to reboot.

Recovering from bad code can be confusing, especially if Teensy Loader still has the bad code loaded. It can seem like "nothing works" at first.
 
Does the following quote from https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro apply to Teensy LC?:
Press and hold the reset button on the Leonardo or Micro, then hit the upload button in the Arduino software. Only release the reset button after you see the message "Uploading..." appear in the software's status bar. When you do so, the bootloader will start, creating a new virtual (CDC) serial port on the computer. The software will see that port appear and perform the upload using it. Again, this is only necessary if the normal upload process (i.e. just pressing the uploading button) doesn't work. (Note that the auto-reset is initiated when the computer opens the serial port at 1200 baud and then closes it; this won't work if something interferes with the board's USB communication - e.g. disabling interrupts.)
 
Status
Not open for further replies.
Back
Top