Skip to main content
dcurran2
Associate III
March 7, 2018
Question

MXCube F302 timer driver will not compile from generation

  • March 7, 2018
  • 6 replies
  • 1955 views
Posted on March 07, 2018 at 16:13

using mxCube 4.24.0

Keil 5.25.0.0

using timer             :6 

prescalar                :64

Counter                  :up

Counter period      65535

autoload preload  : disable 

Cube produces 

void MX_TIM6_Init(void)

{

  TIM_MasterConfigTypeDef sMasterConfig;

  htim6.Instance = TIM6;

  htim6.Init.Prescaler = 64;

  htim6.Init.CounterMode = TIM_COUNTERMODE_UP;

  htim6.Init.Period = 65535;

  htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;

This line causes the error 

  htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;

from Keil IDE 

../Src/tim.c(58): error:  #136: struct '<unnamed>'  has no field 'AutoReloadPreload'

    htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;

../Src/tim.c(58): error:  #20: identifier 'TIM_AUTORELOAD_PRELOAD_DISABLE' is undefined

    htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;

../Src/tim.c: 0 warnings, 2 errors

work around is to comment out 

//  htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;

When is the next mxCube update due ?

    This topic has been closed for replies.

    6 replies

    Technical Moderator
    March 7, 2018
    Posted on March 07, 2018 at 17:30

    Hello

    Curran.Danny

    ,

    I cannot reproduce this issue using CubeMx 4.24 and STM32CubeF3 v1.9.0.

    May be you need to review ifyour project includes the right files and defines symbols.

    Please share your ioc file to check this issue.

    Best Regards

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    dcurran2
    dcurran2Author
    Associate III
    March 7, 2018
    Posted on March 07, 2018 at 18:28

    I have added the *.ioc file that produces the code

    ________________

    Attachments :

    OBDII2.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxqH&d=%2Fa%2F0X0000000b2D%2FAzUlq4wQAAYxyuPgjLgfUCDgPvflrlMnVnm7mYecyWY&asPdf=false
    Technical Moderator
    March 9, 2018
    Posted on March 09, 2018 at 09:53

    Hello

    Curran.Danny

    ,

    It seems you are using old CubeF3 firmware package!

    Please download and check with the latest version

    STM32CubeF3 v1.9.0, then keep me informed about your result.

    Kind Regards

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    dcurran2
    dcurran2Author
    Associate III
    March 9, 2018
    Posted on March 09, 2018 at 10:05

    I have just checked on Cube and its up to date

    the MxCube version is 4.24.0

    using Manage Embedded Software packages 1.9 has been downloaded etc

    TM32CubeF3 Firmware Package V1.9.0 / 23-June-2017

    Main Changes

    Maintenance release.
    • Fix known defects and several enhancements implementation.
    • All projects updated following changes in latest version of HAL and Middlewares.
    • General updates to be compliant with Linux platforms.
    dcurran2
    dcurran2Author
    Associate III
    March 9, 2018
    Posted on March 09, 2018 at 10:06

    0690X00000609DOQAY.png
    Technical Moderator
    March 9, 2018
    Posted on March 09, 2018 at 10:31

    When I open your ioc file and Project settings, I see you are using the firmware version 

    STM32Cube_FW_F3_V1.4.0.

    0690X0000060A2pQAE.png

    Please check In your Project Settings menu that the firmware package version used is STM32Cube_FW_F3_V1.9.0, Otherwise, you should update the firmware location to use the latest version.

    Best Regards,

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    dcurran2
    dcurran2Author
    Associate III
    March 9, 2018
    Posted on March 09, 2018 at 11:04

    Does this mean you cant use an old cube project with a newer version of the Firmware libraries automatically ?

    e.g. the firmware lib is not automatically updated to use the latest version. ? 

     I have done as suggested and Cube produces different code

    taken from the ioc file I can now see the following

    ProjectManager.CustomerFirmwarePackage=C\:\\Users\\dcurran\\STM32Cube\\Repository\\STM32Cube_FW_F3_V1.9.0

    ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.4.0

    I can also see new *.h files

    Can I suggest to your dev team that they make the user more aware that a old firmware package is in the ioc file

    as I had all the previous versions of the F3 lib  and it wasn't until I removed all previous firmware libs that cube indicated there was an option

    Technical Moderator
    March 9, 2018
    Posted on March 09, 2018 at 15:54

    Hi

    Curran.Danny

    ,

    It's recommended to use latest version of Cube firmware package and CubeMx tool as there is always enhancement and bugsfixes in the new release.

    STM32CubeMX can check if there is a

    new library package installation or updates

    for new STM32CubeMX tool version.

    For that, in the Help > Updater Settings tab, you shouldenable the Automatic check for updates.

    0690X0000060A3TQAU.png

    In the Project Tab, there isa Use Default Firmware Location

    checkbox

    (which is specified under the Menu Help > Updater settings)

    specifying

    the

    path forthe

    installed firmware packages version and

    by default, the latest available version is used for the project.

    I recommend you check the user Manual

    http://www.st.com/content/ccc/resource/technical/document/user_manual/10/c5/1a/43/3a/70/43/7d/DM001047pdf/files/DM001047pdf/jcr:content/translations/en.DM001047pdf

    ''STM32CubeMx for STM32 configuration and initialization C code generation'' for more details.

    Kind Regards,

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks