AVR embedded für verschiedene Controllertypen - geht!

Mathias
Beiträge: 6160
Registriert: Do 2. Jan 2014, 17:21
OS, Lazarus, FPC: Linux (die neusten Trunk)
CPU-Target: 64Bit
Wohnort: Schweiz

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von Mathias »

Vielen Dank, für deine Bemühungen. :wink:

I will also monitor the changes in FPC and Lazarus to be able to install multiple subarchs the easy way.
And to auto-update them when needed.
(the reason to post here)


Dies würde uns schon einiges weiter helfen.

PS: arm-embedded, lässt sich noch nicht mit fpcupdeluxe erstellen.
Mit Lazarus sehe ich grün
Mit Java und C/C++ sehe ich rot

DonAlfredo
Beiträge: 74
Registriert: Do 28. Sep 2017, 10:26

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von DonAlfredo »

PS: arm-embedded, lässt sich noch nicht mit fpcupdeluxe erstellen.

That is very strange ! This whole new release and new FPC/Laz sources are focussed on arm-embedded.
I checked it on many systems.

Could you please enlighten me with a bit more details about this failure.
Its important (for me) to have this working for 100% !!

Benutzeravatar
kupferstecher
Beiträge: 418
Registriert: Do 17. Nov 2016, 11:52

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von kupferstecher »

Hello DonAlfredo,

first of all: Thanks for the development of fpcupdelux!

I just tried to create a cross compiler for arm-embedded using fpcupdeluxe. I had a crosscompiler before, build with a batch-script. I "deactivated" that installation by changing its folder names.

In fpcupdeluxe I pressed the "Embedded"-button with the ic-icon. The installation went through (installed Laz 2.1.0), but I couldn't compile my example project, the error message said there is no such fpc for target arm-embedded.

Again I opened fpcupdeluxe and installed the crosscompiler with settings cpu:arm and os:embedded by pressing "Install cross-compiler". It downloaded binutils and went through, also there was no error message when opening the example project (STM32F103).

But I couldn't compile the project, the processor parameter was wrong, seems there were changes in the names.
Running "ppcrossarm.exe -i" showed the supported microcontroller types. I modified the parameter in Lazarus Project options/Custom Options to "-Wpstm32f103C8". When compiling there is an error message Can't find unit "STM32F103XB". There seems something wrong, also a lot of units in the rtl are missing in comparisson to my old installation.

But I guess thats not related to fpcupdeluxe but to fpc.


PS: System Win7/64bit

Mathias
Beiträge: 6160
Registriert: Do 2. Jan 2014, 17:21
OS, Lazarus, FPC: Linux (die neusten Trunk)
CPU-Target: 64Bit
Wohnort: Schweiz

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von Mathias »

Could you please enlighten me with a bit more details about this failure.
Its important (for me) to have this working for 100% !!

Code: Alles auswählen

New try building a cross-compiler for embedded-arm
fpcupdeluxe: info: FPC arm-embedded cross-builder: Detected source version FPC (compiler): 3.3.1
fpcupdeluxe: info: TAny_embedded-arm: Found correct binary utilities in directory /home/tux/fpcupdeluxe_arm/cross/bin/arm-embedded
fpcupdeluxe: info: TAny_embedded-arm: Found correct library in directory /home/tux/fpcupdeluxe_arm/cross/lib/arm-embedded/armv6m
fpcupdeluxe: info: FPC arm-embedded cross-builder: Using compiler with version: 3.3.1
fpcupdeluxe: Start of compile error summary.
system.pp(325) Error: Compilation raised exception internally
fpcupdeluxe: Start of compile error summary.
Fatal: I/O error: File not found
system.pp(325) Error: Compilation raised exception internally
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Running cross compiler fpc make all for arm-embedded failed with an error code.


Detailliert im Anhang.

Ich verwende Linux Mint 19 64Bit.
Dateianhänge
fehler.txt
(180.59 KiB) 157-mal heruntergeladen
Mit Lazarus sehe ich grün
Mit Java und C/C++ sehe ich rot

DonAlfredo
Beiträge: 74
Registriert: Do 28. Sep 2017, 10:26

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von DonAlfredo »

To build a cross-compiler for any embedded target, you need to define a sub-arch !
The basic setting of fpcupdeluxe for arm-embedded is to build for armv6m.

However, stm32f103 is armv7m !!
So, to build for this MCU, you need to define armv7m as subarch.

To instruct fpcupdeluxe to build for armv7m:
Click setup+
Have a look (at the right) at "Custom tools location and build options".
Select arm and embedded as CPU and OS combo.
Enter armv7m into "Cross Subarch Override"
Build cross-compiler.

See included screenshot.

@mathias
As of yet, this is an unexplainable error unfortunately. And I cannot reproduce it either.
Dateianhänge
embedded.JPG

Benutzeravatar
kupferstecher
Beiträge: 418
Registriert: Do 17. Nov 2016, 11:52

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von kupferstecher »

DonAlfredo hat geschrieben:However, stm32f103 is armv7m !!

Of course... I should have known. Thanks!

There are rtl-files for the certain controllers now, but the structure quite changed, also register names and types (e.g. GPIOA instead of PortA and TGPIO_Register instead of TPortRegister as before).
A minimum project finally resulted in a linker error.

Code: Alles auswählen

...\cross\bin\arm-embedded\arm-embedded-objcopy.exe: invalid option --\


Were there discussions about the changes, is there anything to read about it?

Regards

DonAlfredo
Beiträge: 74
Registriert: Do 28. Sep 2017, 10:26

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von DonAlfredo »

No central discussion yet.
But you can always ask questions about this special FPC and Lazarus on GitHub, the place where these repo's are hosted.

https://github.com/LongDirtyAnimAlf/freepascal
https://github.com/LongDirtyAnimAlf/lazarus

The goal of these efforts is to check, test and use these embedded extensions.
And, if all quirks have been solved, an official request will be done to include the necessary changes into the official FPC and Lazarus.

Mathias
Beiträge: 6160
Registriert: Do 2. Jan 2014, 17:21
OS, Lazarus, FPC: Linux (die neusten Trunk)
CPU-Target: 64Bit
Wohnort: Schweiz

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von Mathias »

DonAlfredo hat geschrieben:To build a cross-compiler for any embedded target, you need to define a sub-arch !
The basic setting of fpcupdeluxe for arm-embedded is to build for armv6m.

However, stm32f103 is armv7m !!
So, to build for this MCU, you need to define armv7m as subarch.

To instruct fpcupdeluxe to build for armv7m:
Click setup+
Have a look (at the right) at "Custom tools location and build options".
Select arm and embedded as CPU and OS combo.
Enter armv7m into "Cross Subarch Override"
Build cross-compiler.

See included screenshot.

@mathias
As of yet, this is an unexplainable error unfortunately. And I cannot reproduce it either.

Es geht leider immer noch nicht.
Könnte dies an Linux liegen, so wie ich sehe, hast du Windows verwendet.

Noch etwas, bei mir sind immer Fehler wegen fehlenden Goto gekommen, dies auch bei älteren Versionen. Dies konnte ich mit Setup+ --> Option Override "-Sg" umgehen. Aber so wie ich sehe, hast du dies nicht verwenden müssen.

Immerhin, sieht die Fehlermeldung unterdessen etwas anders aus.

Code: Alles auswählen

