cancel
Showing results for 
Search instead for 
Did you mean: 

FAT-FS + CoIDE

totti001
Associate II
Posted on November 18, 2013 at 13:13

Hello everybody!

 

I try the Fat_FS library at my STM32F4Discovery board. I try the embest example project for this. I create the project at CoIDE add the files, the compile is done but the linker is put errors:

    [cc] arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -g -nostartfiles -Wl,-Map=Fatfs.map -O0 -LC:\CooCox\CoIDE\configuration\ProgramData\Fatfs -Wl,-TC:\CooCox\CoIDE\configuration\ProgramData\Fatfs/arm-gcc-link.ld -g -o Fatfs.elf ..\obj\stm32f4xx_syscfg.o ..\obj\stm32f4xx_sdio.o ..\obj\stm32f4xx_usart.o ..\obj\stm32f4_discovery_sdio_sd.o ..\obj\diskio.o ..\obj\startup_stm32f4xx.o ..\obj\stm32f4_discovery.o ..\obj\main.o ..\obj\stm32f4xx_rcc.o ..\obj\stm32f4xx_it.o ..\obj\stm32f4xx_gpio.o ..\obj\system_stm32f4xx.o ..\obj\stm32f4xx_dma.o ..\obj\ff.o ..\obj\stm32f4xx_exti.o ..\obj\misc.o ..\obj\stm32f4_discovery_debug.o -lm -lgcc -lc

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':

       [cc] sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-writer.o): In function `_write_r':

       [cc] writer.c:(.text._write_r+0x10): undefined reference to `_write'

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-closer.o): In function `_close_r':

       [cc] closer.c:(.text._close_r+0xc): undefined reference to `_close'

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-fstatr.o): In function `_fstat_r':

       [cc] fstatr.c:(.text._fstat_r+0xe): undefined reference to `_fstat'

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-isattyr.o): In function `_isatty_r':

       [cc] isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty'

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-lseekr.o): In function `_lseek_r':

       [cc] lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-readr.o): In function `_read_r':

       [cc] readr.c:(.text._read_r+0x10): undefined reference to `_read

       [cc] '

       [cc] collect2.exe: error: ld returned 1 exit status

 

 

I configure the linker options but always do this. What the problem?

#stm32f4 #fatfs #coide
1 REPLY 1
Posted on November 18, 2013 at 14:07

I configure the linker options but always do this. What the problem?

Looks like your using STDIO/NEWLIB functions without providing any SYSCALL.C type hosting for your platform.

https://github.com/bjornfor/stm32-test/blob/master/STM32L1xx_StdPeriph_Lib_V1.1.1/syscalls.c

http://myavr.chkronline.de/html_stm32/stm32_eclipse_tut10.html

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..