comp.lang.ada
 help / color / mirror / Atom feed
* How to create a GPR project for ARM Cortex?
@ 2017-11-11 19:18 Johan Söderlind Åström
  2017-11-11 20:12 ` Simon Wright
  2017-11-12 14:29 ` Johan Söderlind Åström
  0 siblings, 2 replies; 10+ messages in thread
From: Johan Söderlind Åström @ 2017-11-11 19:18 UTC (permalink / 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?


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-11-13 19:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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