im-tomu / tomu-samples

Code samples for the Tomu board
https://tomu.im
GNU General Public License v3.0
80 stars 27 forks source link

Built binaries don't enumerate when building on Ubuntu 18.04 LTS #32

Open gkelly opened 6 years ago

gkelly commented 6 years ago

I can flash the prebuilt/usb_* images and they work fine, but when I build with the arm-none-eabi toolchain in ubuntu bionic's apt I get images that when flashed just end up doing:

[351788.310188] usb 1-2: USB disconnect, device number 44
[351788.654610] usb 1-2: new full-speed USB device number 45 using xhci_hcd
[351794.010468] usb 1-2: device descriptor read/64, error -110

The compiler version reports:

arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620
gkelly commented 6 years ago

Should also mention that the miniblink example works fine, it's just the USB examples that seem to be broken.

gkelly commented 6 years ago

Tried with the arm-unknown-eabi from crosstool-ng, which had a similar result. The red light ended up staying on and the enumeration appeared to fail faster. However, the toolchain from https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads, which identifies itself as:

gcc version 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204] (GNU Tools for Arm Embedded Processors 7-2017-q4-major)

works, which is nice. Which gcc version were the prebuilt binaries built with?

xobs commented 6 years ago

That is the compiler they were built for originally. Downloaded from that address.

It sounds like this could be an alignment issue. Can you attach an .elf file from a broken build? I'll look through it and see if any addresses are off.

gkelly commented 6 years ago

Here's usb_simple.bin: https://drive.google.com/open?id=12HXy1xhEShCmLtWibbdzG_gZ36h6xzCe and here's usb_simple.elf: https://drive.google.com/open?id=19DdCKcFsoW-xBUEg2a2r8YfK8GD_UKpI Both built with gcc version 6.3.1 20170620 (15:6.3.1+svn253039-1build1).