[Solved] USB Bootloader for ATMega 64

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Rukus
Rank 1
Rank 1
Posts: 24
Joined: Tue Nov 06, 2007 10:18 am

[Solved] USB Bootloader for ATMega 64

Post by Rukus » Sat Jan 02, 2010 4:38 am

Does anyone have a USB Boot loader like bootloadHID or anything along those lines for the ATmega 64. I tried several of the ones available here on this website, however I wasn't able to get it to work. I kept getting "Device not Recognised". I modified the proper terms I thought, but couldn't get it running. I have another HID application running on it now and it has no problems so the hardware is right.
Last edited by Rukus on Wed Jan 06, 2010 2:58 pm, edited 2 times in total.

Rukus
Rank 1
Rank 1
Posts: 24
Joined: Tue Nov 06, 2007 10:18 am

Re: USB Bootloader for ATMega 64

Post by Rukus » Sun Jan 03, 2010 6:36 am

I'm able to get bootloadHID.2008-11-26 to enumerate only if I comment out the 2 MCUCR lines below. If I uncomment them it won't enumerate. I have BootRST, and BootSZ1 programmed and the memory settings in AVR Studio for (Flash .bootloader 0x7800). It appears like the interupt vectors are getting stepped on or something. Any help would be appreciated.

Code: Select all

int main(void)
{   
    /* initialize hardware */
    bootLoaderInit();

    /* jump to application if jumper is set */
    if(bootLoaderCondition()){
        uchar i = 0, j = 0;
#ifndef TEST_MODE
        //MCUCR = (1 << IVCE);  /* enable change of interrupt vectors */
        //MCUCR = (1 << IVSEL); /* move interrupts to boot flash section */
#endif
        initForUsbConnectivity();
        do{ /* main event loop */
            usbPoll();

#if BOOTLOADER_CAN_EXIT
            if(exitMainloop){
#if F_CPU == 12800000
                break;  /* memory is tight at 12.8 MHz, save exit delay below */
#endif
               if(--i == 0){
                    if(--j == 0)
                        break;
                }
            }
#endif
        }while(bootLoaderCondition());
    }
    leaveBootloader();
    return 0;
}

Rukus
Rank 1
Rank 1
Posts: 24
Joined: Tue Nov 06, 2007 10:18 am

Re: USB Bootloader for ATMega 64

Post by Rukus » Sun Jan 03, 2010 6:50 am

Found the problem. I read somewhere that the memory area should be defined as ".bootloader". Once I changed this to ".text", everything is working as published. I now have the bootloader working on a mega64 :D

ps2chiper
Posts: 12
Joined: Fri Oct 01, 2010 5:43 pm

Re: [Solved] USB Bootloader for ATMega 64

Post by ps2chiper » Fri Oct 01, 2010 5:47 pm

Could you post your bootloader and what board it is for?

Post Reply