Skip to main content
MQi.1
Senior II
February 15, 2020
Question

Should I set gcc in CubdIDE ?

  • February 15, 2020
  • 14 replies
  • 3201 views

I want to bink a led on NUCLEO-G474RE, I used CubeMX and CudeIDE.

Since I don' t want to use IAR or Keil, so I select CubeIDE toolchain in CudeMX.

The code generated and has been opened as project in CubeDE, and the two lines has been added in main():

    HAL_GPIO_TogglePin (GPIOB, GPIO_PIN_11);

    HAL_Delay (100);

While, when I start to build, this info prompted:

Building in: E:\Blink_G474RE\build\default

make -f ..\..\Makefile

Error: build command 'make' not foundError:

What's wrong with it ?

Should I set the gcc environment variable manually?

I have heard gcc is the default build tool for CubeIDE, is there something I misunderstand ?

This topic has been closed for replies.

14 replies

KnarfB
Super User
February 15, 2020

STMCubeIDE comes with all tools needed to build a STM32 project.

Check Project > Properties > C/C++ Build. It should look like:

0690X00000DBCqIQAX.pngand Project > Properties > C/C++ Build > Environment contains the path to all tools neded:

0690X00000DBCqNQAX.png

The paths are, among others:

C:\ST\STM32CubeIDE_1.1.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\bin;

C:\ST\STM32CubeIDE_1.1.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.make.win32_1.1.0.201910081157\tools\bin;

Your settings may vary depending on your version and install options, but they should point to the existing tools installed by STMCubeIDE.

hth

KnarfB

Pavel A.
Super User
February 15, 2020

Try Internal builder.

If your computer is managed by IT at work, ask them to stop tampering with your applications.

-- pa

MQi.1
MQi.1Author
Senior II
February 17, 2020

My fold is empty.0690X00000DBdYzQAL.png

KnarfB
Super User
February 17, 2020

This doesn't look like a STM32 Project at all. Try again creating a new STM32 Project in a new folder from scratch. Follow "How to use STM32CubeIDE" video https://www.youtube.com/watch?v=imXauCiwEfs as close as possible.

MZuba.1
Associate
February 17, 2020

Do not create c/c++ project try to create a new stm32 project. As far as i know if you are using STMCUBE IDE you don't need Cube mx separately.

make a new project from the ide. Most things are configured automatically.

MQi.1
MQi.1Author
Senior II
February 18, 2020

I used CubeMX first, then I imported the MX project into IDE, I wanted to build a project in the imported project from MX.

Ivaylo Ilchev
Associate
February 18, 2020

If you used New->STM32 Project From STM32CubeMX .ioc File, all must work fine. Recently I converted one old fat project from CubeMX + Workbench. But tryouts with old IDE versions had problems. I have 1.21 version now.

MQi.1
MQi.1Author
Senior II
February 19, 2020

This solution works.0690X00000DBqSVQA1.png0690X00000DBqSLQA1.png

KnarfB
Super User
February 18, 2020

Check that in you have set Toolchain/IDE to "STM32CubeIDE" in STM32CubeMX Project Manager before generating code.

MQi.1
MQi.1Author
Senior II
February 19, 2020

This option, I have selected.

MQi.1
MQi.1Author
Senior II
February 19, 2020

While, now the project met 5 errors:

../Core/Src/main.c: In function 'main':

../Core/Src/main.c:107:3: warning: "/*" within comment [-Wcomment]

  /* USER CODE END 3 */

../Core/Src/main.c:167:13: error: invalid storage class for function 'MX_LPUART1_UART_Init'

 static void MX_LPUART1_UART_Init(void)

            ^~~~~~~~~~~~~~~~~~~~

../Core/Src/main.c:213:13: error: invalid storage class for function 'MX_GPIO_Init'

 static void MX_GPIO_Init(void)

            ^~~~~~~~~~~~

../Core/Src/main.c:269:1: error: expected declaration or statement at end of input

 }

 ^

../Core/Src/main.c: At top level:

../Core/Src/main.c:52:13: warning: 'MX_GPIO_Init' used but never defined

 static void MX_GPIO_Init(void);

            ^~~~~~~~~~~~

../Core/Src/main.c:53:13: warning: 'MX_LPUART1_UART_Init' used but never defined

 static void MX_LPUART1_UART_Init(void);

            ^~~~~~~~~~~~~~~~~~~~

../Core/Src/main.c:263:6: warning: 'Error_Handler' defined but not used [-Wunused-function]

 void Error_Handler(void)

     ^~~~~~~~~~~~~

../Core/Src/main.c:213:13: warning: 'MX_GPIO_Init' defined but not used [-Wunused-function]

 static void MX_GPIO_Init(void)

            ^~~~~~~~~~~~

../Core/Src/main.c:167:13: warning: 'MX_LPUART1_UART_Init' defined but not used [-Wunused-function]

 static void MX_LPUART1_UART_Init(void)

            ^~~~~~~~~~~~~~~~~~~~

../Core/Src/main.c:114:6: warning: 'SystemClock_Config' defined but not used [-Wunused-function]

 void SystemClock_Config(void)

     ^~~~~~~~~~~~~~~~~~

arm-none-eabi-gcc "../Core/Src/system_stm32g4xx.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DSTM32G474xx -DDEBUG -c -I../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Include -I../Drivers/CMSIS/Device/ST/STM32G4xx/Include -I../Core/Inc -I../Drivers/STM32G4xx_HAL_Driver/Inc -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/system_stm32g4xx.d" -MT"Core/Src/system_stm32g4xx.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/system_stm32g4xx.o"

make: *** [Core/Src/subdir.mk:33: Core/Src/main.o] Error 1

make: *** Waiting for unfinished jobs....

"make -j8 all" terminated with exit code 2. Build might be incomplete.

10:16:26 Build Failed. 5 errors, 7 warnings. (took 4s.110ms)

after I added 2 lines here:

   /* USER CODE BEGIN 3 */

    HAL_GPIO_TogglePin (GPIOB, GPIO_PIN_11);

    HAL_Delay (100);  /* Insert delay 100 ms *

 }

 /* USER CODE END 3 */

MQi.1
MQi.1Author
Senior II
February 19, 2020

0690X00000DBqSzQAL.pngThose errors happened when I click the left button, when I click the right button, no errors and warnings.

and, when I commented these 2 lines:

    HAL_GPIO_TogglePin (GPIOB, GPIO_PIN_11);

    HAL_Delay (100);  /* Insert delay 100 ms *

everything was OK.

MQi.1
MQi.1Author
Senior II
February 19, 2020

Thanks, I found the reason:

There was lack of "/" at the end of the second line.

Now alas ist OK.

MQi.1
MQi.1Author
Senior II
February 19, 2020

The new question is: could I upload the program inside IDE, or I must use CubeProg ?