C Programming for Embedded - Build Errors

Post here on these publications

Postby warwick » Thu Jul 05, 2012 12:00 am

Hi malkowki

It is impossible for me to know what is wrong as there is not enough information in that error message.

I have just tested the string_tx example in Yagarto GCC 4.6.2 and only had to change elf to none-eabi and the version number in the library path within the make file to get it to compile correctly.

Have you been able to compile any of the other examples?

Warwick
warwick
 
Posts: 11
Joined: Thu Jan 02, 2014 10:39 am

Postby malkowki » Thu Jul 05, 2012 12:00 am

Hi Warwick,

I have been able to test the switch-led,serial_tx with Yagarto 4.6.0 I have no issue, only with the string_tx I have trouble.
for the string example I needed to add the syscall function in the make file like you described in earlier discussion.
I will try to follow the next examples from the book and trying to compile them.
malkowki
 
Posts: 12
Joined: Thu Jan 02, 2014 10:39 am

Postby warwick » Thu Jul 05, 2012 12:00 am

Hi malkowki

Also try commenting out lines of code in the string_tx main.c file to see if it will compile.

Start by commenting out the sprintf statement. If it still gives errors, try commenting out other lines and then try to determine which line is the problem.
warwick
 
Posts: 11
Joined: Thu Jan 02, 2014 10:39 am

Postby malkowki » Mon Jul 09, 2012 12:00 am

Hello Warwick,

I am starting having issue when inserting the syscalls.c file in the make file.
I have attached the make file with syscalls on comment then I got the following errors:

**** Build of configuration Default for project string2_tx ****

make all
arm-none-eabi-gcc -nostartfiles -Wl,-Map,out.map,--cref -T RAM.ld -n -o string2_tx.elf startup.o main.o
c:/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.0/../../../../arm-none-eabi/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\reent/../../../../../newlib-1.19.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
collect2: ld returned 1 exit status
make.exe: *** [sram] Error 1
malkowki
 
Posts: 12
Joined: Thu Jan 02, 2014 10:39 am

Postby malkowki » Mon Jul 09, 2012 12:00 am

Hi Warwick,

I am having issue when compiling the syscalls.c via the make file.so I removed in the make file and then I have the following error message:



**** Build of configuration Default for project string2_tx ****

make all
arm-none-eabi-gcc -nostartfiles -Wl,-Map,out.map,--cref -T RAM.ld -n -o string2_tx.elf startup.o main.o
c:/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.0/../../../../arm-none-eabi/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\reent/../../../../../newlib-1.19.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
collect2: ld returned 1 exit status
make.exe: *** [sram] Error 1
malkowki
 
Posts: 12
Joined: Thu Jan 02, 2014 10:39 am

Postby malkowki » Mon Jul 09, 2012 12:00 am

Hi Warwick,

I am having issue when compiling the syscalls.c via the make file.so I removed in the make file and then I have the following error message:



**** Build of configuration Default for project string2_tx ****

make all
arm-none-eabi-gcc -nostartfiles -Wl,-Map,out.map,--cref -T RAM.ld -n -o string2_tx.elf startup.o main.o
c:/yagarto/bin/../lib/gcc/arm-none-eabi/4.6.0/../../../../arm-none-eabi/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\newlib\libc\reent/../../../../../newlib-1.19.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
collect2: ld returned 1 exit status
make.exe: *** [sram] Error 1
malkowki
 
Posts: 12
Joined: Thu Jan 02, 2014 10:39 am

Postby malkowki » Mon Jul 09, 2012 12:00 am

here the make file
Attachments
makefile.txt
(2.08 KiB) Downloaded 68 times
malkowki
 
Posts: 12
Joined: Thu Jan 02, 2014 10:39 am

Postby warwick » Mon Jul 09, 2012 12:00 am

Hi malkowki

Please send me your entire project zipped so that I can try and build it on my computer and see what the problem is.

Warwick
warwick
 
Posts: 11
Joined: Thu Jan 02, 2014 10:39 am

Postby malkowki » Tue Jul 10, 2012 12:00 am

Hi warwick,

I have sent the project by email to you.
malkowki
 
Posts: 12
Joined: Thu Jan 02, 2014 10:39 am

Postby warwick » Tue Jul 10, 2012 12:00 am

Hi malkowki

I have just tested your project on my PC. All I did was add the parts back in that you commented out in the makefile -- i.e. compiling and linking of syscalls.c

The compile and link were successful. In main.c I also had to change the line:
DBGUTxMsg("my_str"); back to DBGUTxMsg(my_str);
I assume that you changed that line for debugging. I have also tested the output binary file on my board and everything works.

If you have other programming tools on your computer, a different "make" program may be running instead of GNU make. To test that another "make" program is running instead of GNU make, start a terminal window (cmd) and enter:
make --version

You should get back:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-mingw32


Otherwise, remove Yagarto and reinstall following the instructions from yagarto.de

Warwick
warwick
 
Posts: 11
Joined: Thu Jan 02, 2014 10:39 am

PreviousNext

Return to Books | CDs | DVDs| Videos | Courses | Seminars | Webinars

Who is online

Users browsing this forum: No registered users and 1 guest