2011-05-17 10:47:35     STDIO crash with bare metal toolchain.

Document created by Aaronwu Employee on Oct 16, 2013
Version 1Show Document
  • View in full screen mode

2011-05-17 10:47:35     STDIO crash with bare metal toolchain.

Prasanth Rajagopal (INDIA)

Message: 100697   

 

I created a default - hello world on eclipse with bare metal toolchain and ended up in:

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.

**** Build of configuration Debug for project hello-world ****

 

make all

'Building file: ../src/hello-world.c'

'Invoking: Blackfin ELF C Compiler'

bfin-elf-gcc -O0 -g3 -Wall -c -fmessage-length=0 -v -mcpu=bf533-any -MMD -MP -MF"src/hello-world.d" -MT"src/hello-world.d" -o"src/hello-world.o" "../src/hello-world.c"

Using built-in specs.

Target: bfin-elf

Configured with: /usr/local/src/blackfin/git/toolchain/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc --target=bfin-elf --prefix=/usr/local/src/blackfin/toolchains/win32/20101128/bfin-elf --with-newlib --disable-libstdcxx-pch --enable-languages=c,c++ --disable-symvers --disable-libssp --disable-libffi --enable-clocale=generic --enable-version-specific-runtime-libs --enable-__cxa_atexit --with-bugurl=URL:http://blackfin.uclinux.org/gf/project/toolchain/tracker --with-pkgversion=ADI-trunk/git-613986c

Thread model: single

gcc version 4.3.5 (ADI-trunk/git-613986c)

COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-mcpu=bf533-any' '-MMD' '-MP' '-MFsrc/hello-world.d' '-MTsrc/hello-world.d' '-osrc/hello-world.o'

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../libexec/gcc/bfin-elf/4.3.5/cc1.exe -quiet -v -iprefix c:\program files\analog devices\gnu toolchain\svn-20101128\elf\bin\../lib/gcc/bfin-elf/4.3.5/ -MMD hello-world.dsrc/hello-world.o -MFsrc/hello-world.d -MP -MTsrc/hello-world.d -MQ src/hello-world.o -dD ../src/hello-world.c -quiet -dumpbase hello-world.c -mcpu=bf533-any -auxbase-strip src/hello-world.o -g3 -O0 -Wall -version -fmessage-length=0 -o C:\Users\prajagop\AppData\Local\Temp/ccSAbaaa.s

ignoring nonexistent directory "c:\program files\analog devices\gnu toolchain\svn-20101128\elf\bin\../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/sys-include"

ignoring nonexistent directory "c:/program files/analog devices/gnu toolchain/svn-20101128/elf/lib/gcc/../../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/sys-include"

#include "..." search starts here:

#include <...> search starts here:

c:\program files\analog devices\gnu toolchain\svn-20101128\elf\bin\../lib/gcc/bfin-elf/4.3.5/include

c:\program files\analog devices\gnu toolchain\svn-20101128\elf\bin\../lib/gcc/bfin-elf/4.3.5/include-fixed

c:\program files\analog devices\gnu toolchain\svn-20101128\elf\bin\../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/lib/gcc/../../lib/gcc/bfin-elf/4.3.5/include

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/lib/gcc/../../lib/gcc/bfin-elf/4.3.5/include-fixed

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/lib/gcc/../../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include

End of search list.

GNU C (ADI-trunk/git-613986c) version 4.3.5 (bfin-elf)

    compiled by GNU C version 3.4.5 (mingw special), GMP version 4.3.2, MPFR version 2.4.2-p3.

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

Compiler executable checksum: 806f96ece8172c756fc0cbbb493453df

COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-mcpu=bf533-any' '-MMD' '-MP' '-MFsrc/hello-world.d' '-MTsrc/hello-world.d' '-osrc/hello-world.o'

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/bin/as.exe -v -mcpu=bf533-any -osrc/hello-world.o C:\Users\prajagop\AppData\Local\Temp/ccSAbaaa.s

'Finished building: ../src/hello-world.c'

GNU assembler version 2.17 (bfin-elf) using BFD version 2.17

COMPILER_PATH=c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../libexec/gcc/bfin-elf/4.3.5/;c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../libexec/gcc/;c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/bin/

' '

'Building target: hello-world'

'Invoking: Blackfin ELF C Linker'

LIBRARY_PATH=c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/;c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/;c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/

bfin-elf-gcc -mcpu=bf533-any -o"hello-world"  ./src/hello-world.o  

COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-mcpu=bf533-any' '-MMD' '-MP' '-MFsrc/hello-world.d' '-MTsrc/hello-world.d' '-osrc/hello-world.o'

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib\libc.a(closer.o): In function `close_r':

/usr/local/src/blackfin/git/toolchain/gcc-4.3/newlib/libc/reent/closer.c:53: warning: _close is not implemented and will always fail

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib\libc.a(fstatr.o): In function `fstat_r':

/usr/local/src/blackfin/git/toolchain/gcc-4.3/newlib/libc/reent/fstatr.c:62: warning: _fstat is not implemented and will always fail

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib\libc.a(makebuf.o): In function `_smakebuf':

/usr/local/src/blackfin/git/toolchain/gcc-4.3/newlib/libc/stdio/makebuf.c:96: warning: isatty is not implemented and will always fail

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib\libc.a(lseekr.o): In function `lseek_r':

/usr/local/src/blackfin/git/toolchain/gcc-4.3/newlib/libc/reent/lseekr.c:58: warning: _lseek is not implemented and will always fail

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib\libc.a(readr.o): In function `read_r':

'Finished building target: hello-world'

/usr/local/src/blackfin/git/toolchain/gcc-4.3/newlib/libc/reent/readr.c:58: warning: _read is not implemented and will always fail

c:/program files/analog devices/gnu toolchain/svn-20101128/elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib\libc.a(writer.o): In function `write_r':

/usr/local/src/blackfin/git/toolchain/gcc-4.3/newlib/libc/reent/writer.c:58: warning: _write is not implemented and will always fail

' '

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.

 

 

..... and IO accesses end up in exception handler.

 

I got these threads::-

 

https://blackfin.uclinux.org/gf/forumthread/38168

 

https://blackfin.uclinux.org/gf/forumthread/27923

 

Is it the case that bare metal toolchain doesnt support these std IO libraries - by default or did it wrong from the above threads? If it doesnt support, how do I fix it without having to write from scratch? VDSP has support for this, and is there anything I might be able to do with drivers of that toolchain?

 

 

 

Thanks

QuoteReplyEditDelete

 

 

2011-05-17 11:00:22     Re: STDIO crash with bare metal toolchain.

Frank Lorenz (GERMANY)

Message: 100698   

 

Hi,

 

 

 

I found this page which is quite helpful for this (just look for the standard implementations for the functions you need):

 

 

 

http://www.embecosm.com/appnotes/ean9/ean9-howto-newlib-1.0.html

TranslateQuoteReplyEditDelete

 

 

2011-05-17 13:23:08     Re: STDIO crash with bare metal toolchain.

Mike Frysinger (UNITED STATES)

Message: 100701   

 

you'll have to implement the low level I/O yourself.  i.e. stubs that write to a UART or wherever else you want your "stdio" to go.

QuoteReplyEditDelete

 

 

2011-05-18 02:21:31     Re: STDIO crash with bare metal toolchain.

Prasanth Rajagopal (INDIA)

Message: 100711   

 

Actually all I want now is the printf() output to appear on eclipse console - just like how VDSP works. I had a feeling that there must be something already available on those lines?

 

Thanks.

QuoteReplyEditDelete

 

 

2011-05-18 02:37:19     Re: STDIO crash with bare metal toolchain.

Mike Frysinger (UNITED STATES)

Message: 100713   

 

there is no support for that out of the box.  what you're asking for isnt trivial no matter how easy VDSP makes it look.

Attachments

    Outcomes