Hi, When i try to compile the newlib-lpc (make all) output window says next: > "make.exe" all arm-elf-ar cr libnewlib-lpc.a _close_r.o arm-elf-ar cr libnewlib-lpc.a _fstat_r.o arm-elf-ar cr libnewlib-lpc.a _ioctl_r.o arm-elf-ar cr libnewlib-lpc.a _lseek_r.o arm-elf-ar cr libnewlib-lpc.a _open_r.o arm-elf-ar cr libnewlib-lpc.a _read_r.o arm-elf-ar cr libnewlib-lpc.a _sbrk_r.o arm-elf-ar cr libnewlib-lpc.a sys_dev.o arm-elf-ar cr libnewlib-lpc.a sys_mam.o arm-elf-ar cr libnewlib-lpc.a sys_pll.o arm-elf-ar cr libnewlib-lpc.a sys_time.o arm-elf-ar cr libnewlib-lpc.a sys_vic.o arm-elf-ar cr libnewlib-lpc.a sys_vpb.o arm-elf-ar cr libnewlib-lpc.a uart0_poll.o arm-elf-ar cr libnewlib-lpc.a uart0_int.o arm-elf-ar cr libnewlib-lpc.a uart1_poll.o arm-elf-ar cr libnewlib-lpc.a uart1_int.o arm-elf-ld -v -otest2.prg -L. -L c -L /winarm/bin/../lib/gcc/arm-elf/4.1.1/;c -L /winarm/bin/../lib/gcc/;c -L /WinARM/lib/gcc/arm-elf/4.1.1/;/usr/lib/gcc/arm-elf/4.1.1/;c -L /winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/arm-elf/4.1 .1/;c -L /winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/;c -L /WinARM/lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/arm-elf/4.1.1/;c -L /WinARM/lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/ crt0.o test2.o _close_r.o _fstat_r.o _ioctl_r.o _lseek_r.o _open_r.o _read_r.o _sbrk_r.o sys_dev.o sys_mam.o sys_pll.o sys_time.o sys_vic.o sys_vpb.o uart0_poll.o uart0_int.o uart1_poll.o uart1_int.o _write_r.o interrupt_sup.o uart0_ishell.o uart1_ishell.o -Tlpc210x.ld GNU ld version 060606 20060606 /usr/bin/sh: c: command not found /usr/bin/sh: c: command not found /usr/bin/sh: /usr/lib/gcc/arm-elf/4.1.1/: No such file or directory /usr/bin/sh: c: command not found /usr/bin/sh: c: command not found /usr/bin/sh: c: command not found /usr/bin/sh: c: command not found make.exe: *** [test2.prg] Error 127 > Process Exit Code: 2 > Time Taken: 00:01 and when i compile the (make lib), output windows says next: > "make" lib arm-elf-ar cr libnewlib-lpc.a _close_r.o arm-elf-ar cr libnewlib-lpc.a _fstat_r.o arm-elf-ar cr libnewlib-lpc.a _ioctl_r.o arm-elf-ar cr libnewlib-lpc.a _lseek_r.o arm-elf-ar cr libnewlib-lpc.a _open_r.o arm-elf-ar cr libnewlib-lpc.a _read_r.o arm-elf-ar cr libnewlib-lpc.a _sbrk_r.o arm-elf-ar cr libnewlib-lpc.a sys_dev.o arm-elf-ar cr libnewlib-lpc.a sys_mam.o arm-elf-ar cr libnewlib-lpc.a sys_pll.o arm-elf-ar cr libnewlib-lpc.a sys_time.o arm-elf-ar cr libnewlib-lpc.a sys_vic.o arm-elf-ar cr libnewlib-lpc.a sys_vpb.o arm-elf-ar cr libnewlib-lpc.a uart0_poll.o arm-elf-ar cr libnewlib-lpc.a uart0_int.o arm-elf-ar cr libnewlib-lpc.a uart1_poll.o arm-elf-ar cr libnewlib-lpc.a uart1_int.o > Process Exit Code: 0 > Time Taken: 00:01 And then i copy the libnewlib-lpc.a file to the project where the linker searches libraries and try to use sprintf function and output windows show next: Linking: main.elf arm-elf-gcc -mthumb -mcpu=arm7tdmi-s -mthumb-interwork -I. -gdwarf-2 -DROM_RUN -Os -Wall -Wcast-align -Wcast-qual -Wimplicit -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow -Wunused -Wa,-adhlns=crt0.lst -I../Common_WinARM/inc -MD -MP -MF .dep/main.elf.d crt0.o ../Common_WinARM/src/Startup.o ../Common_WinARM/src/swi_handler.o ../Common_WinARM/src/irq.o ../Common_WinARM/src/target.o ../Common_WinARM/src/timer.o main.o efsl_time_LPC.o extint.o adc.o spi.o humi.o write_sd.o --output main.elf -nostartfiles -Wl,-Map=main.map,--cref -lc -lnewlib-lpc -lm -lc -lgcc -lefsl -L../../ -TLPC2138-ROM.ld c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: Warning: ../../\libnewlib-lpc.a(_close_r.o) does not support interworking, whereas main.elf does c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: Warning: ../../\libnewlib-lpc.a(_fstat_r.o) does not support interworking, whereas main.elf does c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: Warning: ../../\libnewlib-lpc.a(_lseek_r.o) does not support interworking, whereas main.elf does c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: Warning: ../../\libnewlib-lpc.a(_read_r.o) does not support interworking, whereas main.elf does c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: Warning: ../../\libnewlib-lpc.a(_sbrk_r.o) does not support interworking, whereas main.elf does c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: Warning: ../../\libnewlib-lpc.a(_write_r.o) does not support interworking, whereas main.elf does c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: Warning: ../../\libnewlib-lpc.a(_ioctl_r.o) does not support interworking, whereas main.elf does c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_sbrk_r.o)(_sbrk_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(freer.o): thumb call to arm c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(freer.o): In function `_malloc_trim_r': mallocr.c:(.text+0x2c): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_sbrk_r.o)(_sbrk_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(freer.o): thumb call to arm mallocr.c:(.text+0x3c): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_sbrk_r.o)(_sbrk_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(freer.o): thumb call to arm mallocr.c:(.text+0x48): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_fstat_r.o)(_fstat_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(makebuf.o): thumb call to arm c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(makebuf.o): In function `__smakebuf': makebuf.c:(.text+0x1c): warning: internal error: dangerous error makebuf.c:(.text+0xb2): undefined reference to `isatty' c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_sbrk_r.o)(_sbrk_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(mallocr.o): thumb call to arm c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(mallocr.o): In function `_malloc_r': mallocr.c:(.text+0x2e8): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_sbrk_r.o)(_sbrk_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(mallocr.o): thumb call to arm mallocr.c:(.text+0x388): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_close_r.o)(_close_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): thumb call to arm c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): In function `__sclose': stdio.c:(.text+0xc): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_lseek_r.o)(_lseek_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): thumb call to arm c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): In function `__sseek': stdio.c:(.text+0x2a): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_lseek_r.o)(_lseek_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): thumb call to arm c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): In function `__swrite': stdio.c:(.text+0x6e): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_write_r.o)(_write_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): thumb call to arm stdio.c:(.text+0x86): warning: internal error: dangerous error c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: ../../\libnewlib-lpc.a(_read_r.o)(_read_r): warning: interworking not enabled. first occurrence: c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): thumb call to arm c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(stdio.o): In function `__sread': stdio.c:(.text+0xaa): warning: internal error: dangerous error ../../\libnewlib-lpc.a(_close_r.o): In function `_close_r': _close_r.c:(.text+0x38): undefined reference to `device_table' ../../\libnewlib-lpc.a(_read_r.o): In function `_read_r': _read_r.c:(.text+0xa0): undefined reference to `device_table' ../../\libnewlib-lpc.a(_write_r.o): In function `_write_r': _write_r.c:(.text+0xe8): undefined reference to `device_table' ../../\libnewlib-lpc.a(_ioctl_r.o): In function `_ioctl_r': _ioctl_r.c:(.text+0x48): undefined reference to `device_table' collect2: ld returned 1 exit status make.exe: *** [main.elf] Error 1 can you say what is going wrong? thanx Timo
timo wrote: > Hi, > When i try to compile the newlib-lpc (make all) output window says next: > >> "make.exe" all > /usr/bin/sh: c: command not found > /usr/bin/sh: c: command not found > /usr/bin/sh: /usr/lib/gcc/arm-elf/4.1.1/: No such file or directory > > can you say what is going wrong? > > thanx Timo from where you try to build this ? natively or under cygwin ? jonathan
Jonathan Dumaresq wrote: > timo wrote: >> Hi, >> When i try to compile the newlib-lpc (make all) output window says next: >> >>> "make.exe" all >> /usr/bin/sh: c: command not found >> /usr/bin/sh: c: command not found >> /usr/bin/sh: /usr/lib/gcc/arm-elf/4.1.1/: No such file or directory >> >> can you say what is going wrong? >> >> thanx Timo > > from where you try to build this ? natively or under cygwin ? > > jonathan hi, i build it under cygvin. -timo
timo wrote: > Jonathan Dumaresq wrote: >> timo wrote: >>> Hi, >>> When i try to compile the newlib-lpc (make all) output window says next: >>> >>>> "make.exe" all >>> /usr/bin/sh: c: command not found >>> /usr/bin/sh: c: command not found >>> /usr/bin/sh: /usr/lib/gcc/arm-elf/4.1.1/: No such file or directory >>> >>> can you say what is going wrong? >>> > > hi, > > i build it under cygvin. > > -timo what is you version of make.exe ? does this directory exist ? /usr/lib/gcc/arm-elf/4.1.1 ? I have never rebuild it but it seem to ba a pth related problem. Jonathan
timo wrote: > /usr/bin/sh: c: command not found > make.exe: *** [test2.prg] Error 127 So something just failed here. As Jonathan Dumaresq already mentioned this looks like a problem with the shell (bash!=cmd) or a tool called by make. > And then i copy the libnewlib-lpc.a file to the project where the linker > searches libraries and try to use sprintf function and output windows > show next: > c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: > Warning: ../../\libnewlib-lpc.a(_close_r.o) does not support > interworking, whereas main.elf does The libnewlib-lpc.a which the linker tries to link does not support interwork. > In function `__smakebuf': > makebuf.c:(.text+0x1c): warning: internal error: dangerous error > makebuf.c:(.text+0xb2): undefined reference to `isatty' First create a newlib-lpc with interwork-support and try again. newlib-lpc provides the isatty function IRC. > can you say what is going wrong? You build your application with thumb/thumb-iw and try to link a library which does not support this. I have done an experimental makefile for newlib-lpc: http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/winarmtests/Makefile_newlib_lpc_interwork.txt This should create a newlib-lpc with thumb/thumb-iw support in file libnewlib-lpc_IW.a. So change your project's makefile to use this library (add the "_IW" maybe you have to extend the library-search-path). So far I have not tested with hardware or a simulator. So just give it a try and write what you have found out. Martin Thomas
Martin Thomas wrote: > timo wrote: > >> /usr/bin/sh: c: command not found >> make.exe: *** [test2.prg] Error 127 > > So something just failed here. As Jonathan Dumaresq already mentioned > this looks like a problem with the shell (bash!=cmd) or a tool called by > make. > >> And then i copy the libnewlib-lpc.a file to the project where the linker >> searches libraries and try to use sprintf function and output windows >> show next: >> c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: >> Warning: ../../\libnewlib-lpc.a(_close_r.o) does not support >> interworking, whereas main.elf does > > The libnewlib-lpc.a which the linker tries to link does not support > interwork. > >> In function `__smakebuf': >> makebuf.c:(.text+0x1c): warning: internal error: dangerous error >> makebuf.c:(.text+0xb2): undefined reference to `isatty' > > First create a newlib-lpc with interwork-support and try again. > newlib-lpc provides the isatty function IRC. > >> can you say what is going wrong? > > You build your application with thumb/thumb-iw and try to link a library > which does not support this. > > I have done an experimental makefile for newlib-lpc: > http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/winarmtests/Makefile_newlib_lpc_interwork.txt > > This should create a newlib-lpc with thumb/thumb-iw support in file > libnewlib-lpc_IW.a. So change your project's makefile to use this > library (add the "_IW" maybe you have to extend the > library-search-path). So far I have not tested with hardware or a > simulator. So just give it a try and write what you have found out. > > Martin Thomas Hello Martin, Thanks for the makefile. But I still get this errors. Could you help me please? Linking: main.elf arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gstabs -DROM_RUN -DVECTORS_ROM -D__WinARM__ -Os -Wall -Wcast-align -Wimplicit -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow -Wunused -Wa,-adhlns=Cstartup.lst -MD -MP -MF .dep/main.elf.d Cstartup.o Cstartup_SAM7.o main.o lcd.o --output main.elf -nostartfiles -Wl,-Map=main.map,--cref -lc -lnewlib-lpc_IW -lm -lc -lgcc -TAT91SAM7X256-ROM.ld c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int erwork\libc.a(makebuf.o): In function `__smakebuf': makebuf.c:(.text+0xb2): undefined reference to `isatty' c:\winarm\arm-elf\bin\../lib\libnewlib-lpc_IW.a(_close_r.o): In function `_close_r': C:\WinARM\utils\newlib_lpc_rel5a_src/_close_r.c:71: undefined reference to `device_table' c:\winarm\arm-elf\bin\../lib\libnewlib-lpc_IW.a(_read_r.o): In function `_read_r': C:\WinARM\utils\newlib_lpc_rel5a_src/_read_r.c:84: undefined reference to `device_table' c:\winarm\arm-elf\bin\../lib\libnewlib-lpc_IW.a(_write_r.o): In function `_write_r': C:\WinARM\utils\newlib_lpc_rel5a_src/_write_r.c:103: undefined reference to `device_table' c:\winarm\arm-elf\bin\../lib\libnewlib-lpc_IW.a(_ioctl_r.o): In function `_ioctl_r': C:\WinARM\utils\newlib_lpc_rel5a_src/_ioctl_r.c:75: undefined reference to `device_table' collect2: ld returned 1 exit status make.exe: *** [main.elf] Error 1 Thanks, Tudor
> Linking: main.elf > arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gstabs > -DROM_RUN -DVECTORS_ROM -D__WinARM__ -Os -Wall -Wcast-align -Wimplicit > -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow > -Wunused -Wa,-adhlns=Cstartup.lst -MD -MP -MF .dep/main.elf.d > Cstartup.o Cstartup_SAM7.o main.o lcd.o --output main.elf > -nostartfiles -Wl,-Map=main.map,--cref -lc -lnewlib-lpc_IW -lm -lc -lgcc > -TAT91SAM7X256-ROM.ld newlib-lpc on an AT91SAM7X? Strange idea. At least the UART-drivers and the functions to set up MAM/VPB etc. in the newlib-lpc (-lpc not "-sam7") will not work for SAM7s. >c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/in terwork\libc.a(makebuf.o): > In function `__smakebuf': > makebuf.c:(.text+0xb2): undefined reference to `isatty' Provide you own isatty-function. > c:\winarm\arm-elf\bin\../lib\libnewlib-lpc_IW.a(_close_r.o): In function > `_close_r': > C:\WinARM\utils\newlib_lpc_rel5a_src/_close_r.c:71: undefined reference > to `device_table' Provide the device_table. It's an array of device_table_entry structs. See the newlib-lpc examples. Martin Thomas
Martin Thomas wrote: >> Linking: main.elf >> arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gstabs >> -DROM_RUN -DVECTORS_ROM -D__WinARM__ -Os -Wall -Wcast-align -Wimplicit >> -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow >> -Wunused -Wa,-adhlns=Cstartup.lst -MD -MP -MF .dep/main.elf.d >> Cstartup.o Cstartup_SAM7.o main.o lcd.o --output main.elf >> -nostartfiles -Wl,-Map=main.map,--cref -lc -lnewlib-lpc_IW -lm -lc -lgcc >> -TAT91SAM7X256-ROM.ld > > newlib-lpc on an AT91SAM7X? Strange idea. At least the UART-drivers and > the functions to set up MAM/VPB etc. in the newlib-lpc (-lpc not > "-sam7") will not work for SAM7s. > >>c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/i nterwork\libc.a(makebuf.o): >> In function `__smakebuf': >> makebuf.c:(.text+0xb2): undefined reference to `isatty' > > Provide you own isatty-function. > >> c:\winarm\arm-elf\bin\../lib\libnewlib-lpc_IW.a(_close_r.o): In function >> `_close_r': >> C:\WinARM\utils\newlib_lpc_rel5a_src/_close_r.c:71: undefined reference >> to `device_table' > > Provide the device_table. It's an array of device_table_entry structs. > See the newlib-lpc examples. > > > Martin Thomas Thanks a lot Martin. I was very confused with the whole library. So this is not a library to work with AT91SAM7X! I'm very new to this, so please don't laugh! Do you know any library that I could use with this hardware? Thanks, Tudor
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.