2024-02-22 03:28 AM
I want to make a GUI with C# that I could choose the STM32 microcontroller and the xxx.elf file and programming it without using STM32CubeProgrammer with USB .
With the STM32CubeProgrammer it is look like this:
What to look for? where should I begin?
I saw that there is an API for STM32CubeProgrammer on C++. is there an option to call C++ program to C#?
2024-02-22 05:56 AM
Not much out there on using C# on a microcontroller. It is not common. See here for the only promising thing I saw. No affiliation, seems fine.
https://www.nanoframework.net/
Fairly sure you can call C++ libraries from C#.
> programming it without using STM32CubeProgrammer with USB
Doesn't calling the STM32CubeProgrammer API come with the same drawbacks as using the tool itself?
2024-02-22 04:18 PM - edited 2024-02-22 04:28 PM
Yes you can use that API. But it is in C++ with dependency on Qt runtime libraries, and it hauls a lot of data files with it. If this is fine for you, make wrappers for native C++ code as usual in C# and basically that's all.
If you need help in interfacing C# with C++, please visit the Microsoft forums or look here.
Or, you can start "from scratch", write a C# program that works with WinUSB API (this is how USB DFU bootloader of STM32 looks to host), and convert .elf file to format that DFU understands. This is harder but doesn't haul dependencies.