Bootloaders for AT90USB1286

While the AT90USB1286 MCU in the Teensylu/Printrboard can be programmed with an ICSP or JTAG programmer, you can also install a bootloader, which will allow you to program it via a USB connection alone. Besides the convenience of not having to attach a hardware programmer, uploading firmware via a USB bootloader is blazingly fast. Also, it allows you to write host software to do end user firmware upgrades without a hardware programmer.

I am currently aware of 3 bootloader options for the AT90USB128x MCU’s:

DFU – USB Device Firmware Upgrade Class

This is the bootloader officially supported by Atmel.

PRO: Works with Atmel FLIP tool.

CON: requires libusb device driver; no command line tool available for Windows.  For Linux, an open source host loader app is available; can’t integrate into Arduino IDE

CDC – USB Communication Device Class

PRO: can integrate into Arduino IDE; works with avrude via avr109 protocol.

CON: requires user to know which virtual serial port it’s associated with; in Windows, uses native Windows driver, but requires INF file install, needs upgrade of avrdude to newer version for Arduino < 1.0.

HID – USB Human Interface Device Class

PRO:  Trouble free – doesn’t require any device drivers – just plug and play

CON: doesn’t integrate into Arduino IDE

 

Fuse Settings

Before you can install a bootloader on your MCU, you must set the fuses correctly to allocate space for it.  We need 4K bytes (2K words) of space, so using the Engbedded Atmel Fuse Calculator, we see that we need Boot Flash Size BOOTSZ=01,  which is in the high fuse.  Here are the fuse settings that I use on mine:

avrdude -c usbtiny -p at90usb1286 -U lfuse:w:0xde:m -U hfuse:w:0xdb:m -U efuse:w:0xf0:m

BE CAREFUL IF YOU WANT TO FIDDLE WITH FUSE SETTINGS YOURSELF.  It’s not hard to “brick” your AVR with the wrong settings.  In fact, when I was first working with my Printrboard, I managed to brick it by messing up the CKSEL bits, thinking I was supposed to set it for an external oscillator.  Luckily, all I had to do was connect an external oscillator (I used the signal generator function of my DSO Quad mini scope) to XTAL1 and then use avrdude to fix the offending fuse.  If you do something worse, like disabling SPIEN by accident, you might have to resort to HV programming.  Here is some info on recovering a bricked AVR:  http://www.larsen-b.com/Article/260.html

Note that I have set hfuse = 0xdb, which disables the JTAG interface.  This makes more I/O pins available (in particular, some of the pins exposed on the I/O headers of Printrboard).  If you want to use a JTAG programmer, you should instead set hfuse = 0x9b.

Once your fuses are set correctly, use avrdude with your programmer to upload the bootloader.  After your bootloader is installed, you don’t need to use the programmer anymore – just a USB connection is enough.

Booting into Bootloader

Once a bootloader is installed (see instructions below), the bootloader must be activated when you want to upload firmware.  To boot the AVR into the bootloader instead of normal program code, you must tie the HWB pin to ground during a RESET pulse.  To to this on Teensylu or Printrboard, simply remove the 2-pin jumper that’s next to the AT90USB1286 chip, then press and release the reset button.  You can then replace the HWB jumper.

NOTE: If you have a Printrboard RevD, the jumper has been reversed, and needs to be INSTALLED to get into the bootloader, and REMOVED to run your firmware.

Below, I describe how to install and use each of the bootloaders.  For Arduino IDE integration, use BootloaderCDC.  I also like BootloaderHID, because it doesn’t need drivers, and doesn’t require selecting a virtual serial port.

DFU Bootloader

  1. Download and install FLIP. FLIP will also install the device driver.
  2. Download BootloaderDFU.zip. I built this one for AT90USB1286 from LUFA-120219.
  3. Install with avrdude: avrdude -c usbtiny -p at90usb1286 -U flash:w:BootloaderDFU.hex:i (note if avrdude complains of a verification error, ignore it)
  4. To flash hex files to board, after Booting into Bootloader, use FLIP or dfu-programmer.

CDC Bootloader

  1. Download BootloaderCDC.zip.  I built this one for AT90USB1286 from LUFA-120219.
  2. Install with avrdude: avrdude -c usbtiny -p at90usb1286 -U flash:w:BootloaderCDC.hex:i (note if avrdude complains of a verification error, ignore it)
  3. To flash hex files, you’ll need a newer version of avrdude than the one included with Arduino < v1.0.  The version I use is 5.10.  After Booting into Bootloader (the first time, Windows might want a driver … point it to the INF file that I included) , type:  avrdude -c avr109 -P port -p at90usb1286 -U flash:w:firmware.hex:i, substituting your Printrboard’s CDC serial port for port, and the name of your hex file for firmware.hex.
  4. If you want to flash directly from the Arduino IDE, follow my instructions for installing my at90usb1286txt.zip files into Arduino.  Then, after restarting Arduino and Booting into Bootloader, select [BootloaderCDC]Teensylu/Printrboard from the Arduino Tools->Board menu.  Then select the serial port associated with your board.  Hit the Upload button in the Arduino IDE to compile and upload your sketch.

