From: "Johan Söderlind Åström" <johaa1993@gmail.com>
Subject: How to create a GPR project for ARM Cortex?
Date: Sat, 11 Nov 2017 11:18:50 -0800 (PST)
Date: 2017-11-11T11:18:50-08:00 [thread overview]
Message-ID: <16ddffcb-6ee7-418e-a61a-fe8ef1c583c2@googlegroups.com> (raw)
I build programs on my stm32l0 using this script:
arm-none-eabi-gcc -c -mcpu=cortex-m0plus -mthumb -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/main.d" -MT"build/main.d" -Wa,-a,-ad,-alms=build/main.lst src/main.c -o build/main.o
arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m0plus -mthumb -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/startup_stm32l072xx.d" -MT"build/startup_stm32l072xx.d" src/startup_stm32l072xx.s -o build/startup_stm32l072xx.o
arm-none-eabi-gcc build/startup_stm32l072xx.o build/main.o -mcpu=cortex-m0plus -mthumb -specs=nano.specs -Tsrc/STM32L072CZEx_FLASH.ld -lc -lm -lnosys -Wl,-Map=build/main.map,--cref -Wl,--gc-sections -o build/main.elf
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 want to convert it to a GPR project so I created this:
project Default is
for Languages use ("c");
--for Languages use ("c, s");
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Exec_Dir use "bin";
for Main use ("main.c");
for Target use "arm-eabi";
for Library_Support use "none";
package Ide is
for Gnat use "arm-eabi-gnat";
for Gnatlist use "arm-eabi-gnatls";
for Debugger_Command use "arm-eabi-gdb";
end Ide;
package Builder is
for Default_Switches ("c") use ("-mcpu=cortex-m0", "-mthumb", "-Og", "-Wall", "-fdata-sections", "-ffunction-sections", "-g", "-gdwarf-2", "-MMD", "-MP", "-MF""build/main.d""", "-MT""build/main.d""", "-Wa,-a,-ad,-alms=build/main.lst");
end Builder;
package Compiler is
for Default_Switches ("c") use ("-mcpu=cortex-m0", "-mthumb", "-Og", "-Wall", "-fdata-sections", "-ffunction-sections", "-g", "-gdwarf-2", "-MMD", "-MP", "-MF""build/main.d""", "-MT""build/main.d""", "-Wa,-a,-ad,-alms=build/main.lst");
end Compiler;
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;
end Default;
I got following result:
c:/gnat/2017/bin/../lib/gcc/arm-eabi/6.3.1/../../../../arm-eabi/bin/ld.exe: cannot find crt0.o: No such file or directory
I got following result by using assembly language s:
no compiler specified for language "s"
I do not need crt0.o, how to remove that?
Is it even possible to use ".s" or ".ld" files in a GPR project?
next reply other threads:[~2017-11-11 19:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-11 19:18 Johan Söderlind Åström [this message]
2017-11-11 20:12 ` How to create a GPR project for ARM Cortex? Simon Wright
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