cancel
Showing results for 
Search instead for 
Did you mean: 

Hard to track down the actual cause.

Md Mubdiul Hasan
Associate III
Posted on November 09, 2016 at 06:13

Hi,

In the project properties setting, I am using arm-none-eabi-gcc toolchain.

This time toolchain is Ac6 STM32 MCU GCC and builder CDT internal.

Problem is if I add h files in HAL library that error log suggest me to do, it solved and if I build project again it shows the problem in CMSIS include H files.

0690X0000060MnYQAU.gif

Such as,

1. C:\STM32_toolchain\common\Drivers\CMSIS\Device\ST\STM32F0xx\Include/stm32f0xx.h:187:3: error: declaration for parameter 'FunctionalState' but no such parameter

} FunctionalState;

^

..\inc\Src\stm32f0xx_hal_flash_ex.c:990:1: error: expected '{' at end of input

}

^

..\inc\Src\stm32f0xx_hal_flash_ex.c:990:1: warning: control reaches end of non-void function [-Wreturn-type]

}

^

APIs, Headers,state machine files are exists in Project branch, but why the compiler showing errors in H files of driver ?

Looking at C code structure related reason, yes I found some style of C coding in CMSIS h files is different.

what should I do now?

1. CDT does not showing errors of my main files, there was a return type problem, I solved it.

3. I think compiler is compiling all files listed in project branch , do you want me to remove some of the files from project folder, is it repeating again as I include paths from C driver?

4. Is there any setting for which only compile my c file?

5. Do you believe, updated version of Java/gcc/Eclipse is needed ?

I am using this HAL driver STM32Cube_FW_F0_V1.6.0 downloaded from STM website.

Hope you will give me some good suggestions.

Regards

HASAN

#arm-cmsis-driver-pack #error #error #demonstration-builder #adding-files-to-the-project #arm-gcc #know-your-tools #arm-gcc #gcc

Note: this post was migrated and contained many threaded conversations, some content may be missing.
1 ACCEPTED SOLUTION

Accepted Solutions
AvaTar
Lead
Posted on November 21, 2016 at 11:33

> You mean the version could make such errors? Eclipse arguing this   ''_ll_'' stuff .

After realizing that CubeMX did not meet everybody's expectations, the came up with the ''Low Level'' library.

This ''Low Level'' lib is part of CubeMX, or a sub-set thereof, and are labelled with this ''_ll_'' part in their name.

However, in some cases (especially for the STM32F7 I checked), this Low Level lib is nothing but a sorry stub (i.e. unusable fragments).

According to some comments on other threads, it is supposed to be complete for the STM32L4, ''with support for other MCUs in progress'' - whatever this means.

Here, my Cube - related knowledge ends ...

View solution in original post

46 REPLIES 46
AvaTar
Lead
Posted on November 09, 2016 at 09:34

> 1. CDT does not showing errors of my main files, there was a return type problem, I solved it.

You might have come across an issue with most Eclipse IDEs - the parser it uses in the editor view is NOT the toolchain/compiler it uses for the build.

Obviously, the target compiler is the decisive criteria here.

> ..\inc\Src\stm32f0xx_hal_flash_ex.c:990:1: error: expected '{' at end of input

 

I would try adding the ''-E'', and view the preprocessed output the compiler would see.

> Problem is if I add h files in HAL library that error log suggest me to do, ...

 

For certain reasons, I do not speak CubeMX lingo.

Md Mubdiul Hasan
Associate III
Posted on November 09, 2016 at 10:11

Dear Sir Avater,

Thank you to keep your eyes here!

I think, I have to cope up more with IDEs.

Still working in 3 different, IDE, Eclipse, Coocox and Keil.

Eclipse showing more errors in same project, even I have include paths correctly, set GCC, lib  at right way.

1.Do you talking about setting in Preferences> c/c++>makefile error persor?

2. Where you wanted to adding -E?

3.Preprocessed output setting is where?

4. For code generation, dont you suggest cubemx?

 

AvaTar
Lead
Posted on November 09, 2016 at 11:06

> Still working in 3 different, IDE, Eclipse, Coocox and Keil.

 

Coocox is also Eclipse-based, at least it was the last time I had a look (and discarded it).

> 1.Do you talking about setting in Preferences> c/c++>makefile error persor?

 

I never tried to mess with the parser settings, and simply ignored those parser remarks. Just to clarify, I experienced the same issue with Eclipse-based toolchains for the x86 family ...

> 2. Where you wanted to adding -E?

 

> 3.Preprocessed output setting is where?

 

On a plain Eclipse it looks like this (right-click on the project, select ''Options...''):

0690X00000603D2QAI.jpg

The generated (preprocessed) source ends up somewhere in the Debug sub-path (for the Debug build).

> 4. For code generation, dont you suggest cubemx?

For several F0 variants, you should (still) have the option to download and use the ''old'' SPL. It is a much thinner and ''much less awkward'' library, and proven to be less buggy than Cube. The free EmBlocks/EmBitz toolchain supports this SPL ''out-of-the-box''.

For newer MCUs, you can just resort to ''register-hacking'', or free libs (if you find one ...).

IMHO CubeMX is an twisted mess - but this is just my personal opinion.

Md Mubdiul Hasan
Associate III
Posted on November 10, 2016 at 02:58

Dear Sir  AvaTar,

People says , Coocox is dead really.

Looking at your suggestion, I have change the setting. Now  the console says, 

Info: Internal Builder is used for build

arm-none-eabi-gcc -mthumb -mfloat-abi=soft -E ''-IC:\\STM32_toolchain\\arm-none-eabi\\bin'' ''-IC:\\STM32_toolchain\\bin'' ''-IC:\\STM32_toolchain\\common\\Drivers\\STM32F0xx_HAL_Driver\\Inc'' ''-IC:\\STM32_toolchain\\common\\Drivers\\STM32F0xx_HAL_Driver\\Src'' ''-IC:\\STM32_toolchain\\lib\\gcc'' ''-IC:\\STM32_toolchain\\arm-none-eabi\\lib'' -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -o ''inc\\Src\\stm32f0xx_hal_i2s.o'' ''..\\inc\\Src\\stm32f0xx_hal_i2s.c'' 

In file included from C:\STM32_toolchain\common\Drivers\STM32F0xx_HAL_Driver\Inc/stm32f0xx_hal_rcc.h:47:0,

                 from C:\STM32_toolchain\common\Drivers\STM32F0xx_HAL_Driver\Inc/stm32f0xx_hal_conf.h:186,

                 from C:\STM32_toolchain\common\Drivers\STM32F0xx_HAL_Driver\Inc/stm32f0xx_hal.h:48,

                 from ..\inc\Src\stm32f0xx_hal_i2s.c:139:

C:\STM32_toolchain\common\Drivers\STM32F0xx_HAL_Driver\Inc/stm32f0xx_hal_def.h:48:23: fatal error: stm32f0xx.h: No such file or directory

compilation terminated.

Those errors I got before, still  stm32f0xx.h is exists on the path.

I have something to tell you  that,

1. If I created a code through Cubemx and import files by Ecilipse, then system build work fine.

 2. If I add files and folders after open my main.c file and linked the currected path and gcc, system starts noise and errors!

3. If I open existing project, system gets agin lot of error, and continues.....

AvaTar
Lead
Posted on November 10, 2016 at 08:19

> People says , Coocox is dead really.

 

Perhaps not dead, but nothing for me.

> Those errors I got before, still  stm32f0xx.h is exists on the path.

This file should be in one of the defined include paths - these are the one's given with ''

-I

'' in the console:

''-IC:\\STM32_toolchain\\arm-none-eabi\\bin'' ''-IC:\\STM32_toolchain\\bin'' ''-IC:\\STM32_toolchain\\common\\Drivers\\STM32F0xx_HAL_Driver\\Inc'' ''-IC:\\STM32_toolchain\\common\\Drivers\\STM32F0xx_HAL_Driver\\Src'' ''-IC:\\STM32_toolchain\\lib\\gcc'' ''-IC:\\STM32_toolchain\\arm-none-eabi\\lib''

The stm32fxxx.h file(s) are usually to find in the folder:

...\STM32Cube_xxx\Drivers\CMSIS\Device\ST\STM32Fxxx\Include

