From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: How to create a GPR project for ARM Cortex? Date: Sat, 11 Nov 2017 20:12:30 +0000 Organization: A noiseless patient Spider Message-ID: References: <16ddffcb-6ee7-418e-a61a-fe8ef1c583c2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="ce8bd1d9fb77783e97c10f252fb8c721"; logging-data="2270"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kekD02KYk30BYwcUJLDVzH9B4xpHXqok=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:VfIfKTbQKQXy9EJIIhEFgU/xETw= sha1:x85c6IJLDHPSgn5JUTBIHUc8IBU= Xref: feeder.eternal-september.org comp.lang.ada:48824 Date: 2017-11-11T20:12:30+00:00 List-Id: Johan Söderlind Åström 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!