[Fixed] TXT C/C++ Programmierung mit Mac

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
Cody
Beiträge: 17
Registriert: 24 Apr 2021, 03:25

[Fixed] TXT C/C++ Programmierung mit Mac

Beitrag von Cody » 24 Apr 2021, 04:03

***English version below***
Hi zusammen,

Ich habe anfangen, den TXT mit C/C++ zu programmieren. Mit den Anleitungen von https://github.com/fischertechnik/txt_demo_c_download läuft unter Windows alles problemlos. Da ich aber lieber mit Mac arbeite, wäre das natürlich die für mich komfortablere Variante.

Also habe ich dort Eclipse installiert und versucht, das Ganze zum Laufen zu bringen. Das gestaltet sich aber schwieriger als gedacht.
In den o.g. Github Projekt wird die Linaro Toolchain 'gcc-linaro-7.2.1-2017.11-i686-mingw32_arm-linux-gnueabihf' benutzt. Auf dem Mac ist die aber nicht ausführbar, da sie für Windows gemacht ist. Daher habe ich die Toolchain 'gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf' runtergeladen. Zum Testen habe ich dann wie für Windows die Github Beispiel-Projekte in Eclipse importiert, die Windows-Pfade zu der Toolchain durch die korrekten Pfade ersetzt und versucht zu compilen.
Als Ergebnis kamen zwar keine Errors und der Ordner 'Release' mit dem Unterordner 'src' wurden erzeugt, aber die Binaries fehlen.
Im Unterschied zu Windows ist nach dem Importieren im 'Includes' Ordner der Projekte nur Txt_includes vorhanden, 7 Ordner aus der Toolchain fehlen.
- /path/to/toolchain/arm-linux-gnueabihf/include
- /path/to/toolchain/arm-linux-gnueabihf/include/c++/7.2.1
- /path/to/toolchain/arm-linux-gnueabihf/include/c++/7.2.1/arm-linux-gnueabihf
- /path/to/toolchain/arm-linux-gnueabihf/include/c++/7.2.1/backward
- /path/to/toolchain/arm-linux-gnueabihf/libc/usr/include
- /path/to/toolchain/arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.2.1/include
- /path/to/toolchain/arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.2.1/include-fixed
Die habe ich unter Mac auch mal manuell hinzugefügt, allerdings hat sich am Ergebnis nichts geändert. Die Projekte compilen, aber es entstehen keine Binaries.

Hat jemand von Euch schon Erfahrung mit der TXT Programmierung auf dem Mac? Oder vielleicht eine Idee, wie man das zum Laufen bringen kann?
Ich könnte mir vorstellen, dass es eventuell an der Toolchain liegt, aber ich habe leider keine Erfahrung, welche Toolchain für Mac für den TXT geeignet wäre.

Ich bin für jede Hilfe oder Anregung dankbar.
Viele Grüße,
Cody


Hey everyone

So I started programming the TXT with C/C++. Using the tutorials from https://github.com/fischertechnik/txt_demo_c_download, everything works as expected on Windows. But I would appreciate working on a Mac, so I tried to get started there.

I installed Eclipse and got the Linaro toolchain 'gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf', since the toolchain from the tutorial 'gcc-linaro-7.2.1-2017.11-i686-mingw32_arm-linux-gnueabihf' only works under Windows. Then I imported the examples projects from Github just like I did on Windows, but of cause I modified all Windows path and references to the toolchain.
When I try to build the project, no errors are shown. It does create a 'Release' folder in the project with a 'src' sub folder, but they are empty as no binaries are produced.
Also, as a side note, importing the examples only adds the Txt_includes to the project's includes folder. On Windows, the includes contain 7 folders from the toolchain itself:
- /path/to/toolchain/arm-linux-gnueabihf/include
- /path/to/toolchain/arm-linux-gnueabihf/include/c++/7.2.1
- /path/to/toolchain/arm-linux-gnueabihf/include/c++/7.2.1/arm-linux-gnueabihf
- /path/to/toolchain/arm-linux-gnueabihf/include/c++/7.2.1/backward
- /path/to/toolchain/arm-linux-gnueabihf/libc/usr/include
- /path/to/toolchain/arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.2.1/include
- /path/to/toolchain/arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.2.1/include-fixed
Adding these manually to the project on Mac didn't help, still no build errors, but no binaries either.

Does someone have experience in programming the TXT on Mac? Or some ideas that would help with this?
My guess would be that the toolchain is not the right one. But sadly I'm not an expert when it comes to toolchains and cross compiling for the TXT.

Any help would be greatly appreciated.

Best Regards,
Cody
Zuletzt geändert von Cody am 25 Apr 2021, 16:08, insgesamt 1-mal geändert.

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: TXT C/C++ Programmierung mit Mac

Beitrag von vleeuwen » 24 Apr 2021, 19:03

The toolchain contains executables which are running on your MAC but the toolchain you are referring too.
You probably need te build your own toolchain, maybe this will help:
https://gist.github.com/ivakyb/6d6d8aa3 ... 2a214b516e
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Cody
Beiträge: 17
Registriert: 24 Apr 2021, 03:25

Re: TXT C/C++ Programmierung mit Mac

Beitrag von Cody » 25 Apr 2021, 16:07

@vleeuwen
Thanks for your quick help. I tried to avoid building my own toolchain, but the one I had was definitely not working.
I looked at the link you provided, sadly I wasn't too sure what to do exactly. Also, I think the tutorial was a bit outdated (It was from 2014ish).
But your suggestion led me to the correct path and I found a (for me at least) more understandable manual to build a toolchain. I haven't gotten to try it out tho. But I sure will in the next few days.
I also stumbled upon a pre-built toolchain that ACTUALLY WORKS. So developing C/C++ code is now possible under Mac. If anyone is interested, I'll share a tutorial and provide an already set up eclipse workspace like there is for Windows so anyone get going easily.

Vleeuwen, it looks like you made the txt_demo_c_download repository on GitHub. If you're interested, you could put the tutorial there. It would make the guideline more accessible for the community.

PS:
I don't know what you guys think about that and how useful this would be. What if we had pre-built cross-compilers specifically designed for the ft-controllers, like the RaspberryPi community has. I stumbled upon them while trying to find a toolchain that works with the ft controller. These toolchains add RBPi specific resources and libraries to the compiling code. Having this for TXT adding the TxtDeps could make developing code even easier and allowing to move to IDEs other than eclipse without a lot of configuration.

Best,
Cody

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: TXT C/C++ Programmierung mit Mac

Beitrag von vleeuwen » 25 Apr 2021, 16:59

Another option could be to directly use the GNU compiler which is installed on the embedded device itself.
This in combination with a make-file.
For example Microsoft Visual Studio is using that with the Rasp Pi 3 and 4.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Antworten