Page 1 of 1

USBaspLoader suggestion

Posted: Sun Mar 10, 2013 11:15 pm
by spiff
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

Re: USBaspLoader suggestion

Posted: Thu Apr 04, 2013 4:10 pm
by vouvoume
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