AnsweredAssumed Answered

Link error => undefined reference to `SDMMCHOST_Init'

Question asked by Pascal Barbary on Apr 11, 2018
Latest reply on Apr 15, 2018 by Jing Pan

I keep on getting this linker error and I can't find the source of it, please advice.  

It starts in the function 'static status_t SD_card_waitCardInsert(void)' in de c-file SD_card.

This function is an exact copy of the function in 'frdmk66f_driver_examples_sdcard_fatfs'.

The fatfs and sdmmc includes are not the same as in the example, includes where done with 'manage SDK components'.

The whole project is attached.

 

Finished building: ../CMSIS/system_MK66F18.c

Building target: MK66F_8-KanaalSynchroneDataLogger_C.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -Xlinker -print-memory-usage -Xlinker --gc-sections -Xlinker -Map="MK66F_8-KanaalSynchroneDataLogger_C.map" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -T MK66F_8-KanaalSynchroneDataLogger_C_Debug.ld -o "MK66F_8-KanaalSynchroneDataLogger_C.axf" ./utilities/fsl_debug_console.o ./utilities/fsl_io.o ./utilities/fsl_log.o ./utilities/fsl_str.o ./startup/startup_mk66f18.o ./source/I2C.o ./source/MK66F_8-KanaalSynchroneDataLogger_C.o ./source/SD_card.o ./source/SPI.o ./source/Tasks.o ./source/TimersAndCo.o ./source/semihost_hardfault.o ./sdmmc/src/fsl_mmc.o ./sdmmc/src/fsl_sd.o ./sdmmc/src/fsl_sdio.o ./sdmmc/src/fsl_sdmmc_common.o ./sdmmc/src/fsl_sdspi.o ./freertos/source/croutine.o ./freertos/source/event_groups.o ./freertos/source/list.o ./freertos/source/queue.o ./freertos/source/tasks.o ./freertos/source/timers.o ./freertos/portable/fsl_tickless_systick.o ./freertos/portable/heap_4.o ./freertos/portable/port.o ./fatfs/fatfs_source/diskio.o ./fatfs/fatfs_source/ff.o ./fatfs/fatfs_source/fsl_mmc_disk.o ./fatfs/fatfs_source/fsl_ram_disk.o ./fatfs/fatfs_source/fsl_sd_disk.o ./fatfs/fatfs_source/fsl_sdspi_disk.o ./drivers/fsl_clock.o ./drivers/fsl_common.o ./drivers/fsl_dspi.o ./drivers/fsl_flash.o ./drivers/fsl_gpio.o ./drivers/fsl_i2c.o ./drivers/fsl_lpuart.o ./drivers/fsl_pit.o ./drivers/fsl_rtc.o ./drivers/fsl_sdhc.o ./drivers/fsl_smc.o ./drivers/fsl_sysmpu.o ./drivers/fsl_tpm.o ./drivers/fsl_uart.o ./board/board.o ./board/clock_config.o ./board/peripherals.o ./board/pin_mux.o ./CMSIS/system_MK66F18.o
Memory region Used Size Region Size %age Used
PROGRAM_FLASH: 116680 B 2 MB 5.56%
SRAM_UPPER: 87660 B 192 KB 44.59%
SRAM_LOWER: 0 GB 64 KB 0.00%
./sdmmc/src/fsl_sd.o: In function `SD_HostInit':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sd.c:1673: undefined reference to `SDMMCHOST_Init'
./sdmmc/src/fsl_sd.o: In function `SD_HostDeinit':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sd.c:1688: undefined reference to `SDMMCHOST_Deinit'
./sdmmc/src/fsl_sd.o: In function `SD_HostReset':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sd.c:1695: undefined reference to `SDMMCHOST_Reset'
./sdmmc/src/fsl_sd.o: In function `SD_PowerOnCard':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sd.c:1700: undefined reference to `SDMMCHOST_PowerOnCard'
./sdmmc/src/fsl_sd.o: In function `SD_PowerOffCard':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sd.c:1705: undefined reference to `SDMMCHOST_PowerOffCard'
./sdmmc/src/fsl_sd.o: In function `SD_WaitCardDetectStatus':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sd.c:1710: undefined reference to `SDMMCHOST_WaitCardDetectStatus'
./sdmmc/src/fsl_sd.o: In function `SD_IsCardPresent':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sd.c:1715: undefined reference to `SDMMCHOST_IsCardPresent'
./sdmmc/src/fsl_sdmmc_common.o: In function `SDMMC_SwitchVoltage':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sdmmc_common.c:217: undefined reference to `SDMMCHOST_Delay'
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sdmmc_common.c:224: undefined reference to `SDMMCHOST_Delay'
./sdmmc/src/fsl_sdmmc_common.o: In function `SDMMC_ExecuteTuning':
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sdmmc_common.c:272: undefined reference to `SDMMCHOST_Delay'
C:\NXP_MCUXpresso\git\8-kanaalsDataLogger\MK66F_8-KanaalSynchroneDataLogger_C\Debug/../sdmmc/src/fsl_sdmmc_common.c:295: undefined reference to `SDMMCHOST_Delay'
collect2.exe: error: ld returned 1 exit status
FLEX_RAM: 0 GB 4 KB 0.00%
make: *** [MK66F_8-KanaalSynchroneDataLogger_C.axf] Error 1

17:33:56 Build Finished (took 9s.352ms)

Outcomes