MacOSX with Teensy 4.1 loader loaded before, refuses to load now

Status
Not open for further replies.

georgeloyer

New member
i have the Arduino 1.8.12 running with Teensyduino 1.52. I am connecting my Mac to a Teensy 4.1 board and it successfully loaded programs and ran them. Now it refuses. Here is the output of the compile and upload debug, below. I've loaded this program before, and several others, that I verified worked and everything seemed fine. This is a recent new problem that I can't find FAQ or troubleshooting guidance. Any help to diagnose the problem or just fix it would be welcome.

Arduino: 1.8.12 (Mac OS X), TD: 1.52, Board: "Teensy 4.1, Serial, 600 MHz, Faster, US English"

/Applications/Teensyduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Teensyduino.app/Contents/Java/hardware -tools /Applications/Teensyduino.app/Contents/Java/tools-builder -tools /Applications/Teensyduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Teensyduino.app/Contents/Java/libraries -libraries /Users/gloyer/Documents/Arduino/libraries -fqbn=teensy:avr:teensy41:usb=serial,speed=600,opt=o2std,keys=en-us -ide-version=10812 -build-path /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145 -warnings=none -build-cache /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_cache_280400 -verbose /Users/gloyer/watts/ElegooSmartRobotCar/Main program/SmartCar_Core20191227/Sweep_test_pan_tilt_servos/Sweep_test_pan_tilt_servos.ino
/Applications/Teensyduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Teensyduino.app/Contents/Java/hardware -tools /Applications/Teensyduino.app/Contents/Java/tools-builder -tools /Applications/Teensyduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Teensyduino.app/Contents/Java/libraries -libraries /Users/gloyer/Documents/Arduino/libraries -fqbn=teensy:avr:teensy41:usb=serial,speed=600,opt=o2std,keys=en-us -ide-version=10812 -build-path /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145 -warnings=none -build-cache /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_cache_280400 -verbose /Users/gloyer/watts/ElegooSmartRobotCar/Main program/SmartCar_Core20191227/Sweep_test_pan_tilt_servos/Sweep_test_pan_tilt_servos.ino
Using board 'teensy41' from platform in folder: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr
Using core 'teensy4' from platform in folder: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr
Detecting libraries used...
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=152 -DARDUINO=10812 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/sketch/Sweep_test_pan_tilt_servos.ino.cpp -o /dev/null
Alternatives for Servo.h: [Servo@1.1.6 Servo@1.1.2]
ResolveLibrary(Servo.h)
-> candidates: [Servo@1.1.6 Servo@1.1.2]
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=152 -DARDUINO=10812 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Servo /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/sketch/Sweep_test_pan_tilt_servos.ino.cpp -o /dev/null
Using cached library dependencies for file: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Servo/Servo.cpp
Generating function prototypes...
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=152 -DARDUINO=10812 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Servo /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/sketch/Sweep_test_pan_tilt_servos.ino.cpp -o /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/preproc/ctags_target_for_gcc_minus_e.cpp
/Applications/Teensyduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/precompile_helper /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145 /Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=152 -DARDUINO=10812 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/pch/Arduino.h -o /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/pch/Arduino.h.gch
Using previously compiled file: /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/pch/Arduino.h.gch
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=152 -DARDUINO=10812 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/pch -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4 -I/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Servo /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/sketch/Sweep_test_pan_tilt_servos.ino.cpp -o /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/sketch/Sweep_test_pan_tilt_servos.ino.cpp.o
Compiling libraries...
Compiling library "Servo"
Using previously compiled file: /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/libraries/Servo/Servo.cpp.o
Compiling core...
Using precompiled core: /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_cache_280400/core/core_5a344d82694cbc94f2b0e86b18501051.a
Linking everything together...
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-gcc -O2 -Wl,--gc-sections,--relax -T/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/imxrt1062_t41.ld -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.elf /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/sketch/Sweep_test_pan_tilt_servos.ino.cpp.o /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/libraries/Servo/Servo.cpp.o /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/../arduino_cache_280400/core/core_5a344d82694cbc94f2b0e86b18501051.a -L/var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145 -larm_cortexM7lfsp_math -lm -lstdc++
/Applications/Teensyduino.app/Contents/Java/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 /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.elf /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.eep
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-objcopy -O ihex -R .eeprom /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.elf /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.hex
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/stdout_redirect /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.lst /Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-objdump -d -S -C /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.elf
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/stdout_redirect /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.sym /Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-objdump -t -C /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.elf
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/teensy_post_compile -file=Sweep_test_pan_tilt_servos.ino -path=/var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145 -tools=/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/ -board=TEENSY41
Multiple libraries were found for "Servo.h"
Used: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Servo
Not used: /Applications/Teensyduino.app/Contents/Java/libraries/Servo
Using library Servo at version 1.1.2 in folder: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/Servo
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/arm/bin/arm-none-eabi-size -A /var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145/Sweep_test_pan_tilt_servos.ino.elf
Sketch uses 20416 bytes (0%) of program storage space. Maximum is 8126464 bytes.
Global variables use 45748 bytes (8%) of dynamic memory, leaving 478540 bytes for local variables. Maximum is 524288 bytes.
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools/teensy_post_compile -file=Sweep_test_pan_tilt_servos.ino -path=/var/folders/wq/ljjgbzk51gl28gk3b52zjp080000gn/T/arduino_build_894145 -tools=/Applications/Teensyduino.app/Contents/Java/hardware/teensy/../tools -board=TEENSY41 -reboot -port=usb:14410000 -portlabel=/dev/cu.usbmodem76541901 Serial -portprotocol=Teensy
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.
An error occurred while uploading the sketch
 
