Closed rogermc2 closed 7 months ago
Hello @rogermc2,
What target architecture did you set in the project? Which run-time are you using?
My gpr file has
for Runtime ("Ada") use "zfp-cortex-m0"; for CPU_Name use "ARM Cortex-M0";
From Config file: for Target use "arm-eabi"; for Canonical_Target use "x86_64-darwin"; Originally Target was "x86_64-darwin" but I changed it to "arm-eabi". I also tried "arm-none-eabi", "arm-none-eabi-gcc" but same problem for each. my /opt/ARM/bin has numerous "arm-eabi" versions.
I also tried changing
for Canonical_Target use "x86_64-darwin";
to "arm-eabi".
Gpr file: project Bare_Metal_Hello is for Languages use ("Ada", "Asm_Cpp"); -- ASM_CPP to compile the startup code for Source_Dirs use ("src"); for Object_Dir use "obj"; for Main use ("bm_hello.adb");
for Target use "arm-eabi";
-- generic ZFP run-time compatible with our MCU for Runtime ("Ada") use "zfp-cortex-m0";
package Linker is -- Linker script generated by startup-gen for Switches ("Ada") use ("-T", Project'Project_Dir & "/src/link.ld"); end Linker;
package Device_Configuration is
-- Name of the CPU core on the STM32F030
for CPU_Name use "ARM Cortex-M0";
for Float_Handling use "hard";
-- Number of interrupt lines on the STM32F030
for Number_Of_Interrupts use "48";
-- List of memory banks on the STM32F030
for Memories use ("SRAM", "FLASH", "CCM");
-- Specify from which memory bank the program will load
for Boot_Memory use "FLASH";
-- Specification of the SRAM
for Mem_Kind ("SRAM") use "ram";
for Address ("SRAM") use "0x20000000";
for Size ("SRAM") use "8K";
-- Specification of the FLASH
for Mem_Kind ("FLASH") use "rom";
for Address ("FLASH") use "0x08000000";
for Size ("FLASH") use "64K";
-- Specification of the CCM RAM
for Mem_Kind ("CCM") use "ram";
for Address ("CCM") use "0x1FFFEC00";
for Size ("CCM") use "4096";
end Device_Configuration;
end Bare_Metal_Hello;
You should have for Target use "arm-eabi";
in your bare_metal_hello.gpr
project file,
It's not recommended to use a custom config gpr file --config=bm_config.cgpr
. Any specific reason for doing this?
I used --config=bm_config.cgpr (possibly incorrectly) to overcome the following error;
gprbuild -P bare_metal_hello.gpr gprconfig: can't find a toolchain for the following configuration: gprconfig: language 'ada', target 'arm-eabi', runtime 'zfp-cortex-m0' bare_metal_hello.gpr:1:09: no compiler for language "Asm_Cpp", cannot compile "crt0.s" gprbuild: *** compilation phase failed
How can I overcome this error?
I tried to attach bm_config.cgpr.zip but it doesn't show in this answer. If it is attached (possibly three times), the only change I made was to Target. Thanks for your support.
Which compiler version are you using? The zfp-cortex-m0
run-time was renamed light-cortex-m0
a few versions ago.
`Roger@Rogers-Mac-mini bma_1 % which gnat
/opt/GNAT/gnat-x86_64-darwin-12.2.0-1/bin/gnat Roger@Rogers-Mac-mini bma_1 % GNAT --version GNAT 12.2.0 Copyright (C) 1996-2022, Free Software Foundation, Inc.`
Hi @rogermc2 , this is not an arm cross compiler so you won't be able to compile startup-gen generated code with it.
If you are using Alire, add a dependency on gnat_arm_elf
.
Many thanks, I thought that was the case but so far hadn't found a solution. I'll close this issue now and raise another if I get stuck later. Your help is greatly appreciated.
OSX 13.4.1 GNAT 12.2.0 Xcode 15.1 Target: STM32F030R8 which gprbuild
/opt/GNAT/2020/bin/gprbuild gprbuild --version GPRBUILD Community 2020 (20200429) (x86_64-apple-darwin17.7.0)`
This is my first attempt to build an Ada bare metal project. After solving many problems I have got to a stage where I am unable to find the source of the following problem. gprbuild -P bare_metal_hello.gpr --config=bm_config.cgpr fails with numerous unknown directive errors:
and many more, It looks like something is changing crt0.S to crt0.s? Please help