Hi!
I have a little trouble with cross compiling for ARM architecture.
FPC+Lazarus+cross libs and
ppcarm installed/built with FpcUpDeluxe. Path are configured (-Fu..., -Fl... in the fpc.cfg)
When trying to compile empty project :
program project1;
begin
end.
getting error:
(1002) Target OS: Embedded
(3104) Compiling project1.lpr
(3104) Compiling /opt/Laz_stable/fpcsrc/rtl/embedded/arm/stm32f407xx.pp
(3104) Compiling /opt/Laz_stable/fpcsrc/rtl/embedded/arm/stm32f407xx.pp
/opt/Laz_stable/fpcsrc/rtl/embedded/arm/stm32f407xx.pp(9,1) Fatal: (10020) Circular unit reference between stm32f407xx and stm32f407xx
Fatal: (1018) Compilation aborted
The unit
stm32f407xx.pp is included by parameter
-WpDISCOVERYF407VG ,
and has no direct pointer in the
Uses clause nor any uses inside unit itself.
But it still cause error "Circular unit reference...".
I have tried several version fpc, lazarus. Have tried to compile from IDE and from console with
fpc and
ppcarm itself.
With omitting
-WpDISCOVERYF407VG specification makes success(say no error) compilation from console with warnings:
/opt/Laz_stable/cross/bin/arm-embedded/arm-none-eabi-ld:/opt/Laz_stable/projects/link16829.res:27: warning: memory region `ram' not declared
/opt/Laz_stable/cross/bin/arm-embedded/arm-none-eabi-ld: /opt/Laz_stable/projects/project1.elf: warning: allocated section `.data' not in segment
but from IDE, still can't compile with
errors:
Error: /opt/Laz_stable/cross/bin/arm-embedded/arm-none-eabi-ld:/opt/Laz_stable/projects/link16598.res:27: warning: memory region `ram' not declared
Error: /opt/Laz_stable/cross/bin/arm-embedded/arm-none-eabi-ld: /opt/Laz_stable/projects/project1.elf: warning: allocated section `.data' not in segment
While compiling without
-WpDISCOVERYF407VG it is producing 3 files: bin, elf, hex
*.elf file is:
/opt/Laz_stable/projects/project1.elf: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), no program header, not stripped
00000000 d $d
00000000 A _bss_end
00000000 N _bss_start
00000000 D _data
00000046 D _edata
00000000 A _end
00000000 T _etext
00000000 d __fpc_ident
00000000 T _text_start
Does anybody has a working manual to build firmware for stm32F407Discovey ?
Linux ubuntu 22.10 x64.
Laz 2.2.4
Free Pascal Compiler version 3.2.2-rrelease_3_2_2-0-g0d122c4953 [2023/01/18] for x86_64
Full procject build command:
/opt/Laz_stable/fpc/bin/x86_64-linux/fpc.sh -B -Tembedded -Parm -CpARMV7M -MObjFPC -Scghi -O1 -l -vewnhibq -Fi/opt/Laz_stable/projects/lib/arm-embedded -Fl/opt/Laz_stable/cross/lib/arm-embedded/armv7m/eabi -Fu/opt/Laz_stable/fpc/units/arm-embedded/armv7m/eabi/rtl -Fu/opt/Laz_stable/projects/ -FU/opt/Laz_stable/projects/lib/arm-embedded/ -FE/opt/Laz_stable/projects/ -o/opt/Laz_stable/projects/project1 -WpDISCOVERYF407VG project1.lpr
Thanks.