comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: How to create a GPR project for ARM Cortex?
Date: Sat, 11 Nov 2017 20:12:30 +0000
Date: 2017-11-11T20:12:30+00:00	[thread overview]
Message-ID: <ly1sl4h8wh.fsf@pushface.org> (raw)
In-Reply-To: 16ddffcb-6ee7-418e-a61a-fe8ef1c583c2@googlegroups.com

Johan Söderlind Åström <johaa1993@gmail.com> writes:

> arm-none-eabi-objcopy -O ihex build/main.elf build/main.hex
> arm-none-eabi-objcopy -O binary -S build/main.elf build/main.bin
> cp build/main.bin E:/

I don't think you can do these using a GPR. A Makefile would work.

>    for Languages use ("c");
>    --for Languages use ("c, s");

   for Languages use ("C", "ASM");  -- not case-sensitive
   
>    package Linker is
>       for Linker_Options use ("-mcpu=cortex-m0plus", "-mthumb", "-specs=nano.specs", "-Tsrc/STM32L072CZEx_FLASH.ld", "-lc", "-lm", "-lnosys", "-Wl,-Map=build/main.map,--cref", "-Wl,--gc-sections");
>    end Linker;

The linker script I use includes -nostdlib, which I think is what
suppresses crt0.o. You might need -lgcc at some point: I have

   "-nostdlib", "-lm", "-lgcc", "-lc"

(no -lnosys??)

Once you've included the options in Builder, I don't believe you need to
repeat them in the other packages; they should be inserted into the
compiler/linker options automatically, so you only need to specify the
compiler/linker-specific ones explicitly.

I don't think you want all the dependency/listing info to be written to
main.d, .lst?

You probably need 'for Default_Switches ("ASM") use ...' in Compiler.

You've reminded me to look at my use of -ffunction-sections etc, which I
see I've been careless about. Thanks!


  reply	other threads:[~2017-11-11 20:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-11 19:18 How to create a GPR project for ARM Cortex? Johan Söderlind Åström
2017-11-11 20:12 ` Simon Wright [this message]
2017-11-11 22:05   ` Johan Söderlind Åström
2017-11-12  8:06     ` Simon Wright
2017-11-12 10:18       ` Johan Söderlind Åström
2017-11-12 11:39         ` Simon Wright
2017-11-12  8:54   ` Simon Wright
2017-11-12 14:29 ` Johan Söderlind Åström
2017-11-13 10:54   ` Simon Wright
2017-11-13 19:08     ` Johan Söderlind Åström
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox