2024-04-10 05:17 AM
STMCubeIDE seems to give endless problems. Since the MX can generate c++ code what is the possibility of using all the generated files in C++ Builder? If This is possible, which files should I look for? Has anyone tried this before or will we just have to be stuck with STMCubeIDE.
I do note that many tutorials using STMCubeMX usually have their code generated using other toolchains and not the STMCubeIDE.
Could someone shed some light on this matter?
2024-04-10 05:33 AM - edited 2024-04-10 05:45 AM
C++ Builder is a native compiler for Windows - it cannot generate code for Cortex-M microcontrollers.
@techdesk wrote:STMCubeIDE seems to give endless problems.
I'm not sure that it's any worse (or better) than any comparable cross-development IDE?
You originally tacked this onto a thread about a debugger problem - such problems certainly are common with other cross-development IDEs.
@techdesk wrote:will we just have to be stuck with STMCubeIDE.
Of course we're not! There are many options available:
@techdesk wrote:I do note that many tutorials using STMCubeMX usually have their code generated using other toolchains and not the STMCubeIDE.?
Do they?
Please give some examples?
2024-04-10 05:44 AM
Looking at this screenshot, why do you feel that C++ Builder will not be able to compile this source?
This screen is almost identical to C++ Builder
2024-04-10 05:47 AM
Moved to the correct forum.
2024-04-10 05:48 AM
@techdesk wrote:why do you feel that C++ Builder will not be able to compile this source?
I didn't say that it wouldn't be able to compile it - I said that it wouldn't be able to generate code for a Cortex-M Target.
And that's before you even get to loading the code onto an MCU target, and debugging that code in the Target.
2024-04-10 05:55 AM
I see. But what I meant is that I could generate the necessary code with STM32CubeMX and then import those files into C++Builder. I will then make a COM connection with the STM32F4xxx board and then run the program.
The problem is that the files that the MX generates are confusing and I will not be able to know which files to use. The PROJECT file that the MX creates is a *.ioc project. That project is not compatible with the C++ Builder IDE
2024-04-10 06:01 AM
@techdesk wrote:I see.
Apparently not:
@techdesk wrote:I will then make a COM connection with the STM32F4xxx board and then run the program.
No, you can't: because the code that C++ Builder generates is for an Intel/AMD x86 processor - it will not run on a Cortex-M microcontroller; it is not Cortex-M code.
2024-04-10 06:13 AM
2024-04-10 06:39 AM
The code compiler on C++ Builder simply acts as an interface to "talk" to the STM32 board via a serial connection. I dont intend "uploading" to the STM32 Ic. I do this all the time with arduino boards. I have two problems with the arduino setup.
1. It is too slow compared to the STM32XXX
2. It cannot be accessed in "real time". The sketch must first be uploaded with a ton of "if-then- case" etc functions and iterate through the serial commands received from the host computer to select the "pre- programmed" function. This is very tedious and limited.
My Idea of the STM32 setup is that I could simply send live commands to the chip and do whatever the program in my C++ builder is set to do. For example, I create a button in C++ and access a GPIO on the STM32xxx via the generated STM32CUBEMX code to turn ON/OFF a LED. Like I said that this could be done with an Arduino board using serial commands, but it will not be "real time". The uploaded sketch (onto the Arduino) will wait for "if -then" strings and only THEN execute accordingly.
I do hope that I am making sense of this issue
2024-04-10 06:47 AM - edited 2024-04-10 06:50 AM
Well that's another completely different topic!
In that case, the tools you use to create the code that runs on the PC is irrelevant: all the microcontroller would see is commands coming into its UART - it would neither know nor care how those commands were created, or what was consuming its replies.
You could use any tools, and any language that could access the COM port.
It wouldn't even need to be running on a PC - it could be anything that can send & receive over the UART link.
See this thread:
https://community.st.com/t5/other-tools-mcus/stm32-api-for-delphi/m-p/644735#M5468
And, in that scenario, the MX-generated files would be irrelevant to the code running on the PC (or whatever).
The only thing the code running on the PC (or whatever) would need to know about would be the comms protocol over the UART link.
But you'd still need to use STM32 Tools (whether CubeIDE or something else) to write, load, and debug the code running on the STM32.