USBaspLoader suggestion

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
spiff
Rank 1
Rank 1
Posts: 24
Joined: Tue Apr 17, 2007 1:00 am
Location: Virum, Denmark
Contact:

USBaspLoader suggestion

Post by spiff » Sun Mar 10, 2013 11:15 pm

Hello.

I have been using USBaspLoader for a couple of my projects over time, and have been quite happy with it. I do have a feature suggestion, though:

I usually do not have a jumper to trigger the boot loader. Instead I use some combination of buttons (usually already on the device), that must be held down while plugging in the device, in order to enter the boot loader.

For instance I have recently been playing with my C64key project, and built a USBaspLoader that is triggered by holding RUN/STOP and RESTORE (this combination seemed appropriate :) ) while plugging in the keyboard. I struggled a while getting the BootLoaderCondition right, but even when that worked, and the boot loader was detected by my PC, I could not make it work. Then I found a document I had written about the changes I made to USBaspLoader, to make it work with my SpiffChorder. I had to make a change in main.c, so that the main while loop would not look at BootLoaderCondition().

The reason is obviously that I use one or more buttons, but the BootLoaderCondition is only true during startup (i.e. when plugging in the device).

So my feature request is: Add a compile-time option (in bootloaderconfig.h) that can change the main while loop to while(1) instead of while(BootLoaderCondition()). This would be nice for everyone who uses a button instead of a jumper to trigger the bootloader, since all changes can then be done in bootloaderconfig.h.

/Spiff

vouvoume

Re: USBaspLoader suggestion

Post by vouvoume » Thu Apr 04, 2013 4:10 pm

Hallo Spiff.

Please take a look into the recent version of USBaspLoader at https://github.com/baerwolf/USBaspLoader.

There you have multiple options (https://github.com/baerwolf/USBaspLoade ... erconfig.h):

A) switch off (see https://github.com/baerwolf/USBaspLoade ... kefile.inc) bootloader_exit via "CONFIG_NO__BOOTLOADER_CAN_EXIT"

B) Use the buttonswitch logic for bootloader condition (instead jumper logic):
(from https://github.com/baerwolf/USBaspLoade ... matics.txt)

The bootloader bootup logic has changed a little bit, compared to the
original JUMPER-logic within original USBaspLoader 2010-07-27.
However most of the new logic is compatible with old JUMPER schematics:

When RESET/PowerUP while BUTTON is pressed (PIN12 is low), then bootloader
will start. Even if the BUTTON is release after this and PIN12 becomes HIGH,
the bootloader stays active and listens to commands as long as the BUTTON
will be pressed (and so PIN12 becomes low) again...

If the BUTTON is NOT pressed at RESET/PowerUP, or pressed again while
in bootloader, the user defined firmware is started.

Best regards,
matrixstorm

Post Reply