cancel
Showing results for 
Search instead for 
Did you mean: 

Using C++ Builder

techdesk
Associate III

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?

10 REPLIES 10
Andrew Neil
Evangelist III

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:

  • Commercial - IAR, Keil, Rowley, Segger, et al
  • Other open-source options - Eclipse, VS Code, Arduino IDE, etc ...

 


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

techdesk_0-1712752972742.png

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

 

SofLit
ST Employee

Moved to the correct forum.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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

techdesk
Associate III

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


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

 

 


@techdesk wrote:

 I will then make a COM connection with the STM32F4xxx board 


 

AndrewNeil_2-1712754795425.png

 

 

 

techdesk
Associate III

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

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.