How to change Bootloader ?

85 views
Skip to first unread message

NikolayM

unread,
Oct 17, 2012, 12:08:46 PM10/17/12
to microp...@googlegroups.com
Hello,

I seems that I have stock Atmel USB bootloader in my new Micropendous board rev.2011-06-24, 
as I see bootloader ver. 1.0.1 at Flip and Keyboard test program doesn't work..

Can I write LUFA to 90usb1287 without external programmer?

I'been searching whole evening, but all I've found arduino guys succeded with their own board:
I feel we can do the same, can you help with step-by-step instructions?
I don't plan to burn something.

It would be nice for beginners like me, if you put new chapter to wiki about bootloaders.
- Differences (lufa, Atmel)
- What restrictions we face while programming
I'm just starting to learn AVR's and It will help me to understand how it works and to choose right one.

Can we translate example program for another bootloader?

Thank you!




Opendous Inc.

unread,
Oct 17, 2012, 1:56:38 PM10/17/12
to Micropendous
>rev.2011-06-24 ... Keyboard test program doesn't work...

I will look into this right away. Does the 2011-03-01 KeyboardTest
version also not work?
http://code.google.com/p/micropendous/downloads/detail?name=Micropendous-2011-03-01.zip

>Can I write LUFA to 90usb1287 without external programmer?

Of course, that is what the bootloader is for. It should be on
there. Can you enter DFU mode? What happens at step 5 of the
following. It should something like the picture from step 9:
http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP

More detailed instructions:
http://code.google.com/p/micropendous/wiki/WindowsQuickStart#Did_FLIP_Install_Correctly?
http://code.google.com/p/micropendous/wiki/ProgramAndTestWindows
http://sourceforge.net/projects/winavr/
http://www.atmel.com/tools/flip.aspx

>put new chapter to wiki about bootloaders
> - Differences (lufa, Atmel)
> - What restrictions we face while programming

LUFA is Open Source while the Atmel Bootloader source is available?
(I'm not sure about this) but only for use with AVR products, so not
portable. The LUFA Bootloader is sometimes flaky depending on the USB
AVR it is used with though usually fine with the AT90USB1287 since it
is developed with it.

The Atmel Bootloader disables FLASH read-back so you have to do a
chip erase before reprogramming. LUFA is open by default to simplify
development.

As for updating the bootloader without an external programmer, Dean
Camera has implemented an API so that indeed non-writable FLASH could
be updated from the writable FLASH section. However, you still need
to get the LUFA Bootloader onto the board initially. The Atmel
Bootloader would never implement such a feature since it is a huge
security hole. You could easily clone proprietary firmware.
http://code.google.com/p/lufa-lib/source/browse/trunk/Bootloaders/DFU/BootloaderAPITable.S

To update the Bootloader you could use JTAG or the SPI port and the
RESET pin (on the JTAG header) for ISP Programming with avrdude using
another USB AVR board or any other AVR programmer.
http://code.google.com/p/micropendous/wiki/AVRISP
http://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descriptions

>I'm just starting to learn AVR's and It will help me
>to understand how it works and to choose right one.

The Atmel Bootloader is on the ICs by default so if you plan to
create a product you will need to figure out how to deal with it
eventually. The LUFA Bootloader is Open Source. From a programmer
perspective they are both transparent. Even if you think you have a
programming error you would usually just load your firmware again
instead of checking what is on the IC.

Николай Маров

unread,
Oct 17, 2012, 3:46:52 PM10/17/12
to microp...@googlegroups.com
Thanks for fast reply!

Actually, everything seems to be Ok, aslo when assembling with command line.
Program starts running (LED is green) but when pressing HWB - nothing happens.
I just tried keyboard test from 11-03-01, as you asked. I noticed only memory address is different - when programm memory ... passed.
I'm using windows7 - no problems with it?

Creating load file for Flash: MicropendousKeyboardTest.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock MicropendousKeyboardTest.elf Mi
cropendousKeyboardTest.hex
batchisp -hardware usb -device at90usb1287 -operation erase f
Running batchisp 1.2.5 on Wed Oct 17 23:16:01 2012



AT90USB1287 - USB - USB/DFU


Device selection....................... PASS
Hardware selection..................... PASS
Opening port........................... PASS
Reading Bootloader version............. PASS    1.0.1
Erasing................................ PASS

Summary:  Total 5   Passed 5   Failed 0
batchisp -hardware usb -device at90usb1287 -operation loadbuffer MicropendousKey
boardTest.hex program
Running batchisp 1.2.5 on Wed Oct 17 23:16:04 2012



AT90USB1287 - USB - USB/DFU


Device selection....................... PASS
Hardware selection..................... PASS
Opening port........................... PASS
Reading Bootloader version............. PASS    1.0.1
Parsing HEX file....................... PASS    MicropendousKeyboardTest.hex
Programming memory..................... PASS    0x00000 0x0118d

Summary:  Total 6   Passed 6   Failed 0
batchisp -hardware usb -device at90usb1287 -operation start reset 0
Running batchisp 1.2.5 on Wed Oct 17 23:16:04 2012



AT90USB1287 - USB - USB/DFU


Device selection....................... PASS
Hardware selection..................... PASS
Opening port........................... PASS
Reading Bootloader version............. PASS    1.0.1
Starting Application................... PASS    RESET   0

Summary:  Total 5   Passed 5   Failed 0

C:\Users\petmarovni\Downloads\Micropendous-2011-03-01\Micropendous\Firmware\Micr
opendousKeyboardTest>batchisp
Error: No argument found.
Type batchisp -h for help

2012/10/17 Opendous Inc. <open...@gmail.com>

Opendous Inc.

unread,
Oct 17, 2012, 4:14:27 PM10/17/12
to Micropendous
So it loads OK but HWB does nothing? Try pressing RESET after
programming. Pressing HWB should type "e2" as if the Micropendous
were a keyboard. With some sort of text editor opened and the
Micropendous running the KeyboardTest firmware, take a short piece of
wire and connect GND (on the POWER header) to an IO pin (any numbered
pin on the upper headers will do). It should type the corresponding
pin name.

Did Windows ask to load drivers for the keyboard?
> 2012/10/17 Opendous Inc. <opend...@gmail.com>
>
> > >rev.2011-06-24 ... Keyboard test program doesn't work...
>
> > I will look into this right away. Does the 2011-03-01 KeyboardTest
> > version also not work?
>
> >http://code.google.com/p/micropendous/downloads/detail?name=Micropend...
>
> > >Can I write LUFA to 90usb1287 without external programmer?
>
> > Of course, that is what the bootloader is for. It should be on
> > there. Can you enter DFU mode? What happens at step 5 of the
> > following. It should something like the picture from step 9:
> >http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP
>
> > More detailed instructions:
>
> >http://code.google.com/p/micropendous/wiki/WindowsQuickStart#Did_FLIP...
> > ?
> >http://code.google.com/p/micropendous/wiki/ProgramAndTestWindows
> >http://sourceforge.net/projects/winavr/
> >http://www.atmel.com/tools/flip.aspx
>
> > >put new chapter to wiki about bootloaders
> > > - Differences (lufa, Atmel)
> > > - What restrictions we face while programming
>
> > LUFA is Open Source while the Atmel Bootloader source is available?
> > (I'm not sure about this) but only for use with AVR products, so not
> > portable. The LUFA Bootloader is sometimes flaky depending on the USB
> > AVR it is used with though usually fine with the AT90USB1287 since it
> > is developed with it.
>
> > The Atmel Bootloader disables FLASH read-back so you have to do a
> > chip erase before reprogramming. LUFA is open by default to simplify
> > development.
>
> > As for updating the bootloader without an external programmer, Dean
> > Camera has implemented an API so that indeed non-writable FLASH could
> > be updated from the writable FLASH section. However, you still need
> > to get the LUFA Bootloader onto the board initially. The Atmel
> > Bootloader would never implement such a feature since it is a huge
> > security hole. You could easily clone proprietary firmware.
>
> >http://code.google.com/p/lufa-lib/source/browse/trunk/Bootloaders/DFU...
>
> > To update the Bootloader you could use JTAG or the SPI port and the
> > RESET pin (on the JTAG header) for ISP Programming with avrdude using
> > another USB AVR board or any other AVR programmer.
> >http://code.google.com/p/micropendous/wiki/AVRISP
>
> >http://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descr...

Николай Маров

unread,
Oct 17, 2012, 11:02:15 PM10/17/12
to microp...@googlegroups.com
I tryed reset, of course. When I download firmware , DFU device disappear from system, 
but Windows doesn't see any new device connected.
Just nothing happens, except led lights green on the board, not blinking.
What else I could do wrong?

2012/10/18 Opendous Inc. <open...@gmail.com>

Opendous Support

unread,
Oct 18, 2012, 1:40:00 AM10/18/12
to Micropendous
Do you have a REV1 or REV2 Micropendous board?
http://code.google.com/p/micropendous/wiki/Micropendous
http://code.google.com/p/micropendous/wiki/MicropendousREV1

It sounds like the firmware is loading and the Bootloader works but
the firmware isn't working as expected. Most likely this is a
makefile issue. In the makefile, are the following set:
MCU = at90usb1287
F_CPU = 16000000
BOARD = MICROPENDOUS


On Oct 17, 11:02 pm, Николай Маров <marovn...@gmail.com> wrote:
> I tryed reset, of course. When I download firmware , DFU device disappear
> from system,
> but Windows doesn't see any new device connected.
> Just nothing happens, except led lights green on the board, not blinking.
> What else I could do wrong?
>
> 2012/10/18 Opendous Inc. <opend...@gmail.com>

Николай Маров

unread,
Oct 18, 2012, 2:18:08 AM10/18/12
to microp...@googlegroups.com
I tryed both USER and MICROPENDOUS as BOARD, result is same.
I didn't touch other parameters in makefile, besides those 3. Any other Ideas?
Is there any other example to test fast if board works fine?
I have REV2, blue colored with PCI-e x1 connector - what is purpose of it?

2012/10/18 Opendous Support <opendous...@gmail.com>

Opendous Inc.

unread,
Oct 18, 2012, 4:13:48 PM10/18/12
to Micropendous
Try compiling and loading the USBVirtualSerial firmware:
http://code.google.com/p/micropendous/wiki/SerialPortUsageWindows

The PCIe x1 is meant for cheap and simple modules. Since edge card
boards don't require a connector the connector is free for modules.
By simple modules I mean components that only require a simple
interface like SPI, UART, or I2C with one or two GPIO pins and power.
For example, an LCD module or GPS module. I've hit some snags with
development but plan to continue.
http://code.google.com/p/opennect/wiki/Opennect_MCU
http://opendous.googlecode.com/svn/trunk/Current_Designs/Opennect_Position_System/Opennect_Position_System-Picture.jpg
http://code.google.com/p/opendous/source/browse/trunk/Current_Designs/Opennect-Touchscreen_LCD/

On Oct 18, 2:18 am, Николай Маров <marovn...@gmail.com> wrote:
> I tryed both USER and MICROPENDOUS as BOARD, result is same.
> I didn't touch other parameters in makefile, besides those 3. Any other
> Ideas?
> Is there any other example to test fast if board works fine?
> I have REV2, blue colored with PCI-e x1 connector - what is purpose of it?
>
> 2012/10/18 Opendous Support <opendous.supp...@gmail.com>

Opendous Support

unread,
Oct 18, 2012, 11:15:39 PM10/18/12
to microp...@googlegroups.com
I have begun updating the Micropendous distribution to the latest
LUFA SVN code and it currently contains a thoroughly tested version of
MicropendousKeyboardTest. I have also attached a programming file for
convenience.
http://micropendous.googlecode.com/files/Micropendous-2012-10-18.zip
http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP

Please try the firmware and let me know if you experience any
problems. Which LUFA demo are you most interested in seeing ported
next?
MicropendousKeyboardTest_MICROPENDOUS_REV2.hex

Николай Маров

unread,
Oct 19, 2012, 3:01:52 AM10/19/12
to microp...@googlegroups.com
Now it works.

Please tell me what you've done.
Why it didn't work? It will help avoid it in my own firmwares.

Thank you very much for fast support!

AT90USB1287 - USB - USB/DFU


Device selection....................... PASS
Hardware selection..................... PASS
Opening port........................... PASS
Reading Bootloader version............. PASS    1.0.1
Erasing................................ PASS
Parsing HEX file....................... PASS    MicropendousKeyboardTest.hex
Programming memory..................... PASS    0x00000 0x01241

Summary:  Total 7   Passed 7   Failed 0
batchisp -hardware usb -device at90usb1287 -operation start reset 0
Running batchisp 1.2.5 on Fri Oct 19 10:52:44 2012



AT90USB1287 - USB - USB/DFU


Device selection....................... PASS
Hardware selection..................... PASS
Opening port........................... PASS
Reading Bootloader version............. PASS    1.0.1
Starting Application................... PASS    RESET   0

Summary:  Total 5   Passed 5   Failed 0

C:\Users\petmarovni\Downloads\Micropendous-2012-10-18\Micropendous\Firmware\Micr
opendousKeyboardTest>e2e2e2e2e2e2e2


2012/10/19 Opendous Support <opendous...@gmail.com>

Opendous Support

unread,
Oct 19, 2012, 11:39:24 AM10/19/12
to Micropendous
Basically the keyboard was sending keys non-stop as it was reading a
GPIO pin as low. The OS was ignoring it. It turns out that somewhere
along the line I reversed the meaning of DISABLE_VOLTAGE_TXRX() for
the TXB0108 voltage translator and the 3.3V side was floating and
giving random values. The solution is to either disable the TXB0108
or make sure any pins that you are using are not floating. If a pin
is connected to an external device that isn't disabled the logic state
will be defined (not floating). If the external device can be
disabled, place a pull-down resistor (15k ohm to 100k) from each used
signal pin to GND on the 3.3V side of the TXB0108. The TXB0108 is a
useful feature since it allows communicating with 3.3V native devices
or with minor board modification and external power supply with device
voltages down to 1.2V (but microSD will only work if it is 3.3V).
http://code.google.com/p/micropendous/source/browse/trunk/Micropendous/Firmware/MicropendousKeyboardTest/MicropendousKeyboardTest.c#145

The core differences between LUFA's Keyboard demo and
MicropendousKeyboardTest are in MicropendousKeyboardTest.c:
http://code.google.com/p/micropendous/source/diff?spec=svn851&r=851&format=side&path=/trunk/Micropendous/Firmware/MicropendousKeyboardTest/MicropendousKeyboardTest.c

The Micropendous distribution also contains some changes to the LUFA
library to allow Joystick-using code to at least compile and the
addition of some useful Micropendous-related defines:
http://code.google.com/p/micropendous/source/diff?spec=svn851&r=851&format=side&path=/trunk/Micropendous/libs/LUFA/LUFA/Drivers/Board/Joystick.h
http://code.google.com/p/micropendous/source/browse/trunk/Micropendous/libs/LUFA/LUFA/Common/MicropendousDefines.h
http://code.google.com/p/micropendous/source/browse/trunk/Micropendous/libs/LUFA/LUFA-SVN-r2507.txt

If you want to stick to a LUFA release instead of the latest SVN
code in the Micropendous distribution, just include
MicropendousDefines.h in your code and remove any joystick-related
code. Adding DISABLE_VOLTAGE_TXRX(), DISABLE_EXT_SRAM(), and
SELECT_USB_B() before USB_Init() is a safe precaution.
> 2012/10/19 Opendous Support <opendous.supp...@gmail.com>

Николай Маров

unread,
Oct 20, 2012, 9:46:52 AM10/20/12
to microp...@googlegroups.com
It's a perfect support, thank you!

2012/10/19 Opendous Support <opendous...@gmail.com>
Reply all
Reply to author
Forward
0 new messages