2024-02-27 09:56 AM
Hello All
I tried searching all over. Is there a STM32 API for Delphi program developers. The idea is that I am Delphi programmer who would like to design custom programs to read/write to STM32F4 development boards. STM32Cube IDE is fine for running the programs on the board. I need to design a custom GUI which will run on my PC so that I could interface with the boards through the USB. I could then read the status of any sensor etc attached to the boards and manipulate the data accordingly. Any know of such an API?
Solved! Go to Solution.
2024-02-27 11:10 AM
2024-02-27 11:10 AM
2024-02-27 11:18 AM
How do you interface with other Win32 DLL and API ?
Microsoft had all sorts of methods for Mixed Language calling conventions, covering C, FORTRAN, PASCAL, etc
I'd have thought Delphi would facilitate methods of interacting with the rest of the operating system.
Perhaps also ways for interfacing with the driver stack or USB URBs
2024-02-27 11:19 AM
Hello and thanks for the reply. You mention Firmata. How do I use this with Delphi? I am really unfamiliar with other languages. However I do know how to program Arduino. Delphi on the other hand will require some Library or component or an API (with all the commands, functions etc)
2024-02-27 12:32 PM
It's a communications protocol - so you'd need to implement that protocol.
Search for Firmata Clients:
https://www.google.com/search?q=delphi+firmata+client
Some more possibilities:
Telemetrix claims to be, "a user-extensible replacement for Standard Firmata without the complexity of Firmata"
https://mryslab.github.io/telemetrix/
KuttyPy seems a similar idea?
https://www.hackster.io/jithinbp/kuttypy-microcontrollers-via-real-time-android-pc-interface-afb47f
https://twitter.com/jithinbp_/status/1762099578428637420
2024-02-29 04:18 AM
Ok, I have uploaded the Firmata firmware onto a Uno arduino just for testing.
But now how do I communicate using Delphi. Is there not a "uses" unit or something? I just cannot just go ahead and use the firmata command eg: SET_PIN_MODE, 14, ANALOG.
Can I get some help here please
2024-02-29 06:35 AM - edited 2024-02-29 06:45 AM
@techdesk wrote:But now how do I communicate using <insert language here>.
Again, that's down to finding (or implementing) a suitable Formata Client - see the earlier search
@techdesk wrote:Is there not a "uses" unit or something?
Probably best to ask that on a Delphi forum?
@techdesk wrote:Can I get some help here please
Not really for Arduino or Delphi - they are going off-topic for this forum.
You'd be better asking in the Arduino forums: https://forum.arduino.cc/ - there were a few hits in the above-mentioned search ...
The key is to remember that the Arduino or STM32 or whatever is an entirely separate hardware unit, with a comms link to your PC - so what you need is to implement the PC-side of that comms link, in accordance with the Firmata protocol specification.
Addendum
There's a list of various clients here: https://github.com/firmata/arduino#firmata-client-libraries - I don't see Delphi, but maybe one/some of them might help you?
2024-02-29 06:51 AM - edited 2024-02-29 06:59 AM
@Andrew Neil wrote:the Arduino or STM32 or whatever is an entirely separate hardware unit, with a comms link to your PC - so what you need is to implement the PC-side of that comms link, in accordance with the Firmata protocol specification.
Like this:
from this tutorial on using Arduino Standard Firmata:
https://roboticsbackend.com/arduino-standard-firmata-tutorial/
it includes a utility to allow you to test it without having to write any PC-side code.
The communication is over a COM port - so, if you're implementing a Client in Delphi, your Delphi will need to interact with the COM port.
2024-02-29 07:07 AM
Thank you for all this info. Ok I did some extensive searching. I now know how to make C wrappers (Fimata) units for Delphi. That is sorted out. Only problem is I cannot find Firmata firmware to upload onto STM32 board. I can only find Firmata for Arduino. Any idea where to download or at least "convert" it to be used with the STM32 board?
2024-02-29 07:14 AM - edited 2024-02-29 07:14 AM
There are Arduino Cores for (some) STM32 boards; eg,
https://github.com/stm32duino/Arduino_Core_STM32
https://forum.arduino.cc/t/looking-for-stm32-micro-procrssors-for-for-arduino/1032253
https://www.arduino.cc/reference/en/libraries/stm32duino-examples/
Otherwise it comes back to implementing the Firmata protocol - this time on the STM32.