• Home
  • Products
    • Papilio FPGA
    • Arcade MegaWing
    • RetroCade MegaWing
    • LogicStart MegaWing
    • Logic Sniffer
    • Papilio Wings
  • Store
    • Gadget Factory Store
    • India Store
    • Distributers
  • Wikis
    • Papilio Wiki
    • Arcade Wiki
    • RetroCade Wiki
    • Logic Sniffer Wiki
  • Forum
  • Showcase
  • Downloads
  • Source Code
  • Home
  • Products
    • Papilio FPGA
    • Arcade MegaWing
    • RetroCade MegaWing
    • LogicStart MegaWing
    • Logic Sniffer
    • Papilio Wings
  • Store
    • Gadget Factory Store
    • India Store
    • Distributers
  • Wikis
    • Papilio Wiki
    • Arcade Wiki
    • RetroCade Wiki
    • Logic Sniffer Wiki
  • Forum
  • Showcase
  • Downloads
  • Source Code
Previous Next

Papilio DUO – Program Arduino Bootloader using HappyJTAG2

Posted by: Jack Gassett , August 29, 2014

Load the Arduino bootloader to the Papilio DUO without an external programmer. The Papilio DUO is amazingly flexible due to the ability to load any circuit to the FPGA fabric. This project shows how to load a circuit that connects the FT2232H SPI/MPSSE pins to the JTAG debugging port of the ATmega32U4 chip. This allows us to use a special piece of software called HappyJTAG2 to emulate a JTAGICE MKII debugger, effectively letting us set fuses, load hex files, and even debug the ATmega32u4 chip. This tutorial shows how to set everything up and program a hex file, in this case the Arduino bootloader. Look for future tutorials on how to debug the ATmega32u4. (This is for Windows users only.)

Video Walkthrough

Setup

Open up DesignLab and find the Papilio_DUO_happyjtag2 project.

Generate Bit File

Open the sketch directory and open the PSL_Papilio_DUO_LX9.xise file.

In Xilinx ISE double click on the Papilio_DUO_LX9.sch file to look at the schematic.

The bit file is already generated so you can actually skip generating the Bit file and go straight to loading the bit file.

Click on the Design tab.

Select the top level module and double click on “Generate Programming File”

Load Bit File

Plug in the FPGA USB port (the mini-USB) of the Papilio DUO to your computer.

Go back to the project folder and enter the DUO_LX9 folder.

Double click on the papilio_duo_LX9.bit file and make sure Papilio Loader pops up and loads the bit file to SPI Flash of the Papilio DUO.

Open HappyJTAG2

Go to the happyjtag2 folder in the project folder and run HappyJTAG2.exe as administrator

Don’t Forget! You need to load this as administrator otherwise the Virtual Com port will not work.

 

Say “No” to any warning messages.

Make sure that “Dual RS232-HS B is selected”

 

ChannelB

Make sure it detects the AVR Signature

AVR Signature

Make sure “Direct COM4 port emulation (AVRStudio)” is selected

Com 4 emulation

Note – The Intel Hex -> Target and Write Fuses functionality in HappyJTAG2 does not work at the moment. Once we get a Papilio DUO into the hands of the developer he should be able to get it working. Stay tuned!

 

 

Connect to HappyJTAG2 with AVR Studio

In this example we are using AVR Studio 4, this should probably work with later versions too, but we have not tested yet.

Open the AVR programmer by going to tools/Program AVR/Connect

Connect

Make sure JTAGICE mkII and COM4 are selected, press connect.

JTAGICE mkii

 

Do not upgrade the firmware if it asks!!!!

Read the Signature

  1.  Make sure ATmega32U4 is selected
  2. Make sure JTAG mode is selected
  3. Click Read Signature
  4. Verify the correct signature shows up!

Read Signature

 

Load Arduino Bootloader

  1. Click on Program
  2. Load the Arduino Leonardo bootloader from any Arduino or DesignLab project directory by going to hardware\arduino\bootloader\caterina\Caterina-Leonardo.hex
  3. Click Program

Program

 

Verify it works!

Plug in the ATmega32U4 USB port which is the Micro USB connector.

Micro USB

Open Windows Device Manager and verify that the Arduino Leonardo shows up under Com Ports

Device Manager

Celebrate with a beer! The Arduino Leonardo bootloader is now on the Papilio DUO without using any external hardware!

 

 

Tags: bootloader, happyjtag2, programmer

Comments

comments

About Gadget Factory

We make Open Source Hardware that is extremely Hackable, what we call Hack|Ware. Founded in 2009 by Aspiring Inventor Jack Gassett, we are hardware suppliers and inventors with a community focused approach. Home of the Papilio FPGA board and other open source hardware designs.

Located in Denver, Colorado just minutes away from beautiful Boulder, Colorado.

Gadget Factory Learning Site

Inspired by the excellent learning sites at Adafruit and Sparkfun we made our own learning site with tutorials about FPGA's, Electronics, and Making Open Source Hardware. If you have tutorials you would like to contribute please contact us at support@gadgetfactory.net.

If you have a project or code that you would like to share please post to the Showcase website.
© Gadget Factory 2013