Try the 15 sec restore. Hold the button on Teensy for 15 seconds. You should see a brief flash on the red LED when the moment it right to release the button. The red LED should turn on bright for many seconds while it completely wipes the flash and writes a known-good LED blink program. When finished the orange LED should blink.

Hopefully your Mac will be able to recognize it again after this?
 
Try the 15 sec restore. Hold the button on Teensy for 15 seconds. You should see a brief flash on the red LED when the moment it right to release the button. The red LED should turn on bright for many seconds while it completely wipes the flash and writes a known-good LED blink program. When finished the orange LED should blink.

Hopefully your Mac will be able to recognize it again after this?

Paul, I was able to get the 15 second restore to work. The Blink program is running now on the Teensy, but my Mac is still unable to connect and upload new code to the Teensy. The new behavior is that pressing the Program button doesn't turn on the Red LED and this is the message at the end of the upload debug information:

No Teensy boards were found on any USB ports of your computer.
An error occurred while uploading the sketch
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

And it is true that in the Tools/Port menu, there are no USB ports reported. Removing the USB cable from the Teensy and plugging it back in restarts it running Blink again, but using the Program button stops Blink but doesn't turn on the red LED telling me it's ready to accept a program from the uploader. I also noticed that the little uploader micro app, when it appears, does not notice when I push the Program button, but I have seen that function work before.

One other observation: I have tried rebooting the Mac on the theory that the USB ports have somehow gotten hung up. That worked once - after the reboot, I was able to upload a new program. But then the same problem occurred on the next iteration and subsequent reboots did NOT solve the problem.

Thanks for your continued help!
George
 
Paul, I was able to get the 15 second restore to work. The Blink program is running now on the Teensy, but my Mac is still unable to connect and upload new code to the Teensy. The new behavior is that pressing the Program button doesn't turn on the Red LED and this is the message at the end of the upload debug information:

No Teensy boards were found on any USB ports of your computer.
An error occurred while uploading the sketch
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

And it is true that in the Tools/Port menu, there are no USB ports reported. Removing the USB cable from the Teensy and plugging it back in restarts it running Blink again, but using the Program button stops Blink but doesn't turn on the red LED telling me it's ready to accept a program from the uploader. I also noticed that the little uploader micro app, when it appears, does not notice when I push the Program button, but I have seen that function work before.

One other observation: I have tried rebooting the Mac on the theory that the USB ports have somehow gotten hung up. That worked once - after the reboot, I was able to upload a new program. But then the same problem occurred on the next iteration and subsequent reboots did NOT solve the problem.

