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
Md Mubdiul Hasan
Associate III
Posted on November 11, 2016 at 08:42

Dear Sir,

Thank you once again.

Even project file(s) is highly IDE specific, I have no other way to use right at the moment. Best way is to apply things in new IDE.

If you look the uVision creating new project, you will see KEIL facilitates, downloading, project creating is nice.

But, I am using STM32F070RBTx that has no example code in KEIL directly.  It suggest STM32F072-Discovery, that is not the STM32F070 group.

Yes, from the Pack installer part of keil you can download STMicroelectronics STM32F0 Series Device Support and Examples , but group specific example is absent.

I understand things are nearly similar.

Looking at your Toolchain issue, Keli support latest gcc or ARMCC version. I am using this.

As my previous projects are HAL library specific, I am attaching those header files in project.

Startup, Flash, CMSIS etc is KEIL based here.

Some of errors I have indentified, but why comdef.h and stm32f0xx_hal.h is not supporting here?

I agree with you.

AvaTar
Lead
Posted on November 11, 2016 at 10:59

>But, I am using STM32F070RBTx that has no example code in KEIL directly.  It suggest STM32F072-Discovery, that is not the STM32F070 group.

 

I don't use Keil, so I can only suggest to ask about it at the Keil forum. Or someone on this forum can help.

I would be careful with ''similar'' MCUs. Non-matching Flash/RAM sizes (-> startup file !) and peripherals can screw your project up.

> Yes, from the Pack installer part of keil you can download STMicroelectronics STM32F0 Series Device Support and Examples , but group specific example is absent.

 

> I understand things are nearly similar.

 

Keil offers dozens of evaluation boards (hardware).

Perhaps you can look for such an evaluation board with your MCU, or a similar one (a F070). Then download the firmware/example package Keil provides for this, and use one of the example projects.

> I am using STM32F070RBTx ...

The ''RBTx'' specifies the package, which in turn defines pin number and pin multiplexing. Applying some care, you can use a project for any F070 as starting point.

> As my previous projects are HAL library specific, I am attaching those header files in project.

Like some others at this forum, I'm no friend of the Cube HAL, and don't know/use it.

Perhaps the occasionally present ST staff people can help you with that ...

Md Mubdiul Hasan
Associate III
Posted on November 12, 2016 at 02:38

Posted on November 12, 2016 at 18:44

If it can't find include files then you need to make sure you have the right Include Paths specified so it can

ie

..\..\..\Drivers\STM32F0xx_HAL_Driver\Inc

or whatever directory stm32f0xx_hal.h is situated in.

This is critically important when files are spread over multiple directories and up/down different trees.

There should be startup files for an assortment of F0xx parts, you'll need to review the files in the HAL tree, use a File Manager you like if that helps.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Md Mubdiul Hasan
Associate III
Posted on November 14, 2016 at 02:22

Dear Sir Clive1,

Thank you once again to take a look here.

Work looks more complex if you adopt a project from other IDE.

I did the same what you have mentioned here.

HAL library H and C files are conflicting here, since I dont understand how my main c files dont come in front !

May be you are talking about startup_stm32f070xb.s file.

Deep inside it, filessuggest that its  STM32F070xb/STM32F070x8 devices vector table for Atollic TrueSTUDIO toolchain.

Without HAL, it would be difficult for me to arranged things in other support.

My project is CUBEMX based generated.

Do you think I can configure whole things in KELI, I means keeping my state files and c files, could I use other project try of stm32f070 group ?

Regards

Hasan

Md Mubdiul Hasan
Associate III
Posted on November 14, 2016 at 02:35

Dear Sir AvaTar,

Do you have any other idea besides Cubemx? 

For case of driver code generation what you usually use ?

Regards

Hasan

AvaTar
Lead
Posted on November 14, 2016 at 07:53

> Do you have any other idea besides Cubemx? 

 

http://www.emblocks.org/web/downloads-main

is an alternative free IDE with it's own toolchain, based upon the ''old'' SPL.

>For case of driver code generation what you usually use ?

I don't rely on ''code generators''. They use to fail miserably when you deviate from the path of ''envisaged'' use cases.

Not to mention the unmanageable complexity and susceptibility for bugs in certain circumstances ...

There are plenty of examples in the SPL variants, other websites, and there are the reference manuals and datasheets.

Md Mubdiul Hasan
Associate III
Posted on November 14, 2016 at 09:18

Dear Sir,

I caught the error what hide inside the technical issue!

When we do generate driver code from Cubemx, after generation we need to specify in which IDE it should be open, like, MDK keil, SW4STM32 etc.

During building code on Keil I did mistake to indicate IDE in cubemx, so both Eclipse and Keli was getting noisy even I spend a lot of time on including and excluding files and paths.

Now my cubemx is working fine with my previous hardware setting, in this project I need to add the state and utility files which I am not sure depending on IDE and matched my current HAL in KEIL.

After I add those, if errors come, I will let you know.

Regards

Hasan

Md Mubdiul Hasan
Associate III
Posted on November 15, 2016 at 06:20

Dear SirAvaTar,

After spending some time on Keil with adding my previous state+utility+flash+key driver files in this error-less cubemx project, I found a trivial error.

../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c(81): error: #5: cannot open source input file ''stm32f0xx_hal.h'': No such file or directory

I am not sure MDK-KEIL environment is not supporting or because of HAL driver problem in this version.

Looking at the c and h file, seems everything is fine.

Keil has C/C++ include path setting options, I did same as Ecilipse !

Kindly take a look both H and C file of HAL in this attachment.

Can you find any difference ?

________________

Attachments :

stm32f0xx_hal.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1BI&d=%2Fa%2F0X0000000bjc%2Fym1oWmfIWe6IZuMavnLJXnLSxcITfdsk59IoHUAoyY0&asPdf=false

stm32f0xx_hal.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Bq&d=%2Fa%2F0X0000000bjb%2F9acT1CzLvYow7RZbMxl0o52G41Sre7sxUbMHSCps.H0&asPdf=false
AvaTar
Lead
Posted on November 15, 2016 at 11:38

I might get it wrong, but:

> ../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c(81): error:  #5: cannot open source input file ''stm32f0xx_hal.h'': No such file or directory

This has nothing to do with file contents - the file can't be found.

Either a path is (again/still) wrong or missing.

Eclipse IDEs use to have a build output window, which show the unfiltered build log in full length. I believe Keil has this as well.

I would check this output for the proper path settings, perhaps compare the given paths with the actual one's (as shown in a file manager).

Filtered build output windows most often hide too much for a proper analysis.

The ''file not found'' issue is quite common in adapting/porting projects, and is usually the first one has to deal with.