Recent

Author Topic: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?  (Read 1253 times)

ajvperth

  • New member
  • *
  • Posts: 9
Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« on: January 09, 2025, 08:53:56 am »
Hello,

I just have Fpcupdeluxe working for cross compiling freepascal to the Esp32 (Lx6) and probably the Esp8266 (Lx106)
As the Esp32s2 and Esp32s3 are newer CPU's and available on smaller boards I like to proceed in this direction.
I found https://github.com/michael-ring/espsdk4fpc/tree/devel but I am not sure how to use it.
Ideally in Lazarus | Project | Project options | Compiler options | Config and Target I see a -Cp option lx7 etc.

What can I expect from https://github.com/michael-ring/espsdk4fpc/tree/devel? and how to use it?

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1790
Re: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« Reply #1 on: January 09, 2025, 09:22:44 am »
To be honest (as maintainer of fpcupdeluxe).

As a daily user of ESP32S3 and family, I am just using the (C/C++) tools available for developments.
https://www.seeedstudio.com/SenseCAP-Indicator-D1L-p-5646.html
To be able to use this device, I need wifi, LoRa, GUI, USB and all kinds of other libraries. To do this with FPC more or less impossible, due to the lack of libraries.

So, I will try to maintain fpcupdeluxe to be able to target esp*, but I will not extend its functionality. Time is limited unfortunately.

ajvperth

  • New member
  • *
  • Posts: 9
Re: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« Reply #2 on: January 09, 2025, 10:04:30 am »
Dear DonAlfredo,
thanks for your frank answer.
I agree that the library gap between C/C++ and freepascal regarding the Esp32 platform is huge.
As I am more proficient in Pascal (30+ years experience, it could be a good alternative to C and I like to pursue it a little more.

Thanks, Anthony

Thaddy

  • Hero Member
  • *****
  • Posts: 16411
  • Censorship about opinions does not belong here.
Re: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« Reply #3 on: January 09, 2025, 10:15:44 am »
To be able to use this device, I need wifi, LoRa, GUI, USB and all kinds of other libraries. To do this with FPC more or less impossible, due to the lack of libraries.
Isn't it more like the lack of header translations?
There is nothing wrong with being blunt. At a minimum it is also honest.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1790
Re: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« Reply #4 on: January 09, 2025, 10:30:27 am »
@Thaddy.
Yes and no. Yes for the C libraries. No for the C++ libraries.
The C++ libraries are a pain. They need to be flattened to C to be able to use them with FPC. I have done this for the Wio Terminal to be able to use USB and Wifi. Weeks of work. For me a no-go for more complex esp32 devices. With the native esp-tools, I am up and running in a few hours.

Thaddy

  • Hero Member
  • *****
  • Posts: 16411
  • Censorship about opinions does not belong here.
Re: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« Reply #5 on: January 09, 2025, 10:42:32 am »
Tbh I do the same. Still I will put it on my long time todo list, because it is doable.
There is nothing wrong with being blunt. At a minimum it is also honest.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1790
Re: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« Reply #6 on: January 09, 2025, 10:49:32 am »
Sidenote.
I have sometimes used ChatGPT to do some of the flattening. Works quite well after some trail and error.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1790
Re: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« Reply #7 on: January 09, 2025, 11:09:48 am »
@ajvperth
I am (also) a Pascal oldtimer. However, programming ESP in C by using the Arduino IDE is a breeze. Its very simple C syntax. Every library you can think of a few clicks away. Many examples to study. Just give it a try.
And besides, it seems that learning a new language keeps Parkinson away !

ccrause

  • Hero Member
  • *****
  • Posts: 989
Re: Fpcupdeluxe for esp32s2, esp32s3, esp32c2, esp32c3 and esp32c6?
« Reply #8 on: January 09, 2025, 12:46:09 pm »
Ideally in Lazarus | Project | Project options | Compiler options | Config and Target I see a -Cp option lx7 etc.
There is already compiler support for the following xtensa esp32 series: S2 & S3.  Also the RISC-V series C2, C3, C6.
The newer controllers are not yet added to the define template of Lazarus, but can be specified with the -Wp parameter in the project's Custom Options tab in Lazarus.  If I get time today I will update this and create a merge request.

Quote
What can I expect from https://github.com/michael-ring/espsdk4fpc/tree/devel? and how to use it?
This repository consists of scripts used to automate the building and packaging of SDK libraries and binutils ready for distribution with fpcupdeluxe (or just for use with FPC). Although the idea would be to support the latest SDK, the time required to test new releases is significant.  This branch was used to test the build process for the newer esp32 variants, so should be usable.

To test, check out the devel branch, the run the build.sh script. If successful it should create a couple of zip files with libraries and binary files for different targets.  These can be copied into the corresponding folders created by fpcupdeluxe for testing (although the folder structure may change, but I think you probably are starting to figure out how to adjust this).

This is probably too cryptic to get everything working, but please ask if you get stuck.

 

TinyPortal © 2005-2018