So I wanted to simply try reprogramming the Teensy LC with something I thought would work -- the example program blinky. I downloaded, unzipped it, and tried to run make, but ran into compilation issues:
I fixed the errors by making the aforementioned structs consts and recompiled. I then inserted the Teensy LC into the USB port, and saw the default blinking program run (LED on 1s, LED off 1s). I flashed the Teensy LC using the teensy_loader_cli command, and it stopped. From there, I could do nothing. I held the button down, and plugged the Teensy back into the usb port, and waited 15s. Nothing again. I tailed dmesg and journalctl while unplugging and plugging the Teensy back into the USB port, and nothing. I had another Teensy LC on hand, and tried that one out. Found the normal dmesg message:
For some reason, I decided I'd reprogram that one with the same blinky.hex that caused an issue, except had the teensy_loader_cli output verbosely:
Same exact thing happened. I've, unfortunately, burned through both of the Teensy LCs.
The teensy_loader_cli program I used was made from the git repo: https://github.com/PaulStoffregen/teensy_loader_cli
I'm using avr-gcc 7.1.0:
I'm using avr-libc 2.0.0, if that matters. Help would be appreciated, thanks!
----
Digging deeper it looks like the Makefile passes the atmega32u4 as the MCU (Teensy 2.0). Don't yet know the compatibility between the Teensy LC and the Teensy 2.0. From the code though, it looks like the only difference could be LED_ON and LED_OFF are swapped.
Code:
$ make
-------- begin --------
avr-gcc (GCC) 7.1.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling C: blinky.c
avr-gcc -c -mmcu=atmega32u4 -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./blinky.lst -std=gnu99 -MMD -MP -MF .dep/blinky.o.d blinky.c -o blinky.o
Compiling C: usb_debug_only.c
avr-gcc -c -mmcu=atmega32u4 -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./usb_debug_only.lst -std=gnu99 -MMD -MP -MF .dep/usb_debug_only.o.d usb_debug_only.c -o usb_debug_only.o
usb_debug_only.c:96:24: error: variable 'device_descriptor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
static uint8_t PROGMEM device_descriptor[] = {
^~~~~~~~~~~~~~~~~
usb_debug_only.c:113:24: error: variable 'hid_report_descriptor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
static uint8_t PROGMEM hid_report_descriptor[] = {
^~~~~~~~~~~~~~~~~~~~~
usb_debug_only.c:128:24: error: variable 'config1_descriptor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
static uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = {
^~~~~~~~~~~~~~~~~~
usb_debug_only.c:175:52: error: variable 'string0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
static struct usb_string_descriptor_struct PROGMEM string0 = {
^~~~~~~
usb_debug_only.c:180:52: error: variable 'string1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
static struct usb_string_descriptor_struct PROGMEM string1 = {
^~~~~~~
usb_debug_only.c:185:52: error: variable 'string2' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
static struct usb_string_descriptor_struct PROGMEM string2 = {
^~~~~~~
usb_debug_only.c:198:11: error: variable 'descriptor_list' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
} PROGMEM descriptor_list[] = {
^~~~~~~~~~~~~~~
make: *** [Makefile:550: usb_debug_only.o] Error 1
I fixed the errors by making the aforementioned structs consts and recompiled. I then inserted the Teensy LC into the USB port, and saw the default blinking program run (LED on 1s, LED off 1s). I flashed the Teensy LC using the teensy_loader_cli command, and it stopped. From there, I could do nothing. I held the button down, and plugged the Teensy back into the usb port, and waited 15s. Nothing again. I tailed dmesg and journalctl while unplugging and plugging the Teensy back into the USB port, and nothing. I had another Teensy LC on hand, and tried that one out. Found the normal dmesg message:
Code:
[ 596.002966] usb 1-3: new full-speed USB device number 4 using xhci_hcd
[ 596.135269] hid-generic 0003:16C0:0486.0005: hiddev0,hidraw4: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-3/input0
[ 596.136037] hid-generic 0003:16C0:0486.0006: hidraw5: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-3/input1
[ 622.571246] usb 1-3: USB disconnect, device number 4
[ 623.040245] usb 1-3: new full-speed USB device number 5 using xhci_hcd
[ 623.171677] hid-generic 0003:16C0:0478.0007: hidraw4: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:00:14.0-3/input0
[ 623.341697] usb 1-3: USB disconnect, device number 5
For some reason, I decided I'd reprogram that one with the same blinky.hex that caused an issue, except had the teensy_loader_cli output verbosely:
Code:
$ teensy_loader_cli -mmcu=mkl26z64 -v -w blinky.hex
Teensy Loader, Command Line, Version 2.1
Read "blinky.hex": 1826 bytes, 2.9% usage
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "blinky.hex": 1826 bytes, 2.9% usage
Programming....
Booting
Same exact thing happened. I've, unfortunately, burned through both of the Teensy LCs.
The teensy_loader_cli program I used was made from the git repo: https://github.com/PaulStoffregen/teensy_loader_cli
I'm using avr-gcc 7.1.0:
Code:
$ avr-gcc --version
avr-gcc (GCC) 7.1.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I'm using avr-libc 2.0.0, if that matters. Help would be appreciated, thanks!
----
Digging deeper it looks like the Makefile passes the atmega32u4 as the MCU (Teensy 2.0). Don't yet know the compatibility between the Teensy LC and the Teensy 2.0. From the code though, it looks like the only difference could be LED_ON and LED_OFF are swapped.
Last edited: