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.
46 REPLIES 46
AvaTar
Lead
Posted on November 18, 2016 at 07:31

>In file included from ..\src\main.c:8:0:

 

>C:\STM32_toolchain\common\Drivers\CMSIS\Device\ST\STM32F0xx\Include/stm32f0xx.h:167:3: error: #error ''Please select first the target STM32F0xx device used in your application (in stm32f0xx.h file)''

 

  #error ''Please select first the target STM32F0xx device used in your application (in stm32f0xx.h file)''

You just need to do as it says.

I have a STM32F7 Cube here (which I don't use), where the relevant part of the stm32f7xx.h header looks like this:

/** @addtogroup Device_Included

  * @{

  */

#if defined(STM32F756xx)

  #include ''stm32f756xx.h''

#elif defined(STM32F746xx)

  #include ''stm32f746xx.h''

#elif defined(STM32F745xx)

  #include ''stm32f745xx.h''

#elif defined(STM32F765xx)

  #include ''stm32f765xx.h''

#elif defined(STM32F767xx)

  #include ''stm32f767xx.h''

#elif defined(STM32F769xx)

  #include ''stm32f769xx.h''

#elif defined(STM32F777xx)

  #include ''stm32f777xx.h''

#elif defined(STM32F779xx)

  #include ''stm32f779xx.h''  

#else

 #error ''Please select first the target STM32F7xx device used in your application (in stm32f7xx.h file)''

#endif

You something similar in the stm32f0xx.h file, for the STM32F0.

Define the macro that matches the MCU derivate you use.

The best place is in the project settings, with ''Preprocessor Macros''.

I expect the Keil uVision ''wizard'' to do this for you when creating a new project.

Md Mubdiul Hasan
Associate III
Posted on November 18, 2016 at 08:19

Dear Sirt AvaTar,

Thank you sir, its a reason may be.

I saw it in Keil while trying cubemx there.

It means, you want me to try only Keil uVision.

In Ecilipse the over all report is here,

Indexed 'notun_pj' (120 sources, 31 headers) in 0.87 sec: 4,624 declarations; 40,515 references; 11 unresolved inclusions; 360 syntax errors; 15,284 unresolved names (25%)

Still huge errors need to be solve.

 I will activate my project on Keil.

But, before that I have some question in my mind.

1. Dont you think, if project folder(containing HAL driver and so on) living in desktop and Toolchain lives in C , then if we add include files from Toolchain(containing HAL driver and so on), isnt it a mistake?

2. Eclipse also said, ''Error: Cannot run program ''gcc'': Launching failed '', is it means gcc path has not been included ?

3. Are you sure, we dont have any during making new project, I have just open it and playing wrongly may be. People did mistake, http://www.openstm32.org/file16?fileId=235&view=page.

 4. My CoIDE based project which I am working in Keil, shows CMSIS  adapting problem, dont you think CMSIS should be add from their install pak system?

Best Regards

Hasan

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

> It means, you want me to try only Keil uVision.

 

Not exactly. That's up to you.

But I would go with an IDE that does the job, doesn't need much fiddling, and that I understand.

> In Ecilipse the over all report is here,

 

> Indexed 'notun_pj' (120 sources, 31 headers) in 0.87 sec: 4,624 declarations; 40,515 references; 11 unresolved inclusions; 360 syntax errors; 15,284 unresolved names (25%)

Eclipse has a parser for the editor and a target compiler for building the project. Both are separate entities, as I learned the hard way, and both might disagree. As said earlier, I never tried to mess with the Eclipse parser settings.

> 1. Dont you think, if project folder(containing HAL driver and so on) living in desktop and Toolchain lives in C...

The ''Desktop'' is only an OS metaphor, that does not actually exist. Rather, it is some files somewhere in a user-specific folder.

Avoid putting sources or projects on the desktop.

> 2. Eclipse also said, ''Error: Cannot run program ''gcc'': Launching failed '', is it means gcc path has not been included ?

 

Probably the toolchain path not correctly set. There should be tutorials around about setting Eclipse with a separate toolchain. Not my specific field of competence.

> 3. Are you sure, we dont have any during making new project, I have just open it and playing wrongly may be. People did mistake, http://www.openstm32.org/file16?fileId=235&view=page.

 

Tried OpenSTM once, and didn't like it. Can't comment about it.

>4. My CoIDE based project which I am working in Keil, shows CMSIS  adapting problem, dont you think CMSIS should be add from their install pak system?

 

If I understand this correct: perhaps, but that is the task of the Coocox people.

You can ask them, if they do it, and when.

Md Mubdiul Hasan
Associate III
Posted on November 21, 2016 at 02:47

Dear Sir AvaTar,

I am trying to concentrate on Keil now.

''But I would go with an IDE that does the job, doesn't need much fiddling, and that I understand.''

I also agree with you, project setting is straight forward. But, Forum posting response has small possibility in case of asking problem.

''Both are separate entities, as I learned the hard way, and both might disagree. As said earlier, I never tried to mess with the Eclipse parser settings''.

Could you kindly explain why parser setting is required?

 

''Avoid putting sources or projects on the desktop.''

 

I have changed the project location and copy that project folder in workplace of Eclipse under Tool-chain folder in C, now the console says,

\STM32F0xx_HAL_Driver\\Inc'' ''-IC:\\STM32_toolchain\\common\\Drivers\\STM32F0xx_HAL_Driver\\Src'' -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -o ''startup\\Src\\stm32f0xx_hal_rcc_ex.o'' ''..\\startup\\Src\\stm32f0xx_hal_rcc_ex.c'' 

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

..\startup\Src\stm32f0xx_ll_utils.c:38:30: fatal error: stm32f0xx_ll_rcc.h: No such file or directory

compilation terminated.

''Probably the toolchain path not correctly set. There should be tutorials around about setting Eclipse with a separate toolchain. Not my specific field of competence.

 

''

http://www.openstm32.org/ OR www.eclipse.org/forums are not much helpful, perhaps expert may skip such silly questions. Less talkative.

'but that is the task of the Coocox people''

 

Coocox forum is completely closed.

Best Regards

Hasan

AvaTar
Lead
Posted on November 21, 2016 at 08:01

> I also agree with you, project setting is straight forward. But, Forum posting response has small possibility in case of asking problem.

 

There are often problems with ''latest release'' software and packages. I don't think you would look silly asking. And thanks to CubeMX, ''simple'' questions about build issues multiplied ...

> Could you kindly explain why parser setting is required?

Kind of syntax checking during editing. You better ask the Eclipse or ''CDT'' people.

I'm quite comfortable without it.

> I have changed the project location and copy that project folder in workplace of Eclipse under Tool-chain folder in C, now the console says, ...

Hmmm, not sure about the LowLevel stuff.

I have those mentioned F7 Cube package here, where this ''_ll_'' stuff sits in

STM32Cube_FW_Fx_Vx.x.x\Drivers\STM32F7xx_HAL_Driver\Inc

. However, only a few files are present - it is far from complete.

You would probably need to ask the ST staff, or frequent Cube users.

> Coocox forum is completely closed.

Good to know - it had been operative more than a year ago.

However, they did several things the non-standard way (not CMSIS conforming) for no good reason.

So when using Windows, I rather go with

http://www.emblocks.org/web/

. This toolchain supports the SPL, but (AFAIK) no Cube yet.

Md Mubdiul Hasan
Associate III
Posted on November 21, 2016 at 09:44

Dear,

For a newcomer people like me, this kind of work looks so tough.

Still I am disappointing to build previous project in any IDE, question is when I will develop my code ?

Thousands of work is still remain to look up registor, SRCs, communications, data, graph etc.

 ''I don't think you would look silly asking. And thanks to CubeMX''

 One thing is for sure, cubemx also making trouble! 

''Kind of syntax checking during editing.''

Lets forget this option.

 

''STM32Cube_FW_Fx_Vx.x.x\Drivers\STM32F7xx_HAL_Driver\Inc

. However, only a few files are present''

 

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

In keil, tool-chain and CMSIS may be conflicting, if I would deleted my user code c files from project branch, errors minimized.

But, those codes are necessary in my system!

Regards

Hasan

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 ...

Md Mubdiul Hasan
Associate III
Posted on November 22, 2016 at 01:27

Dear Sir AvarTar,

I am not sure why my company used such  ''Low Level'' library of Cubemx.

At the beginning, I can not change those state files depends on HAL.

I got one state file generation software named ''QT'', where your state machine can be implemented easy way.

Now, here is a good news from Keil that, my previous errors are getting minimum,

Previously, it was 32, now console says,

compiling tim.c...

..\Common1\tim.c(36): error:  #5: cannot open source input file ''tim.h'': No such file or directory

  #include ''tim.h''

..\Common1\tim.c: 0 warnings, 1 error

compiling io_util.c...

..\io_utlis\io_util.c(21): error:  #5: cannot open source input file ''spi.h'': No such file or directory

  #include ''spi.h''

..\io_utlis\io_util.c: 0 warnings, 1 error

''.\rc_2016.axf'' - 12 Error(s), 0 Warning(s).

Target not created.

Build Time Elapsed:  00:00:01

What I did is, triggering  initial cubemx to Keil, and follow the include library paths to my current project.

For the CMSIS error, I solved that start-up 

in MDK 5.

Looking at the errors in mdk-keil, some h files are absent, it might be for overlaps of same timer and spi action described in  cubemx generated file.

These  h files are belongs to my coocox project.

Regards

Hasan

  

Posted on December 13, 2016 at 08:50

Dear Sir Avatar,

You will be keep silent ?

I have managed to solve'_ll_' stuff , that was for strange back-slash in Korean OS.

mdk-keil does not support comdef.h for compliler.

Kindly take a look here,

https://community.st.com/0D50X00009XkdvoSAB  

#Avatar

Kraal
Senior III
Posted on December 13, 2016 at 11:51

Hello,

It seems to me that you have a lot of problems mostly because the base of the system is not well configured, i.e. GCC is not set in the system path, the IDEs are barking at you because they can't find the required files and so on...

I recommend you to read this blog post : 

http://thehackerworkshop.com/?p=443

 

The good thing is that he is using an F0 like you. He's using the Standard Peripheral Library, I hope that it is okay for you... But if you follow carefully his instructions, you should be able to compile a test project at first, then proceed with your actual project.

Best regards,

Carl