nonolith / USB-XMEGA

USB stack for Atmel ATxmega32A4U and related parts
http://nonolithlabs.com
38 stars 13 forks source link

Unable to Enumerate #5

Open LittleFox94 opened 10 years ago

LittleFox94 commented 10 years ago

Hello,

when trying to use the bootloader in this project I ran into a problem with a self-compiled binary. The µC does not show up in lsusb and dmesg gives me the following:

[ 8276.726102] usb 2-4: new full-speed USB device number 43 using ohci-pci [ 8277.134380] usb 2-4: device not accepting address 43, error -62 [ 8277.134413] hub 2-0:1.0: unable to enumerate USB device on port 4

I'm using the AVR8 Toolchain from Atmel with avr-gcc version (AVR_8_bit_GNU_Toolchain_3.4.3_1072) 4.8.1

It works using your given binary, but I have to change the I/O-Pins.

Greetings, LittleFox94

kevinmehall commented 10 years ago

I can reproduce this issue on AVR_8_bit_GNU_Toolchain_3.4.3_1072 for Linux. The switch statement in USB_HandleSetup seems to get miscompiled such that none of the branches run and the function does not return. Fedora's gcc-avr 4.8.2-1.fc19 and Atmel's 3.4.2 toolchain are known to work.

Thalhammer commented 10 years ago

I have the same problem. Using your prebuilt hex it works fine, but it was unable to create a working build on my own. I tried the official atmel toolchain version 3.4.4.1229 and it build just fine, but fails to enumerate the device. Where can i find a compiler that creates a working build ?

Greetings, Thalhammer

//EDIT: Got it working using the toolchain in your PPA at https://launchpad.net/~nonolith/+archive/ubuntu/avr-toolchain/+packages But it would be cool if you could provide it for trusty too.

ahtn commented 7 years ago

Setting the compiler flag -fno-jump-tables fixed this for me. #8

LittleFox94 commented 2 years ago

another note, not sure if it is the original issue but I stumbled upon it recently (using another usb stack, but same principles):

reading from program space is very tricky when in bootloader on xmegas with more than 64KiB memory - it just not works. So if anyone has that problem in a bootloader, your MCU might have too much flash storage :upside_down_face: