multiple definition 'HAL_…' files

Sysprogs forums Forums VisualGDB multiple definition 'HAL_…' files

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12016
    efpkop
    Participant

    (This is related to my parallel post at https://sysprogs.com/w/forums/topic/stm32cubemx-simple-sd-card-project-missing-ff-h/).  I am creating a simple SD Card project in STM32CubeMX software and trying to export the files into Visual Studio.  When I follow the basic Cube-to-VisualGDB instructions in the tutorial https://visualgdb.com/tutorials/arm/stm32/cube/ the Middleware libraries are not exported into the project directory and my project fails to build.

    However, if, while exporting from Cube, I click the ‘Copy only the necessary library files’ radio button (and not the ‘Add necessary library files…’ radio button on the Code Generator Tab, the Middleware libraries are successfully exported and I solve the ff.h problem I identified in my other post.

    However, now I get a new error when building where many of the HAL_xxx library files are getting defined twice.  How do I correct this and get this simple SD Card example working in VisualGDB?

    An example of the error I’m getting is:

    C:\Tutorials\Cube_SDIO_Mark1\SDIO_Mark1\SDIO_Mark1\..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c(174): error : multiple definition of `HAL_Init’
    1> Debug/stm32f4xx_hal.o:C:\Tutorials\Cube_SDIO_Mark1\SDIO_Mark1\SDIO_Mark1/../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:174: first defined here
    1> Debug/stm32f4xx_hal.o: In function `HAL_Init’:

    It then continues to give me a huge # of this kind of error for all sorts of HAL_ files.

    Is there some setting or path I need to disable to avoid these double definitions?

     

     

     

    • This topic was modified 7 years, 2 months ago by efpkop.
    #12029
    support
    Keymaster

    Hi,

    Please try removing the reference to the “STM32 HAL” on the Embedded Frameworks page of VisualGDB Project Properties.

    #12033
    efpkop
    Participant

    That solved the multiple definition problem.  I also had to explicitly point at a few header directories.  However, now I’m getting an error that the ST device I’m using has not been specified.  For example, I’m getting:

    C:\Tutorials\Cube_SDIO_Mark1\SDIO_Mark1\SDIO_Mark1\..\Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h(193,3): error : #error “Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)”

    I believe I have to add the line:

    #define STM32F405xx

    But I’m not sure if I need to add it to a particular file – or do you specify it in the project properties?

     

    #12052
    support
    Keymaster

    Hi,

    Yes, you could specify it in project properties. Another alternative would be to use this build: http://sysprogs.com/files/tmp/VisualGDB-5.3.5.1722.msi

    It supports importing STM32CubeMX projects out-of-the-box and will set all the necessary flags automatically as long as you select “Import an existing STM32CubeMX project” from the wizard.

    The feature is very new, so it might have a few bugs here and there, so feel free to let let us know if anything doesn’t work and we will fix it.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.