greatscottgadgets / ubertooth

Software, firmware, and hardware designs for Ubertooth
https://greatscottgadgets.com/ubertoothone/
GNU General Public License v2.0
1.94k stars 433 forks source link

Firmware is broken when built with gcc-arm-none-eabi from Ubuntu 18.04 #351

Closed pdjstone closed 5 years ago

pdjstone commented 5 years ago

Steps to reproduce

  1. Git clone master or use 2018-12-R1 release source
  2. make bluetooth_rxtx firmware
  3. ubertooth-dfu -d bluetooth_rxtx.dfu -r

Expected behaviour

Firmware flashes and runs.

Actual behaviour

The firmware seems to successfully build and flash. However after flashing the board shows a single green LED and doesn't appear over USB. I have to force the board into DFU mode via the pins in order to flash a working (precompiled) firmware. I've tried building both from git master and using the 2018-12-R1 release. I notice that my built version of bluetooth_rxtx.dfu is slightly larger (31061 bytes) than the 2018-12-R1 precompiled verson (30829 bytes)

Version information

Ubuntu 18.04 with gcc-arm-none-eabi libnewlib-arm-none-eabi from standard repos.

libubertooth 1.1 (2018-12-R1), libbtbb 1.0 (2018-06-R1)

grvvy commented 5 years ago

Which compiler version are you using? I'm getting 30,709 bytes when building from f257505.

pdjstone commented 5 years ago

gcc-arm-none-eabi -v gives: gcc version 6.3.1 20170620 (15:6.3.1+svn253039-1build1)

pdjstone commented 5 years ago

I've tested building the firmware with clean Ubuntu 18.04 and 16.04 VMs. The 16.04 VM built a working firmware using the ARM GCC toolchain from the stanard repos. So, to summarise:

The working DFU file generated on 16.04 is 31348 bytes, so size doesn't seem to be causing the problem.

grvvy commented 5 years ago

It appears that there's a bug with that particular gcc version, I'd recommend updating to a new version of gcc (8.2.0 in apt).