so. i have to build a project using an 8051-based MCU. (if you're curious, im (trying to) build a keyboard from scratch and use my own firmware). and i have don't have school next week, so we got a board that we can use at home. so, me being paranoid as i am, i double checked the board that it really works before i left. so i flash something (also on the topic of flashing i need to make a post about dfup lol), execute it, and read it back. the board worked without a problem!
so i get home, get my own usb-b cable (the boards are quite a bit old), plug it into my laptop (the same one i used at school) and i get this nice error message:
no device present.
uh. not good. so i check lsusb, and. uh. where is the board. i check dmesg, nothing. uhhh. not good. the board is still running the program i flashed earlier (i saw the LEDs counting in binary) but uh. where is the board.
then i realize that i am dumb and forgot to flick the programming mode switch. (it has that so you can use the same USB controller for debugging and. well. being a USB controller).
so i unplug it, switch to programming mode, and try something. i flash it, and:
no device present.
bruh. so i get my other usb-b cable. still, same result. not good. so i check dmesg:
[ 394.521536] usb 3-2: new full-speed USB device number 26 using xhci_hcd [ 394.671640] usb 3-2: device descriptor read/64, error -71 [ 394.941638] usb 3-2: device descriptor read/64, error -71 [ 395.211427] usb 3-2: new full-speed USB device number 27 using xhci_hcd [ 395.381553] usb 3-2: device descriptor read/64, error -71 [ 395.661695] usb 3-2: device descriptor read/64, error -71 [ 395.782326] usb usb3-port2: attempt power cycle [ 396.261399] usb 3-2: new full-speed USB device number 28 using xhci_hcd [ 396.261769] usb 3-2: Device not responding to setup address. [ 396.481743] usb 3-2: Device not responding to setup address. [ 396.701490] usb 3-2: device not accepting address 28, error -71 [ 396.861416] usb 3-2: new full-speed USB device number 29 using xhci_hcd [ 396.861819] usb 3-2: Device not responding to setup address. [ 397.081834] usb 3-2: Device not responding to setup address. [ 397.301439] usb 3-2: device not accepting address 29, error -71 [ 397.301696] usb usb3-port2: unable to enumerate USB device
uh oh. that is not good. not at all. so i kinda panicked, so i got another PC to test it:
[ 90.853230] usb 1-1.4: new full-speed USB device number 9 using ehci-pci [ 90.933229] usb 1-1.4: device descriptor read/64, error -32 [ 91.121225] usb 1-1.4: device descriptor read/64, error -32 [ 91.309217] usb 1-1.4: new full-speed USB device number 10 using ehci-pci [ 91.389232] usb 1-1.4: device descriptor read/64, error -32 [ 91.577225] usb 1-1.4: device descriptor read/64, error -32 [ 91.685458] usb 1-1-port4: attempt power cycle [ 92.289228] usb 1-1.4: new full-speed USB device number 11 using ehci-pci [ 92.705224] usb 1-1.4: device not accepting address 11, error -32 [ 92.785229] usb 1-1.4: new full-speed USB device number 12 using ehci-pci [ 93.201161] usb 1-1.4: device not accepting address 12, error -32 [ 93.201349] usb 1-1-port4: unable to enumerate USB device [ 116.481228] usb 2-1.3: new full-speed USB device number 5 using ehci-pci [ 116.561228] usb 2-1.3: device descriptor read/64, error -32 [ 116.749191] usb 2-1.3: device descriptor read/64, error -32 [ 116.937224] usb 2-1.3: new full-speed USB device number 6 using ehci-pci [ 117.017251] usb 2-1.3: device descriptor read/64, error -32 [ 117.205227] usb 2-1.3: device descriptor read/64, error -32 [ 117.313361] usb 2-1-port3: attempt power cycle [ 117.917229] usb 2-1.3: new full-speed USB device number 7 using ehci-pci [ 118.333229] usb 2-1.3: device not accepting address 7, error -32 [ 118.413227] usb 2-1.3: new full-speed USB device number 8 using ehci-pci [ 118.829230] usb 2-1.3: device not accepting address 8, error -32 [ 118.829468] usb 2-1-port3: unable to enumerate USB device
ohhh fuck. that seems like the thing is dead. i thought it might be a USB 3 thing, so i tested it on my usb 2 port again, still nothing. so the USB is dead.
so i was pretty sure i was fucked. tried contacting my teacher, already offline. tried contacting someone else, already gone. fuck. i had to come up with something.
funny thing about this board: it is so old that it has RS232 support. but the parts for a port were missing, but i have a bunch of old pc parts at home so it might work. so i check if DFUP has RS232 support. and nope. so i'm stuck with the godawful flashing software by atmel, that barely even works. so i get a RS232 adapter, plug it into my PC, select serial. and it just freezes for a solid two minutes and then tells me that there are no RS232 ports. ohhh fuck. but i do have one laptop that has RS232, but that doesnt have windows installed (and yes, atmel flip requires windows for flashing. it has a linux version but thats completely broken). so i have to:
- get a RS232 part
- find a MAX232
- install windows on that laptop
- solder everything together
- flash it from there
and that's a lot of work. so my dad tries to use it over USB in the hopes of getting it to work, and he got the same error. i do something else out of frustration.
and guess what fucking happened 5 minutes later. "uh yeah i see it in lsusb but [editors note: while writing that i noticed that lsusb has the word "sus" in it oh my god i can never unsee this] idk how to write on it" and im just sitting there like. what. how. what the fuck
and you will never guess what the fix was.
he just reloaded the usb kernel module. just a simple rmmod and modprobe. AND IT WORKS ON EVERY OTHER FUCKING DEVICE NOW. I DONT KNOW WHY OR HOW IT WORKS AND I DONT THINK I EVEN WANT TO KNOW.
you cannot make this shit up. god really hates me today huh
at least it works now but god that was a wild ride