cancel
Showing results for 
Search instead for 
Did you mean: 

printf() error in AUTODEVKITSTUDIO

Pooja1
Associate II

Hello Max VIZZINI,

i'm facing issue in printf() in AUTODEVKITSTUDIO. im using printf() in the code after compiling im getting this error

 

c:/autodevkitstudio-2.7.0/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.202511271245/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib/e200z4\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0x1a): undefined reference to `sbrk'
c:/autodevkitstudio-2.7.0/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.202511271245/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib/e200z4\libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x1e): undefined reference to `write'
c:/autodevkitstudio-2.7.0/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.202511271245/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib/e200z4\libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text._close_r+0x1a): undefined reference to `close'
c:/autodevkitstudio-2.7.0/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.202511271245/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib/e200z4\libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text._fstat_r+0x1c): undefined reference to `fstat'
c:/autodevkitstudio-2.7.0/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.202511271245/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib/e200z4\libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text._isatty_r+0x1a): undefined reference to `isatty'
c:/autodevkitstudio-2.7.0/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.202511271245/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib/e200z4\libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x1e): undefined reference to `lseek'
c:/autodevkitstudio-2.7.0/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.202511271245/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib/e200z4\libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x1e): undefined reference to `read'
collect2.exe: error: ld returned 1 exit status
make: *** [components/spc58ecxx_platform_component_rla/lib/rsc/rules.mk:164: build/out.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

12:57:38 Build Failed. 8 errors, 0 warnings. (took 38s.700ms)

 

 

 

 

 

please help me in this.

 

1 REPLY 1
SRomeo
ST Employee

Hi Pooja,

I see you are missing some syscalls.
On SPC58 projects, those low-level functions are 
not provided automatically, so the linker complains.
One way to solve your issue is to provide those functions, defining them manually.


I suggest you take a look to these 2 AutoDevKit examples to understand how:
"SPC58ECxx_RLA SERIAL Test Application for DiscoveryPlus"  (where everything works fine)
or

"SPC58EC - AEK_POW_BMSWTX_SOC_Est_SingleAccess_CHAIN application for discovery "  
(where stdio.h and string.h have been included and *sbrk(size_t incr) has been defined)

BR
Simone, AEK_Team