Why won't downloading code work?

Status
Not open for further replies.

bigpilot

Well-known member
I'm currently unable to load code into my Teensy. I read somewhere that it might have to do with the user code previously programmed into the device.

My question is: how can this be? When I press the button on the Teensy a monitor program runs, so how can the code inside the device affect the downloading operation? Is the monitor running as an interrupt service routine of the user code? Or is it a 'true' monitor which runs independently of the user program?
 
Last edited:
In the IDE "Tools / Port" do you see the device listed, any output coming to the Serial Monitor?

I don't find where I saw it but I think this may get you going: unplug your cable and hold the button down as you plug it in for a few seconds (if Windows, past the time it would take for Windows to recognize the device). Then release the button and try the Upload from the IDE.

The TeensyDuino 'Auto' icon must be green for the Button to initiate an Auto Upload. The IDE will always attempt Auto when an 'Upload' was selected versus Verify (if you have more than one active Teensy it may not program the one you want - requiring Verify and a Button to select it)

The Button triggers the hardware to interrupt and enter the bootloader mode and presents a unique USB type to the computer for the Upload. Perhaps if the sketch was running as USB it may have the port in a state that TeensyDuino won't see the transition, so it won't step in to program the device.
 
on teensy 3.1, there are 2 processors, mini54 and mk20, both are connected to usb, but only 1 can be active at a time, and mk20 is the one active when your program is running. if program is hung, then usb is also hung. when you press the button, the mini54 takes over the usb (as if a usb device gets plugged in, and this runs the monitor program) while it resets mk20, hence you are now able to upload program.
 
I think a have found the culprit. I have a transceiver connected to the Teensy (1.0) and it seems the transmitter is messing up the USB connection. I've now removed power and it seems to download OK.
 
Status
Not open for further replies.
Back
Top