Trouble with Cortex-M "Hello World"

Mike via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 31 04:38:12 PDT 2015


On Tuesday, 31 March 2015 at 11:19:29 UTC, Jens Bauer wrote:
> I belive the following information is slightly incorrect:
> "GDC requires the following minimal object.d file in the same 
> folder as start.d. It is imported automatically."
>
> My tests have shown that object.d needs to be in the CWD, not 
> in the same directory as "start.d".

I don't believe it is the current working directory, but rather 
the compiler's import path.  See the -I switch.  By default, I 
believe that is the current working directory.

>
> This is my command-line:
>
> arm-none-eabi-gdc -DF_CPU=48000000 -D__BUILD_WITH_EXAMPLE__=1 
> -mcpu=cortex-m4 -mthumb -mthumb-interwork -fno-emit-moduleinfo 
> -fdata-sections  -c src/start.d -o output/src/start.o
>
>
> Here's a summary of the directories when the build works:
> ./object.d
> src/start.d
> output/src/start.o
>
> However, the following does not work:
> src/object.d
> src/start.d
> output/src/start.o
>
> -Is this directory behaviour a bug ?

I believe it is working as designed, but I'm not an authority on 
the compiler.

Mike


More information about the Digitalmars-d mailing list