cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone help for my first C++ code build and execution on STM32MP1?

FAuza.1
Associate III

Hi, I need help to compile, build and upload a C++ code on an STM32MP157F-DK2 board. Can anyone help me? Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
RomainR.
ST Employee

Hello @FAuza.1 (Community Member)

I can suggest you to follow the STM32MPU wiki below:

Create a simple hello-world application - stm32mpu

The given example explains a cross compilation of a C code with GTK and its makefile using the stm32mp1-openstlinux Developer-Package.

Then it is transferred and executed on the STM32MP15x-DK2.

For a C++ code, the method is identical.

Thank in advance to select my post as best answer.

Best regards,

Romain,

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.

View solution in original post

8 REPLIES 8
RomainR.
ST Employee

Hello @FAuza.1 (Community Member)

I can suggest you to follow the STM32MPU wiki below:

Create a simple hello-world application - stm32mpu

The given example explains a cross compilation of a C code with GTK and its makefile using the stm32mp1-openstlinux Developer-Package.

Then it is transferred and executed on the STM32MP15x-DK2.

For a C++ code, the method is identical.

Thank in advance to select my post as best answer.

Best regards,

Romain,

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.

FAuza.1
Associate III

Thank you Romain

I should have explained that I'm working on Windows 10, and I'd like to use the STM32CubeIDE tool. The example you suggest is on Linux, which I don't have.

What I need is a clear explanation on how to connect the board and to use the STM32CubeIDE software to run a simple code that prints Hello World in a console such as putty or MobaXterm

RomainR.
ST Employee

How to connect the board, follow Wiki Getting Started:

STM32MP157x-DK2 - stm32mpu

Developing with STM32CubeIDE on Cortex-M4 in the same wiki (next chapters) in a way very similar to an STM32 MCU:

Develop on Arm® Cortex®-M4 - stm32mpu

It should work under Windows, but using Linux will give you a better experience.

Best regards,

Romain,

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.

FAuza.1
Associate III

Thank you Romain

I have the supply and the ST link connections, do I need the USB OTG connection as well ?

RomainR.
ST Employee

You must apply what is documented in Wiki Getting started for your board.

I'm sorry to insist but you should follow this tutorial to the end.

Best regards,

Romain,

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.

FAuza.1
Associate III

Hi Romain

I'm going through the tutorial, and I have a problem at the step "Modify, rebuild and reload a firmware". Everything has gone fine until that point. I have imported and built the firmware, but the CubeIDE does not detect my board.

What I do is:

  • connect the board to the computer with the ST-link cable. I can see the ST Link virtual COM port in the device manager.
  • power on the board. The red led between the user buttons is blinking. But the board is not detected, status remains "offline" in the IDE lower right corner.

Should I do something on the Boot switches? I tried bith ON and both OFF with no luck.

RomainR.
ST Employee

Hello FAuza.1 (Community Member)

It depend if you are trying to load firmware thru Linux (Production mode with Boot2=Boot0=1) or if you are thru JTAG/SWD (Engineering mode with Boot2=1; Boot0 = 0) ?

Here below videos that will help you, in particular part 03 How to debug M4 in engineering mode with STM32CubeIDE.

https://www.youtube.com/playlist?list=PLnMKNibPkDnFp5YvrvWjgfjrOs0Vi34Mt

Best regards

Romain

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.

FAuza.1
Associate III

Thanks. I managed to load a firmware.