ARM Cortex-M Microcontroller startup files

Jens Bauer via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 26 13:41:18 PDT 2015


On Sunday, 26 April 2015 at 18:23:47 UTC, Martin Nowak wrote:
> On 04/26/2015 07:29 PM, Jens Bauer wrote:
>> Unfortunately, I have not been able to build with multilib 
>> yet, so my
>> setup cannot build code for Cortex-M0; it keeps stuffing 
>> Cortex-M3 and
>> Cortex-M4 instructions in there.
>
> The wiki says to disable multilib
> (http://wiki.dlang.org/Bare_Metal_ARM_Cortex-M_GDC_Cross_Compiler#Build_GCC),
> what's the problem?

The problem is that I cannot have a single compiler, which 
compiles for these architectures:
ARM7TDMI
Cortex-M0
Cortex-M3
Cortex-M4

Using a Cortex-M3 or Cortex-M4 compiler to build code for a 
Cortex-M0, will insert 32-bit instructions randomly (most code is 
16-bit, though, so parts of it gets it right). As soon as the 
microcontroller tries to run a 32-bit instruction, it will crash.

-In order to build code for Cortex-M0 or Cortex-M0+, I will have 
to rebuild the compiler.
The alternative is to build 5 different compilers. I don't want 
that either.

...

The reason I cannot build GDC with multilib, is that I get a 
compile-error when building the final GCC+GDC.
Building GCC alone without GDC gives me no such error.
-So if I want to have multilib support, I will have to be without 
GDC.


More information about the Digitalmars-d mailing list