The ''xxx'' part of this name depends on the actual device. I miss this path in your list.

I can't really give much support for Coocox, since I don't have/use it - for several (obvious) reasons.

In your place, I would try to migrate to a toolchain/IDE you feel comfortable with. You are not the only one struggling with Eclipse...

Md Mubdiul Hasan
Associate III
Posted on November 10, 2016 at 09:37

Dear Sir,

Thank you once again, at least I could realize where the mistake is formed.

>This file should be in one of the defined include paths....do you mean one path is fine in case of project properties .. .environment,,,setting,,,etc?

>The ''xxx'' part of this name depends on the actual device. I miss this path in your list.......this is STM32F070RBTx type mcu.

1. If coocox is not dead you think, can you tell me why startup_stm32f070xb.s is not support, its true error massage is showing that java.Null.lang has problem there.

2. I am trying things in Keil now, looks system is well arranged, no setting for include path or other stuffs, no other way to import project, what I am doing is making same folder adds files there and at last find 

RTE\Device\STM32F070RB\system_stm32f0xx.c: 0 warnings, 1 error

''.\Rice_heat_circuit.axf'' - 34 Error(s), 0 Warning(s).

Target not created.

Build Time Elapsed:  00:00:02

3. Dont you think there is a problem that I am adding files from different location and compiler cant recognize it well?

4. Keil  suggested just open some ready-mate project for particular board, dont you thing I can use those example, just need to change files there as required ?

Some of the errors here....

compiling stm32f0xx_hal_msp.c...

stm32f0xx_hal_msp.c(35): error:  #5: cannot open source input file ''stm32f0xx_hal.h'': No such file or directory

  #include ''stm32f0xx_hal.h''

stm32f0xx_hal_msp.c: 0 warnings, 1 error

compiling system_stm32f0xx.c...

C:\Keil_v5\ARM\PACK\Keil\STM32F0xx_DFP\1.5.0\Device\Include\stm32f070xb.h(130): error:  #5: cannot open source input file ''core_cm0.h'': No such file or directory

  #include ''core_cm0.h''            /* Cortex-M0 processor and core peripherals */

system_stm32f0xx.c: 0 warnings, 1 error

compiling stm32f0xx_it.c...

stm32f0xx_it.c(34): error:  #5: cannot open source input file ''stm32f0xx_hal.h'': No such file or directory

  #include ''stm32f0xx_hal.h''

stm32f0xx_it.c: 0 warnings, 1 error

compiling flash_conf.c...

C:\Keil_v5\ARM\PACK\Keil\STM32F0xx_DFP\1.5.0\Device\Include\stm32f070xb.h(130): error:  #5: cannot open source input file ''core_cm0.h'': No such file or directory

  #include ''core_cm0.h''            /* Cortex-M0 processor and core peripherals */

C:\Users\swend95_하산\Desktop\Old_rice_cooker\Final_Source\flash\app\flash_conf.c: 0 warnings, 1 error

compiling stm32f0xx_hal.c...

C:\Users\swend95_?ì„�궛\Desktop\Old_rice_cooker\Final_Source\common\Drivers\STM32F0xx_HAL_Driver\Src\stm32f0xx_hal.c(54): error:  #5: cannot open source input file ''stm32f0xx_hal.h'': No such file or directory

  #include ''stm32f0xx_hal.h''

C:\Users\swend95_하산\Desktop\Old_rice_cooker\Final_Source\common\Drivers\STM32F0xx_HAL_Driver\Src\stm32f0xx_hal.c: 0 warnings, 1 error

compiling stm32f0xx_hal_dma.c...

C:\Users\swend95_?ì„�궛\Desktop\Old_rice_cooker\Final_Source\common\Drivers\STM32F0xx_HAL_Driver\Src\stm32f0xx_hal_dma.c(104): error:  #5: cannot open source input file ''stm32f0xx_hal.h'': No such file or directory

AvaTar
Lead
Posted on November 10, 2016 at 12:26

>do you mean one path is fine in case of project properties .. .environment,,,setting,,,etc?

 

Basically, yes. You should set this in the project settings (similar to the posted image).

Optimally, one would define base paths using environment variables, and refer to that environment variables in the project settings. Eclipse supports this, not sure what Coocox does.

