USBaspLoader - Bootloader Emulating USBasp

Registered forum users can contribute their rating for projects based on V-USB in this forum.

Please rate USBaspLoader on a scale from 0 (worst) to 5 (best):

(0)
0
No votes
(1) *
0
No votes
(2) **
0
No votes
(3) ***
0
No votes
(4) ****
0
No votes
(5) *****
7
100%
 
Total votes: 7

christian
Objective Development
Objective Development
Posts: 1335
Joined: Thu Nov 09, 2006 11:46 am

USBaspLoader - Bootloader Emulating USBasp

Postby christian » Mon Jan 21, 2008 7:37 pm

Registered forum users can rate USBaspLoader in the poll above.

To comment on the project, reply to this topic.

Alloc

USBaspLoader with AVR Studio

Postby Alloc » Wed Feb 06, 2008 8:29 pm

Hi,

I'm intending to use USBaspLoader for a introduction on microcontrollers course in my university. I would like to use it with AVR Studio, so my question is whether it can be integrated into the Studio.

Regards,
Chris

christian
Objective Development
Objective Development
Posts: 1335
Joined: Thu Nov 09, 2006 11:46 am

Postby christian » Wed Feb 06, 2008 11:10 pm

Sorry, no. USBaspLoader emulates USBasp which is not supported by AVR Studio, only by avrdude.

It might be possible to emulate an STK500v1 or any other simple programmer instead, but this is not currently available.

Guest

Postby Guest » Thu Feb 07, 2008 10:59 pm

christian wrote:Sorry, no. USBaspLoader emulates USBasp which is not supported by AVR Studio, only by avrdude.


Not sure whether this was a misunderstanding ... ;)
I know that AVRStudio itself can't handle that protocol. But there's at least the SDK for free so I hoped there would be an existing plugin or something like that which would integrate avrdude into AVR Studio. Unfortunately I couldn't find anything by searching in google :(

Chris

christian
Objective Development
Objective Development
Posts: 1335
Joined: Thu Nov 09, 2006 11:46 am

Postby christian » Thu Feb 07, 2008 11:06 pm

I don't think that this has been attempted. It's probably easier to write a boot loader which emulates a programmer known by AVRStudio.

Alloc
Rank 1
Rank 1
Posts: 20
Joined: Tue Feb 19, 2008 10:52 pm
Location: Germany (Hessen)
Contact:

Postby Alloc » Tue Feb 19, 2008 10:55 pm

Hi, me again :lol:

I got my prototype now and flashed USBaspLoader (v 2008-02-05) on it. But Windows doesn't recognize it. It just says "unknown device" (not even the kind of unknown when it asks for drivers...). The board is ok, did run some tests fine. Could you have a look if I made a big mistake on USB side?
(Btw, fuses are the ones that you wrote in the Makefile)

Schematic attached ... erm, no, can't do that here... Uploaded it to http://chrilly.net/board.sch.pdf.

Kindest regards,
Chris

Alloc
Rank 1
Rank 1
Posts: 20
Joined: Tue Feb 19, 2008 10:52 pm
Location: Germany (Hessen)
Contact:

Postby Alloc » Thu Feb 21, 2008 3:28 am

Just added this code

Code: Select all

--i;
if (i == 0) {
   PORTB ^= 0x04;
}

after the "usbPoll();" in main.c to toggle a led on my board. Interestingly it does toggle but only a few times (different each time, 2 to ~5 times).
Any ideas? :cry:

Regards, Chris

christian
Objective Development
Objective Development
Posts: 1335
Joined: Thu Nov 09, 2006 11:46 am

Postby christian » Thu Feb 21, 2008 9:08 pm

Is this your code or a tested example code? If it's your code, I suppose you generate a stack overflow or have an interrupt routine which does not push all registers it uses or something similar.

The 16.5 MHz module had a bug where the interrupt handler did not push all registers as required. This was fixed in the most recent release (2007-02-16).

Alloc
Rank 1
Rank 1
Posts: 20
Joined: Tue Feb 19, 2008 10:52 pm
Location: Germany (Hessen)
Contact:

Postby Alloc » Thu Feb 21, 2008 9:17 pm

I used your USBaspLoader as is from 2008-02-05 (compiled with my settings in bootloaderconfig.h for my pin-assignments). I'm running it at 16 MHz. As it didn't work I just added the LED-flash-code to the main loop in main.c from USBaspLoader (which gave me the 2-5-times flashing behaviour).

christian
Objective Development
Objective Development
Posts: 1335
Joined: Thu Nov 09, 2006 11:46 am

Postby christian » Thu Feb 21, 2008 11:00 pm

Interesting. I'm using it with an ATMega168 design (default configuration in Makefile, as it ships) without problems.

I don't have the time to help you with debugging at the moment. I would recommend that you try to disable features until it works and then re-enable them step by step to find out what's broken. You can also start with a simpler example project to rule out problems in your hardware.

Alloc
Rank 1
Rank 1
Posts: 20
Joined: Tue Feb 19, 2008 10:52 pm
Location: Germany (Hessen)
Contact:

Postby Alloc » Fri Feb 22, 2008 11:09 pm

Hi,

tried PowerSwitch ... it works without any problems.
Then I compared the Makefiles. Only difference I could make out: OBJECTS in PowerSwitch defines usbdrv/usbdrv.o as an additional object (USBaspLoader doesn't. If I add it it gives me a lot of warnings).

main.c-diffs: A few includes. PowerSwitch uses a timer. Besides of that I couldn't make out any major differences. I really don't know what else I could do :(
Disabling features: Are you talking about the bootloader-settings in bootloaderconfig.h? (HAVE_EEPROM_PAGED_ACCESS, HAVE_EEPROM_BYTE_ACCESS, BOOTLOADER_CAN_EXIT) If so, I deactivated them: no difference.

Regards,
Chris

christian
Objective Development
Objective Development
Posts: 1335
Joined: Thu Nov 09, 2006 11:46 am

Postby christian » Fri Feb 22, 2008 11:16 pm

USBaspLoader includes usbdrv.c instead of linking it. This saves a couple of bytes. You therefore should not link it -- it would be included twice.

And yes, I mean the HAVE_EEPROM_PAGED_ACCESS, HAVE_EEPROM_BYTE_ACCESS, BOOTLOADER_CAN_EXIT options.

Other idea: the watchdog may be permanently on for whatever reason. Add a wdt_reset() to the main loop. That could fix it.

Alloc
Rank 1
Rank 1
Posts: 20
Joined: Tue Feb 19, 2008 10:52 pm
Location: Germany (Hessen)
Contact:

Postby Alloc » Fri Feb 22, 2008 11:28 pm

Didn't change anything.

christian
Objective Development
Objective Development
Posts: 1335
Joined: Thu Nov 09, 2006 11:46 am

Postby christian » Fri Feb 22, 2008 11:35 pm

Can you please check the watchdog issue anyway? I had an ATMega88 where the watchdog was always on, regardless of the fuse settings and regardless of wdt_disable() in the firmware.

Alloc
Rank 1
Rank 1
Posts: 20
Joined: Tue Feb 19, 2008 10:52 pm
Location: Germany (Hessen)
Contact:

Postby Alloc » Fri Feb 22, 2008 11:39 pm

Meant that wdt_reset didn't change anything ;)
Same behaviour as before.


Return to “V-USB Project Ratings”

Who is online

Users browsing this forum: No registered users and 1 guest