Embedded Bootloader Tutorial Fails!

Sysprogs forums Forums VisualGDB Embedded Bootloader Tutorial Fails!

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8703
    stefan75
    Participant

    Hi,

    When i follow the exact steps in http://visualgdb.com/tutorials/arm/bootloader/ i get errors about multiple defenitions:

    2> C:\SysGCC\arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0 -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -I. -IC:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Inc -IC:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Inc/Legacy -IC:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/CMSIS_HAL/Device/ST/STM32F4xx/Include -IC:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/CMSIS_HAL/Include -IC:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/CMSIS_HAL/RTOS/Template -DDEBUG -DARM_MATH_CM4 -DSTM32F407VG -Dstm32_flash_layout -DSTM32F407xx -c system_stm32f4xx.c -o Debug/system_stm32f4xx.o -MD -MF Debug/system_stm32f4xx.dep
     2> C:\SysGCC\arm-eabi/bin/arm-eabi-g++.exe -o Debug/MainApplication.elf -Wl,-gc-sections --specs=nano.specs -TSTM32F407VG_flash.lds -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -Wl,-Map=Debug/MainApplication.map -Wl,--start-group Debug/startup_stm32f407xx.o Debug/stm32f4xx_hal.o Debug/stm32f4xx_hal_adc.o Debug/stm32f4xx_hal_adc_ex.o Debug/stm32f4xx_hal_can.o Debug/stm32f4xx_hal_cec.o Debug/stm32f4xx_hal_cortex.o Debug/stm32f4xx_hal_crc.o Debug/stm32f4xx_hal_cryp.o Debug/stm32f4xx_hal_cryp_ex.o Debug/stm32f4xx_hal_dac.o Debug/stm32f4xx_hal_dac_ex.o Debug/stm32f4xx_hal_dcmi.o Debug/stm32f4xx_hal_dcmi_ex.o Debug/stm32f4xx_hal_dma.o Debug/stm32f4xx_hal_dma2d.o Debug/stm32f4xx_hal_dma_ex.o Debug/stm32f4xx_hal_eth.o Debug/stm32f4xx_hal_flash.o Debug/stm32f4xx_hal_flash_ex.o Debug/stm32f4xx_hal_flash_ramfunc.o Debug/stm32f4xx_hal_fmpi2c.o Debug/stm32f4xx_hal_fmpi2c_ex.o Debug/stm32f4xx_hal_gpio.o Debug/stm32f4xx_hal_hash.o Debug/stm32f4xx_hal_hash_ex.o Debug/stm32f4xx_hal_hcd.o Debug/stm32f4xx_hal_i2c.o Debug/stm32f4xx_hal_i2c_ex.o Debug/stm32f4xx_hal_i2s.o Debug/stm32f4xx_hal_i2s_ex.o Debug/stm32f4xx_hal_irda.o Debug/stm32f4xx_hal_iwdg.o Debug/stm32f4xx_hal_ltdc.o Debug/stm32f4xx_hal_nand.o Debug/stm32f4xx_hal_nor.o Debug/stm32f4xx_hal_pccard.o Debug/stm32f4xx_hal_pcd.o Debug/stm32f4xx_hal_pcd_ex.o Debug/stm32f4xx_hal_pwr.o Debug/stm32f4xx_hal_pwr_ex.o Debug/stm32f4xx_hal_qspi.o Debug/stm32f4xx_hal_rcc.o Debug/stm32f4xx_hal_rcc_ex.o Debug/stm32f4xx_hal_rng.o Debug/stm32f4xx_hal_rtc.o Debug/stm32f4xx_hal_rtc_ex.o Debug/stm32f4xx_hal_sai.o Debug/stm32f4xx_hal_sai_ex.o Debug/stm32f4xx_hal_sd.o Debug/stm32f4xx_hal_sdram.o Debug/stm32f4xx_hal_smartcard.o Debug/stm32f4xx_hal_spdifrx.o Debug/stm32f4xx_hal_spi.o Debug/stm32f4xx_hal_sram.o Debug/stm32f4xx_hal_tim.o Debug/stm32f4xx_hal_tim_ex.o Debug/stm32f4xx_hal_uart.o Debug/stm32f4xx_hal_usart.o Debug/stm32f4xx_hal_wwdg.o Debug/stm32f4xx_ll_fmc.o Debug/stm32f4xx_ll_fsmc.o Debug/stm32f4xx_ll_sdmmc.o Debug/stm32f4xx_ll_usb.o Debug/LEDBlink.o Debug/system_stm32f4xx.o -lcompactcpp ../BootloaderDemo/Debug/BootloaderDemo.elf Debug/bootldr.o -Wl,--end-group
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `SystemInit':
     2> :(.text+0x9e8): multiple definition of `APBAHBPrescTable'
     2> Debug/stm32f4xx_hal_rcc.o:(.rodata+0x0): first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `HAL_NVIC_SetPriority':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c(184): error VGDB1001: multiple definition of `HAL_NVIC_SetPriority'
     2> Debug/stm32f4xx_hal_cortex.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c:184: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `SysTick_Handler':
     2>C:\Temp13\Bootloader\BootloaderDemo\LEDBlink.cpp(7): error VGDB1001: multiple definition of `SysTick_Handler'
     2> Debug/LEDBlink.o:C:\Temp13\Bootloader\MainApplication/LEDBlink.cpp:7: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `HAL_GPIO_WritePin':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c(431): error VGDB1001: multiple definition of `HAL_GPIO_WritePin'
     2> Debug/stm32f4xx_hal_gpio.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c:431: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `HAL_RCC_GetHCLKFreq':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c(1052): error VGDB1001: multiple definition of `HAL_RCC_GetHCLKFreq'
     2> Debug/stm32f4xx_hal_rcc.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c:1052: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `HAL_GPIO_Init':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c(190): error VGDB1001: multiple definition of `HAL_GPIO_Init'
     2> Debug/stm32f4xx_hal_gpio.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c:190: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `_sdata':
     2> :(.data+0x0): multiple definition of `SystemCoreClock'
     2> Debug/system_stm32f4xx.o:(.data+0x0): first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `HAL_SYSTICK_Config':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c(248): error VGDB1001: multiple definition of `HAL_SYSTICK_Config'
     2> Debug/stm32f4xx_hal_cortex.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c:248: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `_init':
     2> :(.text+0x9f8): multiple definition of `_init'
     2> c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-eabi/5.3.0/thumb/cortex_m4/crti.o:(.init+0x0): first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `Reset_Handler':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\StartupFiles\startup_stm32f407xx.c(944): error VGDB1001: multiple definition of `Reset_Handler'
     2> Debug/startup_stm32f407xx.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/StartupFiles/startup_stm32f407xx.c:944: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `HAL_Init':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c(168): error VGDB1001: multiple definition of `HAL_Init'
     2> Debug/stm32f4xx_hal.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:168: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `Default_Handler':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\StartupFiles\startup_stm32f407xx.c(961): error VGDB1001: multiple definition of `Default_Handler'
     2> Debug/startup_stm32f407xx.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/StartupFiles/startup_stm32f407xx.c:961: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `_sdata':
     2> :(.data+0x4): multiple definition of `AHBPrescTable'
     2> Debug/system_stm32f4xx.o:(.data+0x4): first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `HAL_NVIC_SetPriorityGrouping':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c(162): error VGDB1001: multiple definition of `HAL_NVIC_SetPriorityGrouping'
     2> Debug/stm32f4xx_hal_cortex.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c:162: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `main':
     2>C:\Temp13\Bootloader\BootloaderDemo\LEDBlink.cpp(13): error VGDB1001: multiple definition of `main'
     2> Debug/LEDBlink.o:C:\Temp13\Bootloader\MainApplication/LEDBlink.cpp:13: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `SystemInit':
     2>C:\Temp13\Bootloader\BootloaderDemo\system_stm32f4xx.c(172): error VGDB1001: multiple definition of `SystemInit'
     2> Debug/system_stm32f4xx.o:C:\Temp13\Bootloader\MainApplication/system_stm32f4xx.c:172: first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `_fini':
     2> :(.text+0xa04): multiple definition of `_fini'
     2> c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-eabi/5.3.0/thumb/cortex_m4/crti.o:(.fini+0x0): first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf:(.isr_vector+0x0): multiple definition of `g_pfnVectors'
     2> Debug/startup_stm32f407xx.o:(.isr_vector+0x0): first defined here
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf: In function `HAL_SYSTICK_IRQHandler':
     2>C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c(404): error VGDB1001: multiple definition of `HAL_SYSTICK_IRQHandler'
     2> Debug/stm32f4xx_hal_cortex.o:C:\Users\svm\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32/STM32F4xxxx/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c:404: first defined here
     2> c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-eabi/5.3.0/thumb/cortex_m4/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'
     2> ../BootloaderDemo/Debug/BootloaderDemo.elf::(.data+0x14): first defined here
     2>collect2.exe : error : ld returned 1 exit status
     2> make: *** [Debug/MainApplication.elf] Error 1

    Does somebody know what is going wrong?

    • This topic was modified 8 years, 4 months ago by stefan75.
    • This topic was modified 8 years, 4 months ago by stefan75.
    #8715
    support
    Keymaster

    Hi,

    Looks like VisualGDB is trying to link the original bootloader ELF file with the normal project. This should not happen with the latest VisualGDB 5.1r6. Either way, you can disable this by commenting out the following line in your main project’s Makefile:

    LIBRARY_LDFLAGS += $(EXTERNAL_LIBS)

    Note that the Makefile has several instances of this line for different project types.

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