Recent

Author Topic: esp32c3  (Read 6208 times)

dbannon

  • Hero Member
  • *****
  • Posts: 3568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: esp32c3
« Reply #30 on: September 11, 2025, 01:16:28 pm »
Yep, thats great !  I just pulled down a fresh copy and reinstalled, tested all good.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 3568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: esp32c3
« Reply #31 on: September 19, 2025, 06:10:42 am »
OK, so, not surprisingly, Espressif have released an update to SDK 5.5.  Its 5.5.1 and is described as 'Stable' whereas 5.5 is a beta.

I have installed and using pretty much the same model as you worked out, tested the blink.pas mentioned above. All good except the linker is called without an explicate path to where memory.ld and sections.ld are. Its easy enough to add that path with a -L instruction to linker but I cannot see why its necessary, or, more accurately, I cannot see how the 5.5 version did not need it.

We still have the linker fail to generate a bin file from the elf file, still works perfectly if done using a subsequent call to esptool.py.  If I understood just where the linker gets its instructions from, I'd disable that call, lets just make the call from a build script.

Anyway, I'll update the wiki with this information, recommend people use 5.5.1 and see what else can be done there. I think I will advise people to move the esp-idf-snapshot up to ESP_HOME. Leaving it down in the (c code) hello_world directory feels a bit strange to me.

I'd still like to test out the esp32s3 I have now but not sure when !

Davo

 
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 3568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: esp32c3
« Reply #32 on: October 26, 2025, 02:29:59 am »
Once again, I went off an did what I needed with C. Probably bad C.

Honestly, while FPC can make esp32xx code and thats a great credit to ccrause and others, its not a working system for several reasons

  • Expressif keep releasing new chips.
  • Expressif keep releasing new SDK
  • We really need the equivalent of the RTL/FCL, a compiler is not enough.
Now, a suggested alternative approach ?  Superficial, not had time to really investigate but ?

As well as the Expressif SDK, they also support an interface to Arduino. And Arduino now support "Plugins" to its IDE. So, right now, its convenient to use the Arduino IDE to develop, compile and upload code to an ESP32c3 or ESP32s3 boards. Using the Arduino version of C, no C++, no cmake visible anywhere ! 

So, this Arduino C is a much more static target than Expressif's SDK, if we were make an interface to it instead, its then up to the Expressif-Arduino project to support new chips/SDK. And, of course, other chips/boards that Arduino also, incidentally support.

Arduino have a command line tool that builds and uploads to my ESP32c3, its a binary rather than a script so not easy to see what its doing but source is available.

Thoughts ?

EDIT : https://forum.arduino.cc/t/does-it-support-using-a-custom-linker-script-through-the-command-line/1199591

Davo
« Last Edit: October 26, 2025, 02:39:11 am by dbannon »
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

ccrause

  • Hero Member
  • *****
  • Posts: 1080
Re: esp32c3
« Reply #33 on: October 26, 2025, 12:11:32 pm »
Now, a suggested alternative approach ?  Superficial, not had time to really investigate but ?

As well as the Expressif SDK, they also support an interface to Arduino. And Arduino now support "Plugins" to its IDE. So, right now, its convenient to use the Arduino IDE to develop, compile and upload code to an ESP32c3 or ESP32s3 boards. Using the Arduino version of C, no C++, no cmake visible anywhere ! 

So, this Arduino C is a much more static target than Expressif's SDK, if we were make an interface to it instead, its then up to the Expressif-Arduino project to support new chips/SDK. And, of course, other chips/boards that Arduino also, incidentally support.

I agree with your motivation for investigating something a bit more stable than esp-idf.  The problem I expect with the Arduino libraries is that they are C++ based.  For example the WiFi class uses multiple inheritance, while the WebServer class uses a generic streamFile method.

It is not easy to link to these classes directly from FPC.  A short Delphi centric explanation of why this is not easy (by the late Rudy Velthuis) Using C++object with Delphi. An older FPC document (refer to chapter 4) which discusses flattening of the C++ interface.  The issues with linking against C++ classes may be old, I don't know what the current status is.

dbannon

  • Hero Member
  • *****
  • Posts: 3568
    • tomboy-ng, a rewrite of the classic Tomboy
Re: esp32c3
« Reply #34 on: October 27, 2025, 11:17:53 am »
Hmm, yes,  I see. While Expressif does have cpp code, seem the actual API is all C.  I write just C in the Arduino-ESP32 tests but there behind is the dreaded cpp.

Interestingly, the arduino command line tool is written in go ! Sigh...

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018