Skip to main content
Md Mubdiul Hasan
Associate III
November 9, 2016
Solved

Hard to track down the actual cause.

  • November 9, 2016
  • 46 replies
  • 6773 views
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.
    This topic has been closed for replies.
    Best answer by AvaTar
    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 ...

    46 replies

    AvaTar
    Senior III
    November 11, 2016
    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
    November 12, 2016
    Posted on November 12, 2016 at 02:38

    Tesla DeLorean
    Guru
    November 12, 2016
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Md Mubdiul Hasan
    Associate III
    November 14, 2016
    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
    November 14, 2016
    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
    Senior III
    November 14, 2016
    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
    November 14, 2016
    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
    November 15, 2016
    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
    Senior III
    November 15, 2016
    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.

    Md Mubdiul Hasan
    Associate III
    November 16, 2016
    Posted on November 16, 2016 at 01:19

    Dear Sir AvaTar,

     Thank you to figure-out things nicely here. Yes..It might be main cause here.After searching same issues on Keil discussion forum, I got...

    If it is telling you that there is ''No such file or directory''.

    There are two possible reasons for that:

    1.

     The file really does not exist at all on your machine;

    2.

     The file does exist, but you haven't correctly configured you project to be able to find it.

    What I did is ....

    1. Search this file in C:\MDK5-projects....its exists

    2. Locate this file in Optipn for target ...include paths...no changes !!

    Do you think, its from preprocesssor setting errors?

    Something need to do   here, 

    http://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm

     

    If so, can you can you tell me where I need to set those functions ?

    Regards

    Hasan