Valid subarch(s) for arm embedded are: armv4, armv4t, armv6m, armv7a, armv7em, armv7m
Fpcupdeluxe: FPC cross-builder: Building compiler for embedded-arm (OPT: -Sg ) {SUBARCH: armv7m}.
fpcupdeluxe: info: FPC arm-embedded cross-builder: Detected source version FPC (compiler): 3.3.1
fpcupdeluxe: info: TAny_embedded-arm: Found correct binary utilities in directory /home/tux/fpcupdeluxe_arm/cross/bin/arm-embedded
fpcupdeluxe: info: TAny_embedded-arm: Found correct library in directory /home/tux/fpcupdeluxe_arm/cross/lib/arm-embedded/armv7m
fpcupdeluxe: info: FPC arm-embedded cross-builder: Using compiler with version: 3.3.1
fpcupdeluxe: Start of compile error summary.
/home/tux/fpcupdeluxe_arm/fpcsrc/rtl/units/arm-embedded/system.s:3555: Error: unknown pseudo-op: `.l'
fpcupdeluxe: Start of compile error summary.
system.pp(325) Error: Error while assembling exitcode 1
fpcupdeluxe: Start of compile error summary.
system.pp(325) Fatal: There were 2 errors compiling module, stopping
system.pp(325) Error: Error while assembling exitcode 1
fpcupdeluxe: Start of compile error summary.
Fatal: Compilation aborted
system.pp(325) Fatal: There were 2 errors compiling module, stopping
fpcupdeluxe: Start of compile error summary.
sysutils.pp(34,4) Fatal: Cannot open include file "sysutilh.inc"
make[3]: *** Auf noch nicht beendete Prozesse wird gewartet …
fpcupdeluxe: Start of compile error summary.
Fatal: Compilation aborted
sysutils.pp(34,4) Fatal: Cannot open include file "sysutilh.inc"
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Running cross compiler fpc make all for arm-embedded failed with an error code.
Done !!


Im Anhang die komplette Fehlermeldung.
Dateianhänge
fehler.txt
(131.55 KiB) 162-mal heruntergeladen
Mit Lazarus sehe ich grün
Mit Java und C/C++ sehe ich rot

DonAlfredo
Beiträge: 74
Registriert: Do 28. Sep 2017, 10:26

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von DonAlfredo »

@Mathias
I have tried to reproduce your error on Windows and Linux, but still did not succeed.
Install on my system run flawless.
So, I have no clue whatsoever.

In these situations only one thing remain: a vanilla install.
Meaning: a new directory with latest fpcupdeluxe and new sources.
Sorry I can't help you at this moment. Will keep investigating.

Mathias
Beiträge: 6160
Registriert: Do 2. Jan 2014, 17:21
OS, Lazarus, FPC: Linux (die neusten Trunk)
CPU-Target: 64Bit
Wohnort: Schweiz

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von Mathias »

Ich habe es nochmals in einem leeren Ordner probiert.

Code: Alles auswählen

New try building a cross-compiler for embedded-arm
fpcupdeluxe: info: FPC arm-embedded cross-builder: Detected source version FPC (compiler): 3.3.1
fpcupdeluxe: info: TAny_embedded-arm: Found correct binary utilities in directory /home/tux/fpcupdeluxe_arm/cross/bin/arm-embedded
fpcupdeluxe: info: TAny_embedded-arm: Found correct library in directory /home/tux/fpcupdeluxe_arm/cross/lib/arm-embedded/armv7m
fpcupdeluxe: info: FPC arm-embedded cross-builder: Using compiler with version: 3.3.1
fpcupdeluxe: Start of compile error summary.
softfpu.pp(653,5) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(678,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(1830,7) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(1843,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(1963,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(1976,13) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(2080,5) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(2093,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3598,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3674,9) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3702,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3703,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3704,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3705,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3706,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3715,29) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3716,29) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3733,29) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3734,29) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(3762,5) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4152,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4201,13) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4415,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4428,13) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4433,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4511,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4524,13) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4894,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4895,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4973,9) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(4979,8) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5003,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5004,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5005,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5006,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5007,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5018,29) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5019,29) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5038,31) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5039,31) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5040,31) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5041,31) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5069,5) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5162,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5181,62) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5252,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5277,13) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5369,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5386,9) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5506,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
softfpu.pp(5506,11) Fatal: There were 50 errors compiling module, stopping
softfpu.pp(5506,11) Error: GOTO and LABEL are not supported (use switch -Sg)
fpcupdeluxe: Start of compile error summary.
Fatal: Compilation aborted
softfpu.pp(5506,11) Fatal: There were 50 errors compiling module, stopping
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Running cross compiler fpc make all for arm-embedded failed with an error code.
Done !!


Die Grundinstallation von FPC /Lazarus geht ohne Fehler.

Dabei habe ich folgendes eingestellt:
FPC version --> embedded
Lazarus version --> embedded
Button [Embedded] gedrückt.
Wie gesagt, dies geht ohne Fehler.

Anschliessend [Setup+]
"Custom tools location and build options" --> arm / embedded
"Cross Subarch Override (i....." --> armv7m
[Ok]

CPU --> arm
OS --> embedded
[Install cross-compiler]

Die Fehler mit dem Goto sind mir ein Rätsel, da dies bei dir nicht auftreten. Dieser Goto Fehler besteht schon seit über einem Monat.

PS: Kann sonst ein Lazarusler dies mal ausprobieren ? :wink:
Dateianhänge
fehler.txt
(183.61 KiB) 162-mal heruntergeladen
Mit Lazarus sehe ich grün
Mit Java und C/C++ sehe ich rot

Mathias
Beiträge: 6160
Registriert: Do 2. Jan 2014, 17:21
OS, Lazarus, FPC: Linux (die neusten Trunk)
CPU-Target: 64Bit
Wohnort: Schweiz

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von Mathias »

Nachtrag:
Ich habe es mit Win10 64Bit und Mint 19 64Bit in der VB probiert. Dort konnte ich bei beiden OS auf Anhieb den Cross-Compiler erzeugen. 8)

Im Anhang ein Auschnitt von Mint 19.

So wie es scheint, ist mit mit meinem Mint etwas nicht in Ordnung, aber was ? :wink:
Dateianhänge
Bildschirmfoto vom 2018-09-30 18-25-06.png
Mit Lazarus sehe ich grün
Mit Java und C/C++ sehe ich rot

DonAlfredo
Beiträge: 74
Registriert: Do 28. Sep 2017, 10:26

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von DonAlfredo »

It remains a very strange error.

I have used Google a bit.
And Google came up with:
http://lists.freepascal.org/pipermail/f ... 44603.html
The above could be of interest enough to test it.

I have prepared a pre-release for linux x64.
https://github.com/newpascal/fpcupdelux ... tag/1.6.1n
Setup+ has now an option (checkbox) to disable the use of jobs by GNU make.

Could you please give this a try ?
Thanks.

Mathias
Beiträge: 6160
Registriert: Do 2. Jan 2014, 17:21
OS, Lazarus, FPC: Linux (die neusten Trunk)
CPU-Target: 64Bit
Wohnort: Schweiz

Re: AVR embedded für verschiedene Controllertypen - geht!

Beitrag von Mathias »

Ich habe nochmals von vorn begonnen, und den Hacken "Use jobs for GNU make" entfernt.
Jetzt hat es geklappt. :wink:

Vielen Dank für deine Mühe.

Jetzt muss ich nur noch rausfinden, wie ich die *.hex in den STM32 bringe.
Mit Lazarus sehe ich grün
Mit Java und C/C++ sehe ich rot

Antworten