Thanks for your continued help!
George

More detailed data and iterations to narrow where the problem is.
1. When upload is working to Teensy, it works without pressing the Program Mode button and when I press the Program Mode button. The Teensy micro-app works correctly in monitoring the USB connection with the Teensy during each of these iterations.

2. Once upload fails once, it will never work again until I reboot the Mac. I have tried many ways to reset the USB port, all failed. I have restarted Teensyduino. Unplugged Teensy and replugged it. Only rebooting the Mac solves the problem, until it occurs again.

3. I can most reliably make the failure to upload occur by unplugging the Teensy from USB and plugging back in. Doesn't seem to matter how much time in between those events - within seconds, waiting for a minute. I often (but not always) cause the failure this way.

4. There is no real difference in Mac OS 'ioreg' output for the Teensy USB port between times when it works and times when it doesn't work - just new classID, sessionID and serviceRegistryID.

5. The verbose log of the Teensy micro-app shows the differences between a working instance and failing instance (see the attached files: Teensymicrolog 1.txt is a success, Teensymicrolog 2.txt is a failure. These two happened in two consecutive uploads. In between the uploads, I disconnected Teensy from USB and reconnected it.

6. At the start of the success log, Teensy looks like it fails to find a device ([no_device]) and finds a prior device.

7. In success file at 14:21:36.396 first status back is (1,1,0,0,0,0). In fail file at 14:23:33.413 is (1,1,0,1,0,0). This set of status values never changes for the rest of each run.

8. In the success file at 14:21:36.419 portlabel = /dev/cu.usbmodem76541901 is reported. In the fail file at 14:23:33.439 portlabel = [no_device] Serial is reported.

9. In the success file, a reboot is performed and status confirmed and success reported at 14:21:38.171. In the fail file, a reboot is attempted, and then 50 attempts to get status different from (1,1,0,1,0,0) and all fail. The process gives up and reports a failure.

I can't guarantee that unplugging a working Teensy and plugging it back in is the only way to create this failure, but in my testing it is causing the problem 90% of the times I do it.

I really (really!) like the Teensy 4.1 otherwise, but if I can't get this to work more reliably, I'll have to look elsewhere.

GeorgeView attachment Teensymicrolog 2.txtView attachment Teensymicrolog 1.txt
 
Just as a reference, on my MacBook (Pro 2016 - Mojave) if I do the 15 second restore it will be seen by Teensyduino in "HID Mode" but not as a USB device for Teensy Loader.
 
2. Once upload fails once, it will never work again until I reboot the Mac. I have tried many ways to reset the USB port, all failed. I have restarted Teensyduino. Unplugged Teensy and replugged it. Only rebooting the Mac solves the problem, until it occurs again.

Maybe this is power related? Is anything else connected to the Teensy? Maybe something with big capacitors?

If you have a powered hub, does plugging into its powered ports give different results?
 
Maybe this is power related? Is anything else connected to the Teensy? Maybe something with big capacitors?

If you have a powered hub, does plugging into its powered ports give different results?

Paul, This moved me in the right direction to understanding what is going on, and demonstrated that it is related to what's connected to the Teensy. In my earlier tests, I started down the path of removing suspected power related connections and was still able to get the failure to happen. Your question caused me to remove all of the connections to the Teensy, including power, and rely only on the USB power from the laptop. I could not get it to fail in that configuration - good news!

I reconnected, one at a time, the power connections and still could not get it to fail. I have been trying to create the failures by simply loading and reloading programs, and disconnecting and reconnecting the Teensy to the USB port with varying lapses in time for being disconnected.

I will be on the lookout as I connect the various (robot) peripherals (sensors/actuators) for the return of this behavior and eventually (maybe?) be able to report what actually caused the behavior. I can't think what might have a big capacitor among the connected components. The bot includes battery power, current/power monitoring on the CPU and motors and a wireless charging system, motors themselves driven by an L298N, a line tracker, two servos for a pan tilt and a bluetooth module. It will be interesting to see what was causing the problem.

Thanks for your help, looking forward to posting about the project as it progresses.
George
 
Status
Not open for further replies.
Back
Top