In order to workaround the problem, I used a virtual machine with Debian 8.4 image and installed
$ 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.
In order to disintermediate the virtual machine,
- I downloaded
gcc-arm-none-eabi v5.3from developer.arm.com/...
- Prepend the download path to the
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.
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
apt-get removeand retried previous attempt. The app binary still worked on the microcontroller, which is not expected.
- I restored the VM before I've installed
apt. I used
gcc-arm-none-eabi-7.3directly 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)
According to the "further experiments", there should be some other dependencies used in the runtime. How can we determine those dependencies?