[Solved] Can't compile STM32Card even with flags set

Post here first, or if you can't find a relevant section!
Post Reply
Bambo
Posts: 75
Joined: Wed Jan 15, 2020 8:36 pm

[Solved] Can't compile STM32Card even with flags set

Post by Bambo »

Github issue: https://github.com/stm32duino/STM32SD/issues/37
Related forum topic: viewtopic.php?t=534

Hi, I'm trying to compile with STM32SD in order to use its SDMMC features. But with the HAL_ENABLEs defined, the linker throws errors.

Code: Select all

Linking it all together ...
# Coping cached core C:\Users\Richa\AppData\Local\Temp\VMBCore\visualmicro\e676e554df90733c089cc845c9e1149e\core.a to C:\Users\Richa\AppData\Local\Temp\VMBuilds\SDMMC_Test\STM32_Nucleo_64\Debug\core.a

"C:\Users\Richa\AppData\Local\arduino15\packages\STM32\tools\xpack-arm-none-eabi-gcc\9.2.1-1.1/bin/arm-none-eabi-gcc" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -g -Og --specs=nano.specs -Wl,--defsym=LD_FLASH_OFFSET=0 -Wl,--defsym=LD_MAX_SIZE=524288 -Wl,--defsym=LD_MAX_DATA_SIZE=163840 -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common "-Wl,--default-script=C:\Users\Richa\AppData\Local\arduino15\packages\STM32\hardware\stm32\1.9.0\variants\NUCLEO_L452RE/ldscript.ld" "-Wl,--script=C:\Users\Richa\AppData\Local\arduino15\packages\STM32\hardware\stm32\1.9.0\system/ldscript.ld" "-Wl,-Map,C:\Users\Richa\AppData\Local\Temp\VMBuilds\SDMMC_Test\STM32_Nucleo_64\Debug/SDMMC_Test.ino.map" "-LC:\Users\Richa\AppData\Local\arduino15\packages\STM32\tools\CMSIS\5.5.1/CMSIS/DSP/Lib/GCC/" -larm_cortexM4lf_math -o "C:\Users\Richa\AppData\Local\Temp\VMBuilds\SDMMC_Test\STM32_Nucleo_64\Debug/SDMMC_Test.ino.elf" "-LC:\Users\Richa\AppData\Local\Temp\VMBuilds\SDMMC_Test\STM32_Nucleo_64\Debug" -Wl,--start-group "SDMMC_Test.cpp.o" "STM32SD-1.2.2\bsp_sd.c.o" "STM32SD-1.2.2\SD.cpp.o" "STM32SD-1.2.2\Sd2Card.cpp.o" "STM32SD-1.2.2\SdFatFs.cpp.o" "FatFs-2.0.3\diskio.c.o" "FatFs-2.0.3\ff.c.o" "FatFs-2.0.3\ff_gen_drv.c.o" "FatFs-2.0.3\drivers\sd_diskio.c.o" "FatFs-2.0.3\option\cc932.c.o" "FatFs-2.0.3\option\cc936.c.o" "FatFs-2.0.3\option\cc949.c.o" "FatFs-2.0.3\option\cc950.c.o" "FatFs-2.0.3\option\ccsbcs.c.o" "FatFs-2.0.3\option\syscall.c.o" "SrcWrapper\syscalls.c.o" "SrcWrapper\HAL\stm32yyxx_hal.c.o" "SrcWrapper\HAL\stm32yyxx_hal_adc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_adc_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_can.c.o" "SrcWrapper\HAL\stm32yyxx_hal_cec.c.o" "SrcWrapper\HAL\stm32yyxx_hal_comp.c.o" "SrcWrapper\HAL\stm32yyxx_hal_comp_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_cordic.c.o" "SrcWrapper\HAL\stm32yyxx_hal_cortex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_crc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_crc_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_cryp.c.o" "SrcWrapper\HAL\stm32yyxx_hal_cryp_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dac.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dac_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dcmi.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dcmi_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dfsdm.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dfsdm_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dma.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dma2d.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dma_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dsi.c.o" "SrcWrapper\HAL\stm32yyxx_hal_dts.c.o" "SrcWrapper\HAL\stm32yyxx_hal_eth.c.o" "SrcWrapper\HAL\stm32yyxx_hal_eth_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_exti.c.o" "SrcWrapper\HAL\stm32yyxx_hal_fdcan.c.o" "SrcWrapper\HAL\stm32yyxx_hal_firewall.c.o" "SrcWrapper\HAL\stm32yyxx_hal_flash.c.o" "SrcWrapper\HAL\stm32yyxx_hal_flash_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_flash_ramfunc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_fmac.c.o" "SrcWrapper\HAL\stm32yyxx_hal_fmpi2c.c.o" "SrcWrapper\HAL\stm32yyxx_hal_fmpi2c_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_gfxmmu.c.o" "SrcWrapper\HAL\stm32yyxx_hal_gpio.c.o" "SrcWrapper\HAL\stm32yyxx_hal_gpio_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_hash.c.o" "SrcWrapper\HAL\stm32yyxx_hal_hash_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_hcd.c.o" "SrcWrapper\HAL\stm32yyxx_hal_hrtim.c.o" "SrcWrapper\HAL\stm32yyxx_hal_hsem.c.o" "SrcWrapper\HAL\stm32yyxx_hal_i2c.c.o" "SrcWrapper\HAL\stm32yyxx_hal_i2c_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_i2s.c.o" "SrcWrapper\HAL\stm32yyxx_hal_i2s_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_ipcc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_irda.c.o" "SrcWrapper\HAL\stm32yyxx_hal_iwdg.c.o" "SrcWrapper\HAL\stm32yyxx_hal_jpeg.c.o" "SrcWrapper\HAL\stm32yyxx_hal_lcd.c.o" "SrcWrapper\HAL\stm32yyxx_hal_lptim.c.o" "SrcWrapper\HAL\stm32yyxx_hal_ltdc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_ltdc_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_mdios.c.o" "SrcWrapper\HAL\stm32yyxx_hal_mdma.c.o" "SrcWrapper\HAL\stm32yyxx_hal_mmc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_mmc_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_nand.c.o" "SrcWrapper\HAL\stm32yyxx_hal_nor.c.o" "SrcWrapper\HAL\stm32yyxx_hal_opamp.c.o" "SrcWrapper\HAL\stm32yyxx_hal_opamp_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_ospi.c.o" "SrcWrapper\HAL\stm32yyxx_hal_otfdec.c.o" "SrcWrapper\HAL\stm32yyxx_hal_pccard.c.o" "SrcWrapper\HAL\stm32yyxx_hal_pcd.c.o" "SrcWrapper\HAL\stm32yyxx_hal_pcd_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_pka.c.o" "SrcWrapper\HAL\stm32yyxx_hal_pssi.c.o" "SrcWrapper\HAL\stm32yyxx_hal_pwr.c.o" "SrcWrapper\HAL\stm32yyxx_hal_pwr_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_qspi.c.o" "SrcWrapper\HAL\stm32yyxx_hal_ramecc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_rcc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_rcc_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_rng.c.o" "SrcWrapper\HAL\stm32yyxx_hal_rng_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_rtc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_rtc_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_sai.c.o" "SrcWrapper\HAL\stm32yyxx_hal_sai_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_sd.c.o" "SrcWrapper\HAL\stm32yyxx_hal_sdadc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_sdram.c.o" "SrcWrapper\HAL\stm32yyxx_hal_sd_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_smartcard.c.o" "SrcWrapper\HAL\stm32yyxx_hal_smartcard_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_smbus.c.o" "SrcWrapper\HAL\stm32yyxx_hal_spdifrx.c.o" "SrcWrapper\HAL\stm32yyxx_hal_spi.c.o" "SrcWrapper\HAL\stm32yyxx_hal_spi_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_sram.c.o" "SrcWrapper\HAL\stm32yyxx_hal_swpmi.c.o" "SrcWrapper\HAL\stm32yyxx_hal_tim.c.o" "SrcWrapper\HAL\stm32yyxx_hal_tim_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_tsc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_uart.c.o" "SrcWrapper\HAL\stm32yyxx_hal_uart_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_usart.c.o" "SrcWrapper\HAL\stm32yyxx_hal_usart_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_wwdg.c.o" "SrcWrapper\LL\stm32yyxx_ll_adc.c.o" "SrcWrapper\LL\stm32yyxx_ll_bdma.c.o" "SrcWrapper\LL\stm32yyxx_ll_comp.c.o" "SrcWrapper\LL\stm32yyxx_ll_cordic.c.o" "SrcWrapper\LL\stm32yyxx_ll_crc.c.o" "SrcWrapper\LL\stm32yyxx_ll_crs.c.o" "SrcWrapper\LL\stm32yyxx_ll_dac.c.o" "SrcWrapper\LL\stm32yyxx_ll_delayblock.c.o" "SrcWrapper\LL\stm32yyxx_ll_dma.c.o" "SrcWrapper\LL\stm32yyxx_ll_dma2d.c.o" "SrcWrapper\LL\stm32yyxx_ll_exti.c.o" "SrcWrapper\LL\stm32yyxx_ll_fmac.c.o" "SrcWrapper\LL\stm32yyxx_ll_fmc.c.o" "SrcWrapper\LL\stm32yyxx_ll_fsmc.c.o" "SrcWrapper\LL\stm32yyxx_ll_gpio.c.o" "SrcWrapper\LL\stm32yyxx_ll_hrtim.c.o" "SrcWrapper\LL\stm32yyxx_ll_i2c.c.o" "SrcWrapper\LL\stm32yyxx_ll_lptim.c.o" "SrcWrapper\LL\stm32yyxx_ll_lpuart.c.o" "SrcWrapper\LL\stm32yyxx_ll_mdma.c.o" "SrcWrapper\LL\stm32yyxx_ll_opamp.c.o" "SrcWrapper\LL\stm32yyxx_ll_pka.c.o" "SrcWrapper\LL\stm32yyxx_ll_pwr.c.o" "SrcWrapper\LL\stm32yyxx_ll_rcc.c.o" "SrcWrapper\LL\stm32yyxx_ll_rng.c.o" "SrcWrapper\LL\stm32yyxx_ll_rtc.c.o" "SrcWrapper\LL\stm32yyxx_ll_sdmmc.c.o" "SrcWrapper\LL\stm32yyxx_ll_spi.c.o" "SrcWrapper\LL\stm32yyxx_ll_swpmi.c.o" "SrcWrapper\LL\stm32yyxx_ll_tim.c.o" "SrcWrapper\LL\stm32yyxx_ll_ucpd.c.o" "SrcWrapper\LL\stm32yyxx_ll_usart.c.o" "SrcWrapper\LL\stm32yyxx_ll_usb.c.o" "SrcWrapper\LL\stm32yyxx_ll_utils.c.o" "SrcWrapper\stm32\bootloader.c.o" "SrcWrapper\stm32\clock.c.o" "SrcWrapper\stm32\core_callback.c.o" "SrcWrapper\stm32\dwt.c.o" "SrcWrapper\stm32\hw_config.c.o" "SrcWrapper\stm32\lock_resource.c.o" "SrcWrapper\stm32\low_power.c.o" "SrcWrapper\stm32\pinmap.c.o" "SrcWrapper\stm32\PortNames.c.o" "SrcWrapper\stm32\rtc.c.o" "SrcWrapper\stm32\stm32_def.c.o" "SrcWrapper\stm32\stm32_eeprom.c.o" "SrcWrapper\stm32\system_stm32yyxx.c.o" "SrcWrapper\stm32\timer.c.o" "SrcWrapper\stm32\uart.c.o" "SrcWrapper\stm32\analog.cpp.o" "SrcWrapper\stm32\interrupt.cpp.o" "C:\Users\Richa\AppData\Local\Temp\VMBCore\visualmicro\e676e554df90733c089cc845c9e1149e\variant\PeripheralPins.c.o" "C:\Users\Richa\AppData\Local\Temp\VMBCore\visualmicro\e676e554df90733c089cc845c9e1149e\variant\variant.cpp.o" "C:\Users\Richa\AppData\Local\Temp\VMBuilds\SDMMC_Test\STM32_Nucleo_64\Debug\core.a" -lc -Wl,--end-group -lm -lgcc -lstdc++
 

Error linking for board Nucleo-64
Build failed for project 'SDMMC_Test'
ld.exe: STM32SD-1.2.2\bsp_sd.c.o: in function BSP_SD_MspInit
bsp_sd.c:435: undefined reference to PinMap_SD
 
collect2.exe*: error: ld returned 1 exit status
User avatar
fpiSTM
Posts: 1745
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Can't compile STM32Card even with flags set

Post by fpiSTM »

As said in the GH issue, which target you used ?
User avatar
fpiSTM
Posts: 1745
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Can't compile STM32Card even with flags set

Post by fpiSTM »

Issue solved.
Using Arduino IDE there is no build issue. Probably a wrong VSCode config.
gayesanchez
Posts: 1
Joined: Fri May 26, 2023 8:13 am

Re: [Solved] Can't compile STM32Card even with flags set

Post by gayesanchez »

I tried again with Arduino IDE and it worked.
Post Reply

Return to “General discussion”