> 1. If coocox is not dead you think, can you tell me why startup_stm32f070xb.s is not support, its true error massage is showing that java.Null.lang has problem there.

 

With ''not dead'', I mean it is (or was) still supported by developers, and has a user community. There is (at least was) even a forum.

Not sure what ''java.Null.lang'' means in this context. I would bet on a bug, instead of missing support.

> 2. I am trying things in Keil now, looks system is well arranged, no setting for include path or other stuffs, no other way to import project, what I am doing is making same folder adds files there and at last find 

If you setup a project from scratch, you need to do this as well...

With the example projects, some one has done it for you.

> 3. Dont you think there is a problem that I am adding files from different location and compiler cant recognize it well?

 

Usually not a problem.

Problems may arise if you use the same (library) files in different projects.

> 4. Keil  suggested just open some ready-mate project for particular board, dont you thing I can use those example, just need to change files there as required ?

 

This is the preferred way to start with a new environment. Just remove/add functionality as you like, and try to build often.

Bake care to select a project with the correct MCU variant. Changing this later on tends to be somewhere between difficult and impossible.

BTW, Keil is not Eclipse-based (a plus point for many, including me), and has a good and responsive forum as well.

Downside is, it is either code-size limited or quite expensive.

Md Mubdiul Hasan
Associate III
Posted on November 11, 2016 at 05:28

Dear Sir,

Having your idea, I think errors are minimized compared to before.

Info: Internal Builder is used for build

arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -E -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F070xB ''-IC:\\STM32_toolchain\\arm-none-eabi\\include'' ''-includeC:\\Users\\swend95_하산\\Desktop\\Old_rice_cooker\\Final_Source\\command\\comdef.h'' -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -o ''Drivers\\STM32F0xx_HAL_Driver\\stm32f0xx_hal_rcc_ex.o'' ''..\\..\\..\\Drivers\\STM32F0xx_HAL_Driver\\Src\\stm32f0xx_hal_rcc_ex.c'' 

..\..\..\Drivers\STM32F0xx_HAL_Driver\Src\stm32f0xx_hal_rcc_ex.c:44:27: fatal error: stm32f0xx_hal.h: No such file or directory

compilation terminated.

This time I have open code from cubemax generated SW4STM32.

At the same time I am using KEIL( using CoIDE project), but may be there is some problem to adding the file from different location, I dont understand why compiler showing such kind of errors,

C:\Users\swend95_?ì„�궛\Desktop\Old_rice_cooker\Final_Source\common\Src\stm32f0xx_it.c(34): error:  #5: cannot open source input file ''stm32f0xx_hal.h'': No such file or directory

Seems CMISIS is also not support, C:\Keil_v5\ARM\PACK\Keil\STM32F0xx_DFP\1.5.0\Device\Include\stm32f070xb.h(130): error:  #5: cannot open source input file ''core_cm0.h'': No such file or directory

Do you want me to copy all my files in folder from old CoIDE project to KEIL?

AvaTar
Lead
Posted on November 11, 2016 at 08:09

> At the same time I am using KEIL( using CoIDE project), but ...

Not sure how this is meant, but usually, this doesn't work.

The format of the project file(s) is highly IDE specific, and rarely do toolchains support the import of ''foreign'' formats. And I'm pretty sure Keil uVision does not support Coocox projects.

The build settings (including the list of include directories) is part of this project settings. And obviously it got ''lost'', because the build complains about basic headers not found.

I would start over, using Keil.

Pick an example project for the proper MCU. It should build out-of-the-box. Then you can remove unneeded functionality, and add your own, step by step.

Or, create a new (empty or ''hello world'' style) project for your MCU, and add your functionality.

With both ways, all the basic include folders, libraries and startup files are already defined.

I'm using CrossWorks, which is not supported directly by ST. When using any of the ST examples, I used this second way (create a new project, and just add the specific sources).

It takes me about 10 .. 15 minutes to add all files and paths.

Trying to ''tweak'' a Keil, IAR, Atollic or SW4STM project never worked for me.

> C:\Users\swend95_

?�궛

\Desktop\Old_rice_cooker\...

 

Not sure if the special characters in the path names make problems, too. In theory, it should not ...