cancel
Showing results for 
Search instead for 
Did you mean: 

build STM32L071CBT project with STM32CubeIDE 1.2.1 failed(solve)

kunyi
Associate II

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)

1 ACCEPTED SOLUTION

Accepted Solutions
kunyi
Associate II

@Amel NASRI​ , okay, update best answer,

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

0693W000000VHx7QAG.png

View solution in original post

2 REPLIES 2
Amel NASRI
ST Employee

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
Associate II

@Amel NASRI​ , okay, update best answer,

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

0693W000000VHx7QAG.png