Skip to main content
kunyi
Associate
March 29, 2020
Solved

build STM32L071CBT project with STM32CubeIDE 1.2.1 failed(solve)

  • March 29, 2020
  • 2 replies
  • 1841 views

Update, choose "gnu11" not c11 for language standard

Hello,

I'm new bird on STM32CubeIDE,

create a new STM32L071CBTX project from STM32CubeIDE

first to configuration our pin definition and another resource than to generation code

and try build the project will get the below error message

but on another STM32F429/CortexM4 project the compiling passed and run well on chip.

I check the IDE with GNU Tools for STM( 7-2018q2 update)

0693W000000UvqYQAS.png

---------------------------------------------------------------------------------------------------------------------

arm-none-eabi-gcc ../Core/Src/sysmem.c -mcpu=cortex-m0plus -std=c11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Drivers/CMSIS/Include -I../Core/Inc -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage --specs=nano.specs -mfloat-abi=soft -mthumb -o Core/Src/sysmem.o

arm-none-eabi-gcc ../Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_tim_ex.c -mcpu=cortex-m0plus -std=c11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Drivers/CMSIS/Include -I../Core/Inc -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage --specs=nano.specs -mfloat-abi=soft -mthumb -o Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_tim_ex.o

../Core/Src/syscalls.c:66:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'

 register char * stack_ptr asm("sp");

                          ^~~

Info: Parallel threads used: 8

12:45:27 Build Failed. 1 errors, 0 warnings. (took 4s.78ms)

../Core/Src/sysmem.c:55:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'

 register char * stack_ptr asm("sp");

                          ^~~

../Core/Src/sysmem.c: In function '_sbrk':

../Core/Src/sysmem.c:65:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'

 extern char end asm("end");

                 ^~~

../Core/Src/sysmem.c:65:18: warning: implicit declaration of function 'asm' [-Wimplicit-function-declaration]

../Core/Src/sysmem.c:70:15: error: 'end' undeclared (first use in this function)

  heap_end = &end;

              ^~~

../Core/Src/sysmem.c:70:15: note: each undeclared identifier is reported only once for each function it appears in

../Core/Src/sysmem.c:73:24: error: 'stack_ptr' undeclared (first use in this function)

 if (heap_end + incr > stack_ptr)

This topic has been closed for replies.
Best answer by kunyi

@Amel NASRI​ , okay, update best answer,

must to pick up 'GNU11' in language standard options to enable GNU extensions

0693W000000VHx7QAG.png

2 replies

Amel NASRI
Technical Moderator
April 1, 2020

Hi @kunyi​ ,

Glad that you resolved your problem.

But it should be better to add the solution in a separate comment and select it as a best answer.

-Amel

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.
kunyi
kunyiAuthorAnswer
Associate
April 3, 2020

@Amel NASRI​ , okay, update best answer,

must to pick up 'GNU11' in language standard options to enable GNU extensions

0693W000000VHx7QAG.png