Re: [arm-gnu] What is Hosted and UnHosted in CodeSourcery G++ IDE
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] What is Hosted and UnHosted in CodeSourcery G++ IDE



ravi wrote:
> Hi,
> 
> 
> I am using codesourcery g++ IDE for my target board without any target
> OS for Cortex M3 (STM32). There are options like <hosted> and <unhosted>
> in setting up the build environment for the project in the IDE. When I
> try with hosted option, build was successful an below is the message
> 
> ******************************
> ********************************************
> 'Building target: elisa'
> 'Invoking: GCC C Linker'
> arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T str91x-rom-hosted.ld
> -o"elisa"  ./adccomputations.o ./elisa.o ./elisafunc.o ./flash.o
> ./interface.o ./keyboard.o ./lcdfunc.o ./lcdview.o ./motor.o ./parser.o
> ./printer.o ./st_cortexm3.o   -lm
> 'Finished building target: elisa'
> ' '
> Build complete for project elisa
> *************************************************************************
> 
> When build with option unhosted, the following are the warnings
> 
> *****************************************************************************************************************************
> 'Building target: elisa'
> 'Invoking: GCC C Linker'
> arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T str91x-rom.ld -o"elisa" 
> ./adccomputations.o ./elisa.o ./elisafunc.o ./flash.o ./interface.o
> ./keyboard.o ./lcdfunc.o ./lcdview.o ./motor.o ./parser.o ./printer.o
> ./st_cortexm3.o   -lm
> c:/program files/codesourcery/sourcery
> g++/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_close.o):
> warning: IO function '_close' used
> c:/program files/codesourcery/sourcery
> g++/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_fstat.o):
> warning: IO function '_fstat' used
> c:/program files/codesourcery/sourcery
> g++/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-isatty.o):
> warning: IO function 'isatty' used
> c:/program files/codesourcery/sourcery
> g++/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_kill.o):
> warning: IO function '_kill' used
> c:/program files/codesourcery/sourcery
> g++/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_lseek.o):
> warning: IO function '_lseek' used
> c:/program files/codesourcery/sourcery
> g++/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_read.o):
> warning: IO function '_read' used
> c:/program files/codesourcery/sourcery
> g++/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-_write.o):
> warning: IO function '_write' used
> 'Finished building target: elisa'
> ' '
> Build complete for project elisa
> ************************************************************************************************************************
> 
> Do I have to do any special settings?

Ravi,

Options "-hosted" and "-unhosted" indicated whether semi-hosting is
provided or not.  As described in the Getting Started Guide, section
3.1.1.5.2:

"CS3 is designed to support boards where there may be no operating
system. To allow functions like open and write to work, a semihosting
feature is supported, in conjunction with the debugger. With semihosting
enabled, these system calls are translated into equivalent function
calls on your host system. You can only use these function calls while
connected to the debugger; if you try to use them when disconnected from
the debugger, you will get a hardware exception.

The hosted CS3 linker scripts provide the semihosting support, and as
such programs linked with them may only be run with the debugger. The
unhosted CS3 linker scripts provide stub versions of the system calls,
which return an appropriate error value in errno. If such a stub system
call is required in the executable, the linker also produces a warning.
Such a warning may indicate that you have left debugging code active,
and that your executable is larger than it might need to be."  The
latter explains the Warnings you are seeing when using an unhosted
configuration.

Please see the Getting Started Guide for more information.

> 
> -- 
> regards
>  ravi

Thanks
-- 
Bill Traynor
CodeSourcery
bill@xxxxxxxxxxxxxxxx
650-331-3385 x725