1

Background

There is a GCC bug that affects Cortex M0 architecture which seems to be introduced in v5.4.1 (...and seems to be fixed in the trunk, however, we aren't interested in this option ATM).

In order to workaround the problem, I used a virtual machine with Debian 8.4 image and installed gcc-arm-none-eabi package:

$ gcc-arm-none-eabi -dumpversion
4.8

When I compiled my code in the VM and load to the target device, the problem is vanished and everything went fine.

Problem

In order to disintermediate the virtual machine,

  • I downloaded gcc-arm-none-eabi v5.3 from developer.arm.com/...
  • Prepend the download path to the $PATH variable accordingly
  • Run make

However, the generated code doesn't work as expected on the microcontroller. This means that I can't compile my code using gcc-arm-none-eabi-5.3 on my host machine.

Further Experiments

In order to narrow down the problem,

  • I compiled the application code (app) with same gcc 5.3 on virtual machine (after installing 32bit support). The generated binary run on target (microcontroller) as expected.
  • I compiled the app with gcc 7.3.1 while expecting not to work. However, the generated binary is able to run on microcontroller correctly. This was not expected.
  • I removed gcc-arm-none-eabi with apt-get remove and retried previous attempt. The app binary still worked on the microcontroller, which is not expected.
  • I restored the VM before I've installed gcc-arm-none-eabi-4.8 via apt. I used gcc-arm-none-eabi-7.3 directly from download path and it didn't worked as expected
  • I compiled the app with gcc-arm-none-eabi-5.3, expecting it to work correctly. However, it didn't work on the microcontroller. This was not expected.
  • If I install the toolchain (v4.8) at this point with apt-get install gcc-arm-none-eabi, generated binary doesn't work on the microcontroller, which is not expected and surprising.
  • If I revert the VM to fresh install again and install v4.8 with apt-get install gcc-arm-none-eabi gdb-arm-none-eabi, stock compiler doesn't work (this is also surprising)

Question

According to the "further experiments", there should be some other dependencies used in the runtime. How can we determine those dependencies?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.