Attachment | Size |
---|---|
![]() | 225 bytes |
Building ARM bare machine applications without host I/O
By default the ARM bring-up tools build bare machine applications with host I/O enabled. These applications can only be loaded and run on a ARM target using armv7-linux-gdb; they cannot be run without the use of armv7-linux-gdb since the applications will perform I/O requests during their start up and if armv7-linux-gdb is not used to run the application will not execute correctly.
GCC 4.8
To build an application that does not perform any host I/O (and therefore can be loaded and run without using armv7-linux-gdb) specify the -mno-host-io compiler option when linking the application.
For example, to build an application (for a B2020-STiH415 target) without I/O:host% arm-none-eabi-gcc hello.o -o hello.out -Wl,--defsym,__start=0x40000000,--defsym,__stack=0x60000000 -mno-host-io
GCC 4.7
To build an application that does not perform any host I/O (and therefore can be loaded and run without using armv7-linux-gdb) the following steps are required:
- Download and extract the the attached specs file, noio.specs, which contains the following:
Note: Please do not copy and paste the above text (instead of downloading the attached specs file) since this may introduce erroneous spaces that will cause problems when the specs file is interpreted by GCC.
%rename lib lib_noio %rename startfile startfile_noio *lib: -lc -lnosys -T rdimon.ld *startfile: crti%O%s crtbegin%O%s crt0%O%s cortex-a9-init%O%s
- Replace the link command used to build an application (for a B2020-STiH415 target) with I/O:
with the following:
host% arm-none-eabi-gcc hello.o -o hello.out -Wl,--defsym,__start=0x40000000,--defsym,__stack=0x60000000
assuming that noio.specs is in the current directory (if not change the -B option to specify the actual location of noio.specs). Note that the command line is identical to that used to build an application with I/O except for the addition of the -B and -specs options.host% arm-none-eabi-gcc hello.o -o hello.out -Wl,--defsym,__start=0x40000000,--defsym,__stack=0x60000000 -B. -specs=noio.specs
Architecture: