Recent

Author Topic: Why no Freepascal for Arduino?  (Read 1412 times)

ccrause

  • Hero Member
  • *****
  • Posts: 1080
Re: Why no Freepascal for Arduino?
« Reply #15 on: October 09, 2025, 04:33:49 pm »
Quote from: ccrause
8 bit AVR support was first released with FPC 3.0 and became much more usable with release 3.2.  Obviously main contains more fixes & features (and the risk of a new bug or two).
Thank you very much for the explanation. I just took a quick look at the compilation example in your repository, and based on that, I drew the (incorrect) conclusion.
Not a problem :) The embedded targets are not really mentioned in the release notes so I wanted to create some awareness of the release history of AVR support.

Mentioning the main branch is quite useful since there are a few AVR specific enhancements that are not in the latest official version of FPC.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6191
  • Compiler Developer
Re: Why no Freepascal for Arduino?
« Reply #16 on: October 09, 2025, 09:13:18 pm »
Yes, but is hard to do, because there are no defination files or only for a handfull Controllers and much more complicatet.
But Freepascal can convert ALL from Arduino and can use the same commands as Arduino.

But it needs people that work on it. Not everyone is interested in Arduino and thus the amount of people that can and want to work on this is very low and thus progress is slow. And even then probably only components that someone who's capable of porting them needs.

Warfley

  • Hero Member
  • *****
  • Posts: 2021
Re: Why no Freepascal for Arduino?
« Reply #17 on: October 10, 2025, 08:53:15 pm »
The reason Ardunino is using C(++) and not any other language is not because they love C++, but rather that this is just the native language for those micro controllers. The ESP32 is programmed via the Espressif IDF, which provides the C libraries and APIs and a C compiler. So to use this in FPC, you do not only need an Xtensa compiler taget, you also need bindings to FreeRTOS and the IDF SDK. There is work on that, but it's from what I can see still very experimental.
And only when this is available you can start to create high level libraries like the for digital IO and stuff like that. And ESP32 is quite new, unlike AVR which was developed in 1996, and was the most widely used microcontroller for amateurs, while ESP32 is from 2016 and taking some time to take off in the amateur space with more and more integration into Arduino.

Additionally, and this might be that I'm just the wrong audience for this (I don't see any Advantage in using the Arduino software and libraries at all, I usually use the platform SDKs like Espressif IDF directly), but all this effort for what? When I look at the source code of my 3D scanner which I built recently, the ESP32 code is <200 LoC all of the major functionality I do on the evaluation software running on a full on PC (or Raspi) which I can write in any language I want. Like I can understand why you wouldn't want to write software thats thousands of lines of code in C, but Microcontroller software is so limited, for a few hundred lines of code it doesn't really matter what language to use. So I just take the thing thats native to the platform, so I get the best performance and compatibility

 

TinyPortal © 2005-2018