cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 API for Delphi

techdesk
Associate III

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? 

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Evangelist III
13 REPLIES 13
Andrew Neil
Evangelist III

Sounds like you're looking for something like Firmata:

https://github.com/firmata/

https://github.com/MrYsLab/FirmataExpress

 

 

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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)

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

 

techdesk
Associate III

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

 


@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?


@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:

AndrewNeil_0-1709218749558.png

 

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.

techdesk
Associate III

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?