HID Bootloader

  1. Download BootloaderHID.zip. I built this one for AT90USB1286 from LUFA-120219.
  2. Install with avrdude: avrdude -c usbtiny -p at90usb1286 -U flash:w:BootloaderHID.hex:i (note if avrdude complains of a verification error, ignore it)
  3. To flash hex files, after Booting into Bootloader, type:  hid_bootloader_cli -mmcu=at90usb1286 -w -v firmware.hex, substituting the name of your hex file for firmware.hex.  I’ve included the Windows binary.  For Linux or OSX, you can build hid_bootloader_cli yourself from the LUFA sources.

NOTE: When uploading a bootloader to the AT90USB1286 using a USBtinyISP, you will get a verify error from avrdude.  You can safely ignore it.  The problem is that the USBtinyISP has a bug with reading flash memory above the 64K (10000h) boundary.  However, it can write it without problems.

There are 78 Comments to "Bootloaders for AT90USB1286"

  • Colin says:

    Hi,

    First of all, thank you for putting all this information out there for us to use!

    I wondered if you might be able to help with my issue?

    I received my Printrboard with the CDC bootloader and Marlin installed, however a friend of mine didn’t. Mine is Rev.D and his is Rev.B. I bought a USBtinyISP to update his firmware and thought I’d check it on mine first. Everything checked out and I’ve gotten both boards updated, however… I used to be able to update the firmware with the Arduino IDE but now I can’t. It seems as if the boot jumper isn’t making any difference, I’ll explain.

    Before updating, when my board was working with the Arduino IDE, upon installing the jumper (Rev.D) and pressing the reset button the serial number changed to a different number from the one displayed without the jumper (from 12341 to 3d11) and I could upload new firmware.

    Now, after updating the bootloader and booting into it, the serial stays the same, Arduino gives a “Java.Lang.nullpoint” error upon uploading and I can still connect / print via Pronterface (which I’m assuming I shouldn’t when in bootloader mode).

    Do you have any suggestions? I appreciate your help.

    Colin

    • lincomatic says:

      I think they reversed the jumper in Rev.D. In my rev B/C boards, you remove the jumper and press reset to boot the bootloaders.

      Open up Windows Device Manager and look under Ports (COM & LPT).
      When the board’s in bootloader mode, you should see it as Communications Port (COMx).
      When it’s running the firmware, you should see it as Usb Serial (Communications Class, Abstract Control Model) (COMx)

      One problem may be that the original bootloader you had was improperly using a different USB VID/PID.
      I’m assuming you used my BootloaderCDC.zip. Assuming that bootloader is flashed into your Printrboard,
      with the jumpers set for bootload, right click on it in Device Manager, select Update Driver Software from the popup menu,
      and then point it to the INF file that I included. Hopefully, that will make it recognize the bootloader properly.

      If the bootloader is installed properly, then you should be able to flash the firmware using avrdude, as in my article above.
      Let’s get avrdude working properly first, then we can figure out what’s wrong w/ Arduino.

  • Colin says:

    Hi,

    After searching the depths of the internet I found a forum post where someone had a similar issue with an adafruit board. This resulted in me adding : “cdcteensylu.bootloader.path=undefined”
    to the teensy/boards.txt file and now I can program my Printrboard with the Arduino IDE!!

    JOY!!

    FYI I’m using OSX 10.7 so things were a little different but with the Marlin firmware loaded I see “USB Serial” in System Information and after I set the fuses, uploaded your CDC Bootloader and booted into the bootloader, System Information then said “AVR CDC Bootloader”. From there I uploaded the Marlin firmware with the Arduino IDE and it all worked.

    Again, thanks for you help. Your work has been incredibly valuable and I appreciate you posting about it all in your blog. Keep up the great work!!

    Colin

    • lincomatic says:

      Ah, I wish you’d mentioned you were using a OSX. Anyway, glad you got it working, and thanks for posting your fix… perhaps it will help someone else get it going.

  • mkeveney says:

    When setting the fuses, I found that I had to add -u (note lowercase) to disable ‘safe mode.’ I verified this by reading the fuses back, using -U lfuse:r:low.txt:h (and similar for high and ext).

    I don’t see this -u option mentioned here, or in any other AVRDUDE article on setting fuses… am I the one missing something or is everyone else?

    • lincomatic says:

      What version of avrdude are you using? While the documentation says that it’s needed for updating fuses, I’ve never had problems with not specifying -u

      • mkeveney says:

        I got the latest version I could find: Version 5.11-Patch#7610

        I just discovered that the -? option says this:
        -u Disable safemode, default when running from a script.
        ..and I did use (DOS/windows) batch files for everything. ..so perhaps safemode is _not_ active _unless_ running from the a batch file?

  • [...] CDC Bootloader, courtesy of Lincomatic – Link [...]

  • [...] for this post goes to Lincomatic.  I’m posting my methods and what I did to get my board working.  I also think having this [...]

  • marcin says:

    Hi im new with printrboard tested before mezli and sanguinololu have two repraps few days ago i have bought printrboard for new project and got one problem which i hope u will help me to solve ;) i got comunnication problem with my board and system i have try on win7 and xp and cant connect to the board i have installed stuff from printrboardfarm file but this still dose not work could u recommend some procudure to help me link my board with prontarface ?? thanks a lot

  • James says:

    Hi,

    I followed the instructions on the http://reprap.org/wiki/Printrboard#Installing_A_Bootloader and i used there fuse values and it completed with the errors like you stated it updated to the new bootloader now its bricked.. it will not register at all on any machine windows/linux/OSX. How can i de-brick this board? i checked ur link but i am unsure what any of that means. Any help would be greatly appricated.

    Thanks
    James

    • lincomatic says:

      The only way you can actually “brick” the board is to mess up the CKSEL bits.
      If you can still burn a bootloader, then you just need to redo it.
      Try following the article above.

      • James says:

        I can’t see the board on the pc and if i connect my USBtinyISP to it and try to re run the commands it fails not finding the printrboard. and the post you linked about using an external clock i have no idea how to implement. I am at a loss on how to accomplish getting back to a reprogramable state.

        • lincomatic says:

          Ouch, OK, I didn’t know that you were having trouble w/ the USBtinyISP as well.
          The other thing besides CKSEL that can make the USBtinyISP not work is if you disabled that via the SPIEN bit in the high fuse.
          But you were able to write a bootloader to the board after setting the fuses, right?
          If so, then the fuses are not your problem.
          Did you make sure to remove the jumper (Printrboard Rev A-C .. RevD the jumper should be installed) and hit reset before trying to reload the bootloader?

          • James says:

            I put the jumper on to get it into Bootloader connected the 6pin pin1 (red) closest to SD slot plugged the usb into the USBtinyISP ran those two commands. I think it errored on the fuses bits and asked me if i wanted to continue or revert.. and i didn’t reverse. But it downloaded the new bootloader failed on verification like it should have but now its just done plug it in and the light comes on but nothing won’t load on the OS regardless of jumper. would this be easier on an AIM or IRC thing I hate to fill up your comments section with nub stuff

  • lincomatic says:

    I’m no expert on this stuff. If the fuses got messed up, you have to follow the instructions in the linked article for unbricking. In my case, I knew exactly which bits I messed up, so clocking it with an external oscillator woke it up to a state where the USBtinyISP was working again. If the USBtinyISP can still see your board then just follow my instructions above.

    • James says:

      i got the bootloader to go without hassle but the board will not boot. was a driver issue before but no matter what bootloader i put on it.. windows will not find the board and i cannot load firmware to the board using your modified teensy files. Can you tell me exactly what version of IDE you use and what else you’ve changed as of right now i have a controller i cannot use but is programable via USBtinyISP and with the CDC bootloader windows can find it but not upload any firmware. and with the DFU bootloader or HID bootloader windows cannot see the board. I am at a loss

      • lincomatic says:

        After you install my CDC bootloader, you need to use my INF file in order for Windows to see it. If you manage to install firmware on it via the bootloader, then you will need to use Teensy’s INF file to see it as a serial device.
        Another way is use my [usbtinyisp]AT90USB1286 board setting, and just load the firmware directly instead of installing a bootloader.
        I am using the Arduino 0022 setup thats linked from reprap-usa.com’s Printrboard product page. I sent them my Arduino files because they were having trouble configuring it properly

        • James says:

          after much tinkering and swearing and drinking i managed to get HID bootloader working and got sprinter firmware on my board and pronter see’s the board and the printer moves.. YAY

          • Dave says:

            I am attempting to debug the sprinter code with Arduino 1.0.1(I’ve tried -0022 and -0023!). Our customer wants us to use the CDCBootloader in the Rev.D. I got the fuses and bootloader installed by erasing the entire AT90USB1286 via Atmel Studio 6\Device Programmer(I know now, I can insert either -u or -e to override to erase the lockbits). I have followed lincomatic’s instructions to a “T”, except attempting to use Arduino 1.0.1(Customer preference!)
            Can you explain how you got sprinter to cooperate with Arduino?
            Also, I am a noob to the software programming field. I am a Electronics Tech, and a recent Arduino UNO hobbyist.
            Any help you can give is greatly appreciated.

          • lincomatic says:

            I haven’t tried to compile anything for AT90USB1286 with Arduino 1.0+.
            For Sprinter, I had to make a bunch of changes to get the pin assignments correct,
            but Kliment accepted my changes a long time ago.
            Maybe you can try compiling my branch first https://github.com/lincomatic/Sprinter

          • lincomatic says:

            Did you figure out what you were doing wrong?
            What was the trick to get it working?

        • Dave says:

          I just replied to the James you conversed with the last few days.

          First off, thank you muchly for your hard work in keeping this blog up and all your leg work you have done to make the PrintrBoard function.

          I am new to the C\C++\Arduino programming. I am attempting assist our customer with the set up of the Sprinter\Arduino programming. My limited experience is showing.

          My problem is that Arduino(1.0.1,-0022, or -0023 in WIN XP Pro SP3) and Sprinter(kliment-Sprinter-de2feb0) fail to link. Here is what I am seeing:
          “In file included from arc_fuc.cpp:26:/ Sprinter.h:6:23: warning: Arduino.h: no such file or directory”. There are several other errors, two more state “no Arduino file or directory”. I am an electronics technician by trade, an Arduino fan by hobby.
          Any assistance would be greatly appreciated!!!

          • lincomatic says:

            Arduino.h is part of Arduino 1.0+. For older versions of Arduino, it should include WProgram.h instead.
            It’s possible that the particular snapshot of Sprinter you downloaded has compile issues.
            Can you try downloading a different version? Also, you can
            try using my Arduino setup and see if that works better. http://www.reprap-usa.com/download/arduino0022.zip

  • Dave says:

    Thanks for answering.
    I downloaded the Arduino-0022 from RepRap this morning, just found it.
    I will get another version of Sprinter when I’m done answering this blog.
    I also downloaded your Marlin RC2 firmware and am attempting to just get a good download at this time.

  • Dave says:

    I took your advice to use all your modified software and an older version of Sprinter, succeeded in programming the first production unit.
    What had me stopped for a while was initialization errors with avrdude5.5. I pulled a stupid tech trick and placed the usbtinyusb 6 pin cable backwards on the header!

    We are currently doing setup for the functional test.

    I wish to thank you again for your assistance of this blog site and your reply.

  • Dave says:

    I work for AMIEMS,Inc, a contract electronics manufacturing and services provider.
    This product is for a 3D printer company( cannot disclose name). I am the lead electronics tech for the Test Dept.

  • Dave says:

    I forgot, we out of Winthrop,Maine.

  • Dave says:

    Let me know when you may need us and I can set you up with our Sales staff.

  • Andrew says:

    I don’t know if this matters for USBtiny but I was having a heck of a time trying to program the bootloader onto my Printrboard (rev D) it was taking 3 hours to run and still not working and all I had to do was add -u (turns off safe mode) to the avrdude commands (for setting fuses and programming the bootloader) and everything worked perfectly in 30 seconds.

    Hope this helps

    • Andrew says:

      Just to clarify the first sentence, I was programming with the the Pololu AVR programmer so I don’t know if the -u is also needed for the USBtiny or not

      • lincomatic says:

        That’s strange. -u turns off checking that fuse bits didn’t get corrupted.
        Are you sure your fuse bits didn’t get changed?
        I don’t have to use that w/ USBtinyISP.

  • Andrew says:

    When I would run it without the -u command, I would (only sometimes which is strange) get a response saying that the fuse bits had been changed to 2 and if I wanted to change them back to 0x9B or whatever and I would say ‘y’ and then it would just timeout for a long time and nothing would happen.

  • Dave says:

    Andrew, it might help you to use -e instead of -u. E.g., if you want to rewrite all the flash and EEPROM. I had to erase and then load fuse bits, then used CDCBootloader.hex. It looked like this:
    avrdude -c usbtiny -p at90usb1286 -e -U lfuse:w:0xde:m -U hfuse:w:0xdb:m -U efuse:w:0xf8:m
    It really helps to clear those lock bits first. remember, the AT90USB1286 comes preloaded with HID bootloader and lock bits set so to not allowed accidental erase or rewrite

  • James says:

    alright soooo heres my issue and no can seem to figure it out.. lastely me.. i need marlin firmware but i also what to be able to directly upload from Arduino IDE.. so i wen’t and got a stock copy of 022 then got teensydunio for that version of IDE. downloaded my firmware from your github.. complied it without errors.. but it for the life of me will not uploadfirmware to the board. I have the jump set to boot into the bootloader and it gives this error
    “avrdude: ser_open(): can’t set dtr for “\\.\COM2″
    which is the com port my board is on. so i don’t know whats up.. here my pastebin of flashing your BootloaderCDC.

    http://pastebin.com/P6Wz9AHR

    any help would be appricated

    • lincomatic says:

      1) are you sure the boot jumper is in the correct position? if in doubt, try both. on my Windows machine, the com port number changes between the two settings
      2) have you followed the instructions in the RepRap wiki?
      3) please try using my pre-hacked arduino-0022.. there’s a link from RepRap USA in the comments section of this article
      http://blog.lincomatic.com/?p=537

      • James says:

        So I went and grabbed that copy of the arduino from RepRap USA.. and i did a file compare to mine from yours and it turns out your version has the avrdude.exe in it that is newer than the one in mine.. so i tried your copy.. uploads fine.. so i copied the avrdude and other avr files from the RepRap USA copy to my copy of arduino-0022 now my copy uploads fine.. think just an older version of avrdude caused my issues.

  • Allan Pedersen says:

    Hi

    Newbee to this, so my question might be very simpel.
    I have a printerbot working just fine. Some modifications, but over all super enjoy and introduction to the field 3D printing.
    I like the board printerboard rev D, onboard stepper controllers etc, so I ordered one for other other application and developement.
    I thourght it was very easy to do the first simpel test.
    Compile “blink” with Arduino, and use flip to program the board.
    It seems to work fine, there is just one wrong thing….
    I’m using pin 46 im my file, but seems like the output goes to pin 61
    What am I missing ?
    Tryied selecting different board types in Arduino software.
    Can see hex file changes, but all give output to pin 61 and not 47 as expected.
    Is the board in some way locked

    Allan Pedersen
    Denmark

    • lincomatic says:

      I think maybe you are assuming the logical pin numbers used in Arduino code match the physical pin numbers on the AT90USB1286?
      They are actually arbitrarily assigned by Teensyduino.
      You can find the pin mappings in core_pins.h:
      ////////////////////////////////////
      // Teensy++ 1.0 & 2.0
      ////////////////////////////////////
      #elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
      #define CORE_NUM_TOTAL_PINS 46
      #define CORE_NUM_DIGITAL 38
      #define CORE_NUM_ANALOG 8
      #define CORE_NUM_PWM 9
      #define CORE_NUM_INTERRUPT 8
      #define PIN_D0 0
      #define PIN_D1 1
      #define PIN_D2 2
      #define PIN_D3 3

      so digital 0 = PIN_D0, which is physical pin 25.
      The pins actually end at 45:
      #define PIN_F6 44
      #define PIN_F7 45
      So you can’t use any number higher than 45 for calls to digitalRead()/digitalWrite().
      But if you are using my fastio.h from Marlin, then you can use fastio for
      46 = PE2 = physical pin 43
      47 = PE3 = physical pin 9

      Which pin is pin 61 on Printrboard? I don’t understand the results you are getting.

  • Allan Pedersen says:

    Thanks for reply

    I have found your post on the pin issue.

    Yes was assuming that the logical pin numbers match the physical pin numbers :-)

    I made an error in my post… I’m using pin 39 to the blink test… according to diagram printerboard rev B ( not able to find printerboard rev D diagram ) it should be HotBed ( PC4_A12_0C3C)… but output appears on pin 60 according to diagram E-Therm (PF0-ADC0) . I have changed frequency etc to make sure I’m not getting cheated af something else. I’m using your 0022 Arduino version.

    So I guess it should be okay to use Teensylu\printrboard as selected board in Arduino 0022 to compile, even it is saying CDC Bootloader ? It works fine execpt for the pin issue, witch i’ll have to correct looking to core_pins.h
    After compile, I’m using Flip to program.

    Allan Pedersen
    Denmark

    • lincomatic says:

      Yes, you can use Teesylu/Printrboard CDC to generate the code. The hex file doesn’t care which bootloader you’re using, so you can just use FLIP to upload

  • Allan Pedersen says:

    Hi again,

    Been looking around but not much info other than here :-)
    So what I have to do is #include to my sketch ?

    If I can’t use digitalRead()/digitalWrite() pinmode(), what to use then?

    Allan Pedersen
    Denmark

  • Lincoln says:

    Hi

    I am having a bit of trouble uploading firmware to the printrboard i believe i have the DFU bootloader it even connects to flip. I try an upload with flip and if i have the verify step ticked it comes back with an error if i untick that step i looks like it uploads fine.
    From what i am seeing it looks like the flash is not being erased of written too.

    i have also tried this from a linux box with dfuprogrammer but it look like i am getting the same resolute.

    I have just bought a USBtinyISP to see if i can write it that way.

    does any one hava a suggestion i can try while i am waiting for the USBtinyISP to arrive.

    I have a rev B board and have tried uploading a hex file i created and the default firmware that came with the board.

    also the board only talks to me when i am in the bootloader and won’t talk to me when booting the firmware.

    Thank for the info this has been one of the most help places to understanding the printrboard.

    Lincoln

  • Lincoln says:

    I got the printrboard from printrbot and from what i have been reading that is what is loaded on all of theres.

    Do you know a way i can find out the bootloader version?

    Thanks
    Lincoln

    • Dave says:

      Lincoln,
      You may be able to verify the firmware bootloader version by verifying it against the one you think it is (DFU,CDC,HID) with Arduino software. If you use an Atmel programmer, you can read the file and verify with Atmel Studio. I can’t remember if you can how to verify using WinAVR.

      • lincomatic says:

        Actually, it’s avrdude that can help. To check for CDC:

        avrdude -c avr109 -p at90usb1286 -P\\.\comX

        replace X with your comm port number

        It’s very unlikely that the HID bootloader is installed, but if you want to test, try my instructions for hid_bootloader_cli above.

  • Dave says:

    Sorry about that about the avrdude. I went back and saw the mistake. I had the flu last week and some things got messed up. Did Lincoln get his problem solved?

    • lincomatic says:

      I’m not sure, he never replied.

      • Lincoln says:

        Hi guys

        After a bit more digging in found out that I some how had locked parts of the flash.
        I was using the right tools to talk to the printrboard but it just wouldn’t wipe or write.

        I only got this fixed after getting my USBtinyISP and flashing the bootloader from this Page is am now using the dfu bootloader and have flashed the repetier firmware by the bootloader.

        Does anyone have an idea on the commands for flashing a firmware by the USBtinyISP?

        Thanks for putting up this information this the only place I have found with any information that has been any help.

        Thanks again
        Lincoln

  • Ward says:

    Hi,

    I have a V2 Linear Prusa wired up with printrboard (CDC), Got all the programs running and compiled sprinter succesfully. (Arduino 0023) installed all programs and files stated here. As I read above, I’m having the same problem, arduino returns:

    ” avrdude: ser_open(): can’t set dtr for “\\.\COM5″ ”

    after upload. (the compile works fine though)
    Normal printrboard state will connect with com4 on my pc and when booting it changes to com5 like it sould.

    For James updating the avrdude.exe, and the files fixed the problem,
    becuase I use arduino 0023 I can’t use these (I tryed, gave me version errors)

    Could I try something else to fix this specific error?

    Thanks in advantage.
    Regards,

    Ward

  • Andrei says:

    My (official) Pintrboard (revD) locked itself, and I used Atmel’s MK2 programmer and AtmelStudio6.1 to erase the lock bits and reinstall DFU bootloader.
    The PB now no longer connects to the computer (does not appear in Device Manager, Win7) in either boot_mode/normal_mode.

    Maybe I need to fix CKSEL and BOOTRST? I hope lincomatic or others can chime in before I brick my board.
    Here’s what my fuse values are now:

    BODLEVEL: 2V6 (options: disable, 2V0, 2V2, 2V4, 2V6, 3V4, 3V5, 4V3)
    HWBE: enable
    OCDEN: disable
    JTAGEN: enable
    SPIEN: enable
    WDTON: disable
    EESAVE: disable
    BOOTSZ: 4096W_F000 (options: 512W_FE00, 1024W_FC00, 2048W_F800, 4096W_F000)
    BOOTRST: disable
    CKDIV8: enable
    CKOUT: disable
    SUT_CKSEL: EXTOSC_8MHZ_258CK_65MS (options: EXTCLK_6CK_0MS, EXTCLK_6CK_4MS1, EXTCLK_6CK_65MS, INTRCOSC_6CK_0MS, INTRCOSC_6CK_4MS1, INTRCOSC_6CK_65MS, EXTLOFXTAL_32KCK_0MS_INTCAP, EXTLOFXTAL_32KCK_4MS1_INTCAP, EXTLOFXTAL_32KCK_65MS_INTCAP, EXTLOFXTAL_1KCK_0MS_INTCAP, EXTLOFXTAL_1KCK_4MS1_INTCAP, EXTLOFXTAL_1KCK_65MS_INTCAP, EXTLOFXTAL_32KCK_0MS, EXTLOFXTAL_32KCK_4MS1, EXTLOFXTAL_32KCK_65MS, EXTLOFXTAL_1KCK_0MS, EXTLOFXTAL_1KCK_4MS1, EXTLOFXTAL_1KCK_65MS, EXTXOSC_0MHZ4_0MHZ9_258CK_4MS1, EXTXOSC_0MHZ4_0MHZ9_258CK_65MS, EXTXOSC_0MHZ4_0MHZ9_1KCK_0MS, EXTXOSC_0MHZ4_0MHZ9_1KCK_4MS1, EXTXOSC_0MHZ4_0MHZ9_1KCK_65MS, EXTXOSC_0MHZ4_0MHZ9_16KCK_0MS, EXTXOSC_0MHZ4_0MHZ9_16KCK_4MS1, EXTXOSC_0MHZ4_0MHZ9_16KCK_65MS, EXTXOSC_0MHZ9_3MHZ_258CK_4MS1, EXTXOSC_0MHZ9_3MHZ_258CK_65MS, EXTXOSC_0MHZ9_3MHZ_1KCK_0MS, EXTOSC_0MHZ9_3MHZ_1KCK_4MS1, EXTXOSC_0MHZ9_3MHZ_1KCK_65MS, EXTXOSC_0MHZ9_3MHZ_16KCK_0MS, EXTXOSC_0MHZ9_3MHZ_16KCK_4MS1, EXTXOSC_0MHZ9_3MHZ_16KCK_65MS, EXTXOSC_3MHZ_8MHZ_258CK_4MS1, EXTXOSC_3MHZ_8MHZ_258CK_65MS, EXTXOSC_3MHZ_8MHZ_1KCK_0MS, EXTXOSC_3MHZ_8MHZ_1KCK_4MS1, EXTXOSC_3MHZ_8MHZ_1KCK_65MS, EXTXOSC_3MHZ_8MHZ_16KCK_0MS, EXTXOSC_3MHZ_8MHZ_16KCK_4MS1, EXTXOSC_3MHZ_8MHZ_16KCK_65MS, EXTXOSC_8MHZ_XX_258CK_4MS1, EXTXOSC_8MHZ_XX_258CK_65MS, EXTXOSC_8MHZ_XX_1KCK_0MS, EXTXOSC_8MHZ_XX_1KCK_4MS1, EXTXOSC_8MHZ_XX_1KCK_65MS, EXTXOSC_8MHZ_XX_16KCK_0MS, EXTXOSC_8MHZ_XX_16KCK_4MS1, EXTXOSC_8MHZ_XX_16KCK_65MS)

    Fuse registers:
    EXTENDED: 0xF3
    HIGH: 0×99
    LOW: 0x5E

    Any help is appreciated!

  • Andrei says:

    The Printrboard Wiki is what confused me.
    http://reprap.org/wiki/Printrboard

    It recommends using your settings (except with JTAG enabled) for CDC and HID bootloaders, but a different set of fuse values for DFU bootloader. I am currently using DFU with the standard CDC settings and it works perfectly again.

    LOW: 0xde
    HIGH: 0x9b (same as yours except with JTAG enabled)
    EXTENDED:0xf0

    Thank you for the help!

  • Bill Dreschel says:

    Hi Lincomatic,
    You could consider the Caterina/LUFA bootloader used with Arduino Micro (ATMega32U4) also…

    I am looking into doing a port of the Arduino Micro bootloader (Caterina/LUFA) to a Teensy 2.0++. (http://www.adafruit.com/products/1315)

    I like the fact that the Micro supports a software reset (1200 baud switch) which eventually goes to the user program (like the original Arduino DTR toggle trick) and that I could use the Arduino IDE with or without Teensyduino. In fact the software reset is the whole reason I am looking into this. Using Win7/C# I have had no luck getting HalfKay to reset to a user program on Teensy 2.0++.

    I think I can handle the bootloader recompiling for ATMega1286 and ISP loading to the Teensy2.0++. But I have a question you may be able to answer: where do you think the 1200 baud switch is interpreted for the reset function? I did not see it in the bootloader code and wonder if its embedded in a resident USB driver somewhere. Any insight you could give would be greatly appreciated.
    Thanks,
    Bill

  • Nuno says:

    Hello!

    I have Printrboard Rev.D, and the first time i plugged it to my pc tried with repetier-host and couldn’t move my printer.

    Now i’m trying to do your tutorial to load bootloader and firmware.
    I’ve tried with windows7 and ubuntu, usbtinyIsp and arduino as an isp, trough avrdude and arduino Ide, and still i can’t program it.
    Here is the code of my last attempt nuno@npc:~/Desktop$ sudo avrdude -c avrisp -P /dev/ttyACM0 -p at90usb1286 -F -D -U flash:w:BootloaderCDC.hex:i
    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.01s

    avrdude: Device signature = 0x000000
    avrdude: Yikes! Invalid device signature.
    avrdude: Expected signature for AT90USB1286 is 1E 97 82
    avrdude: reading input file "BootloaderCDC.hex"
    avrdude: writing flash (131072 bytes):

    Writing | ################################################## | 100% 0.57s

    avrdude: 131072 bytes of flash written
    avrdude: verifying flash memory against BootloaderCDC.hex:
    avrdude: load data flash data from input file BootloaderCDC.hex:
    avrdude: input file BootloaderCDC.hex contains 131072 bytes
    avrdude: reading on-chip flash data:

    Reading | ################################################## | 100% 14.68s

    avrdude: verifying ...
    avrdude: verification error, first mismatch at byte 0x0000
    0xff != 0xa5
    avrdude: verification error; content mismatch

    avrdude: safemode: Fuses OK

    avrdude done. Thank you.

    nuno@npc:~/Desktop$ sudo avrdude -c avrisp -P /dev/ttyACM0 -p at90usb1286 -F -U flash:w:Repetier.cpp.hex

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.01s

    avrdude: Device signature = 0x000000
    avrdude: Yikes! Invalid device signature.
    avrdude: Expected signature for AT90USB1286 is 1E 97 82
    avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
    To disable this feature, specify the -D option.
    avrdude: erasing chip
    avrdude: reading input file "Repetier.cpp.hex"
    avrdude: input file Repetier.cpp.hex auto detected as Intel Hex
    avrdude: writing flash (59902 bytes):

    Writing | ################################################## | 100% 8.15s

    avrdude: 59902 bytes of flash written
    avrdude: verifying flash memory against Repetier.cpp.hex:
    avrdude: load data flash data from input file Repetier.cpp.hex:
    avrdude: input file Repetier.cpp.hex auto detected as Intel Hex
    avrdude: input file Repetier.cpp.hex contains 59902 bytes
    avrdude: reading on-chip flash data:

    Reading | ################################################## | 100% 6.71s

    avrdude: verifying ...
    avrdude: verification error, first mismatch at byte 0x0000
    0x0c != 0xa5
    avrdude: verification error; content mismatch

    avrdude: safemode: Fuses OK

    avrdude done. Thank you.

    Have i messed up with the fuses in the proccess?
    Or is something that i missed?
    Any help would be very appreciated!
    Regards Nuno

    • lincomatic says:

      It’s possible that the fuses are messed up. Either that, or the connection of the USBtinyISP is loose.
      Did you reprogram the fuses? If so, what command line did you use, and did it show any errors?
      BTW, you shouldn’t bother trying to force it. If your device signature is wrong, the communication is messed up, and you won’t get good results.

  • Jeffery Short says:

    I’m trying to load the CDC bootloader using the following command:

    avrdude -c usbtiny -p at90usb1286 -U flash:w:BootloaderCDC.hex:i

    the problem I’m having is that it keeps telling me that there is no BootloaderCDC.hex file or directory. Is there somewhere I need to install it? I am working in a windows 7 environment and it’s been awhile since I’ve done anything in a command line. Any help will be appreciated, thanks

  • Jeffery Short says:

    I have Marlin firmware installed, but when I try to use Pronterface to control printer it goes haywire. It seem like the stepper motors run backwards and if I try to operate the extruder everything locks up. By the way, my printer is a mini Kossel delta; I don’t know if that is what is causing the problems. Any ideas?

  • lincomatic says:

    You need to configure it properly. The parameters are all in Configuration.h.
    Sorry, it’s very complicated. I can’t walk you through it. I suggest that you contact your vendor or ask on the reprap.org forum for help.

  • Wayne Friedt says:

    Hi When i try to load the firmware into Printrboard rev E i get an error in the command prompt that says, error reading intel hex file “firmware.ccp.hex”

    I suspect i am not naming the file correctly so that they match. What should the file names be so it will be recognized in the command prompt.

    Thank You

    • lincomatic says:

      What is the name of your hex file? You have to substitute it where I typed “firmware.hex.”

      • Wayne Friedt says:

        It is Marlin.cpp.hex. I made the file and the address in the command prompt match.
        Didn’t fix the error. I tried Marlin.hex for both. I still believe it my naming that is causing the errors but i just have’t gotten the correct combination yet.
        Can the hex file name be most anything as long as they match, The one in the HID folder and the one in the command prompt?

  • Craig says:

    Hello! I don’t know if you can help me or not, but I’m struggling with getting the firmware to upload onto my printrboard rev D.

    I’ve tried both on mac and win7, using AVRDUDE and an usbtinyISP, I can flash the boot loader (have tried CDC and DFU) and everything appears to work fine. It does get the validation error, but as you said, you can safely ignore. Here is where the problem lies…

    Neither the mac nor the windows machine will recognize the printrboard from the USB port. I have tried to follow everything I can find to the letter, but no luck. I am doing the jumper / reset as well.

    With the DFU installed, Flip doesn’t recognize the printrboard when plugged in.
    With CDC installed, no port is recognized on either the mac or the windows machine. It wasn’t clear whether or not I was supposed to run avrdude -c avr109 through the USBtinyISP to ISCP or through the onboard USB, but neither seems to work.

    I’m hoping you have something else I might be able to try. This all started with me attempting to update the firmware via FLIP and finding that it was locked.

    Thank you!!

    • lincomatic says:

      Do you still have the jumper set to program the bootloader? The computer can’t detect it otherwise.
      On the RevD-E, you have to remove the jumper to load the firmware (the opposite of RevA-C).

Write a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>