comp.lang.ada
 help / color / mirror / Atom feed
From: "Johan Söderlind Åström" <johaa1993@gmail.com>
Subject: Re: How to create a GPR project for ARM Cortex?
Date: Sat, 11 Nov 2017 14:05:56 -0800 (PST)
Date: 2017-11-11T14:05:56-08:00	[thread overview]
Message-ID: <fa68d5fb-5a63-4254-bfec-088a499eccfd@googlegroups.com> (raw)
In-Reply-To: <ly1sl4h8wh.fsf@pushface.org>

Thanks it is working now. 

project Default is
   
   for Languages use ("c", "asm");
   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";

   package Naming is
      for Spec_Suffix ("c") use ".h";
      for Body_Suffix ("c") use ".c";
      for Body_Suffix ("asm") use ".s";
   end Naming;

   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
        (
         "-lm",
         "-lgcc",
         "-lc",
         "-mcpu=cortex-m0",
         "-mthumb",
         "-Og",
         "-Wall",
         "-fdata-sections",
         "-ffunction-sections",
         "-g",
         "-gdwarf-2",
         "-MMD",
         "-MP",
         "-f",
         "-MF""build/main.d""",
         "-MT""build/main.d""",
         --"-Wa,-a,-ad,-alms=""build/main.lst""",
         ""
        );
      for Default_Switches ("asm") use 
        (
         "-x",
         "-lnosys",
         "-lm",
         "-lgcc",
         "-lc",
         "-mcpu=cortex-m0",
         "-mthumb",
         "-Og",
         "-Wall",
         "-fdata-sections",
         "-ffunction-sections",
         "-g",
         "-gdwarf-2",
         "-MMD",
         "-MP",
         "-f"
        );
   end Builder;

   package Compiler is
   end Compiler;

   package Linker is
      for Default_Switches ("c") use
        (
         "-nostartfiles",
         "-nodefaultlibs",
         "-TC:/Users/Johan/Documents/B-L072Z-LRWAN1_Ada/src/STM32L072CZEx_FLASH.ld",
         --"-Tsrc/STM32L072CZEx_FLASH.ld",
         --"-Wl,-Map=build/main.map,--cref",
         "-Wl,--gc-sections",
         --"-o main.elf",
         ""
        );
   end Linker;

end Default;


I have this shell script:
set -x #echo on
gprbuild default.gpr
arm-eabi-objcopy -O binary -S bin/main bin/main.bin
cp bin/main.bin E:/


My board can run a simple blink program.


"-nostartfiles" removes "crt0.o".
"-Tsrc/STM32L072CZEx_FLASH.ld" relative path does not work.
"-Wl,-Map=build/main.map,--cref" does not work.
"-Wa,-a,-ad,-alms=""build/main.lst""" does not work.
"-o main.elf" does not work.

I have not tried gdb debugger or language Ada yet.


  reply	other threads:[~2017-11-11 22:05 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
2017-11-11 22:05   ` Johan Söderlind Åström [this message]
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