Teensy debugging via JTAG

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Teensy debugging via JTAG

Postby ybk » Tue Apr 10, 2012 10:18 pm

I acquired Teensy++ http://www.adafruit.com/products/731 with the intention to use with Atmel AVR Dragon http://store.atmel.com/PartDetail.aspx?q=p:10500053
My project is relatively large and dealing with USB bootloader trial and error method is getting very time consuming.
Having read the AT90USB1286 400+ pages documentation I found that it supports JTAG. However it appears that JTAG is disabled by a proprietary halfkay loader to protect the code. I wonder if there is a documented path to switch from USB loader to hardware debugger/AVR studio.
ybk
 
Posts: 4
Joined: Tue Apr 10, 2012 9:42 pm

Re: Teensy debugging via JTAG

Postby adafruit » Wed Apr 11, 2012 1:55 pm

you can use the Dragon via ISP to turn the JTAG fuse back on - its not set in the bootloader its set by a fuse
User avatar
adafruit
 
Posts: 10489
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Teensy debugging via JTAG

Postby ybk » Thu Apr 12, 2012 7:40 pm

adafruit wrote:you can use the Dragon via ISP to turn the JTAG fuse back on - its not set in the bootloader its set by a fuse

AVR Dragon is indeed able to communicate with Teensy board in ISP mode.

BODLEVEL = 2V6
HWBE = [X]
OCDEN = [ ]
JTAGEN = [ ]
SPIEN = [X]
WDTON = [ ]
EESAVE = [ ]
BOOTSZ = 512W_FE00
BOOTRST = [ ]
CKDIV8 = [X]
CKOUT = [ ]
SUT_CKSEL = EXTXOSC_8MHZ_XX_16KCK_0MS

EXTENDED = 0xF3 (valid)
HIGH = 0xDF (valid)
LOW = 0x5F (valid)

LB = PROG_VER_DISABLED
BLB0 = NO_LOCK
BLB1 = LPM_SPM_DISABLE

LOCKBIT = 0xCC (valid)

I see that both Memory Lock Bits are programmed and thus pretty much everything is locked unless "Erase Device" operation is performed. Is there an alternative loader? I would like to preserve original functionality.
ybk
 
Posts: 4
Joined: Tue Apr 10, 2012 9:42 pm

Re: Teensy debugging via JTAG

Postby adafruit » Fri Apr 13, 2012 9:26 am

the bootloader is not distributed, but you could ask PJRC for help - he might be able to send you a teensy++ with the bits unlocked
User avatar
adafruit
 
Posts: 10489
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Teensy debugging via JTAG

Postby ybk » Fri Apr 13, 2012 3:19 pm

adafruit wrote:the bootloader is not distributed, but you could ask PJRC for help - he might be able to send you a teensy++ with the bits unlocked


I know that PJRC bootloader is not distributed, that is why I included word "alternative" in my original question. I've heard that there is an open source bootloader with the same functionality but I haven't been able to find a ready to use one yet. Any pointers?

Sending with bits unlocked means distributing bootloader which PJRC will not do.
ybk
 
Posts: 4
Joined: Tue Apr 10, 2012 9:42 pm

Re: Teensy debugging via JTAG

Postby adafruit » Fri Apr 13, 2012 3:54 pm

we do not know of an alternative bootloader
User avatar
adafruit
 
Posts: 10489
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Teensy debugging via JTAG

Postby ybk » Sun Apr 22, 2012 11:15 am

adafruit wrote:we do not know of an alternative bootloader

After some searching I found LUFA library which includes a bootloader similar to an original one. The only problem is that loaded program starts only after a powercycle. Included in the bootloader reset sequence
Code: Select all
   USB_Detach();

   /* Enable the watchdog and force a timeout to reset the AVR */
   wdt_enable(WDTO_250MS);

   for (;;);


does not work as on author's at90usb1287 device. In the Teensy++2.0 case it appears to restart the bootloader. USB seen detached and then reattached again to the bootloader application.

Is there anything special about WDT here? If I add the same reset code into the PJRC blinky example at the end of while(1) loop it causes LED to blink rapidly instead of a restart of MORSE sequence.
ybk
 
Posts: 4
Joined: Tue Apr 10, 2012 9:42 pm


Return to Microcontrollers

Who is online

Users browsing this forum: No registered users and 3 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [102]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]