Arduino IDE compile errors

Discussion in 'Arduino IDE' started by peter247, Mar 14, 2014.

  1. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    Hi , I`m running the Debian hard float image and installed arduino ide using this :-

    http://www.elinux.org/UDOO_install_the_Arduino_IDE

    I tested it out using the blink sketch with the following error ( Blinking led , so did work ).
    Code:
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
    sbrkr.c:(.text._sbrk_r+0xc): warning: undefined reference to `_sbrk'
    Which is the same error which I got on the ubuntu image , so thought this was normal and working.

    Now after getting the quad core part working with all my software installed and rootfs now copied to the sata I`ve started to look at the arduino part.

    Now tried to compile one of the i2c / wire sketches which came up with the following errors
    Code:
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
    sbrkr.c:(.text._sbrk_r+0xc): warning: undefined reference to `_sbrk'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-abort.o): In function `abort':
    abort.c:(.text.abort+0xa): warning: undefined reference to `_exit'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-signalr.o): In function `_kill_r':
    signalr.c:(.text._kill_r+0xe): warning: undefined reference to `_kill'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-signalr.o): In function `_getpid_r':
    signalr.c:(.text._getpid_r+0x2): warning: undefined reference to `_getpid'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-writer.o): In function `_write_r':
    writer.c:(.text._write_r+0x10): warning: undefined reference to `_write'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-closer.o): In function `_close_r':
    closer.c:(.text._close_r+0xc): warning: undefined reference to `_close'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-fstatr.o): In function `_fstat_r':
    fstatr.c:(.text._fstat_r+0xe): warning: undefined reference to `_fstat'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-isattyr.o): In function `_isatty_r':
    isattyr.c:(.text._isatty_r+0xc): warning: undefined reference to `_isatty'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-lseekr.o): In function `_lseek_r':
    lseekr.c:(.text._lseek_r+0x10): warning: undefined reference to `_lseek'
    /root/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-readr.o): In function `_read_r':
    readr.c:(.text._read_r+0x10): warning: undefined reference to `_read'
    
    Sketch uses 29,036 bytes (5%) of program storage space. Maximum is 524,288 bytes.
    I`ve tried the same using the pc method and compile which only a little error :

    cygwin warning: MS-DOS style path detected: .. no problem !-

    I know that it need a "at least this version" , of java
    how do I tell which version is installed ? ,

    I may be a little confused on is how it compiles !!

    On the PC the compiler is within the arduino base , because window is always i386 based.
    so it compile i386 to amega / arm I guess on the due .
    But with Linux it can be i386 or arm etc , so what and where is the compiler the standard GCC ? to and from arm.


    and any clues to what is my problem ?
     
  2. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    I`ve worked out the answer to my own question on the compiler .
    When you download the code Linux they assume you are still running on a i386 system , which is true 99.999999999999% of the time.

    I`ve read a post saying the errors are due to commented out lines in /root/arduino-1.5.4/hardware/arduino/sam/cores/arduino/iar_calls_sam3.c

    Code:
     /*
      Copyright (c) 2011 Arduino.  All right reserved.
    
      This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
      License as published by the Free Software Foundation; either
      version 2.1 of the License, or (at your option) any later version.
    
      This library is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
      See the GNU Lesser General Public License for more details.
    
      You should have received a copy of the GNU Lesser General Public
      License along with this library; if not, write to the Free Software
      Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    */
    
    /**
    * \file
    *
    * Implementation of low level library.
    *
    */
    
    #if defined __ICCARM__ /* IAR Ewarm 5.41+ */
    
    #include "board.h"
    
    #include <stdio.h>
    #include <stdint.h>
    #include <stddef.h>
    #include <yfuns.h>
    #include <uart.h>
    
    extern __weak size_t __write( int handle, const unsigned char *buf, size_t bufSize )
    {
        size_t nChars = 0 ;
    
        /* Check for the command to flush all handles */
        if ( handle == -1 )
        {
            return 0 ;
        }
    
        /* Check for stdout and stderr (only necessary if FILE descriptors are enabled.) */
        if ( handle != 1 && handle != 2 )
        {
            /* remove warnings */
            return 0xfffffff ;
        }
    
        for ( /* Empty */ ; bufSize > 0 ; --bufSize )
        {
    		while ( !uart_is_tx_ready(CONSOLE_UART) )
    			;
    		uart_write( CONSOLE_UART, *buf ) ;
            ++buf ;
            ++nChars ;
        }
    
        return nChars ;
    }
    
    
    extern __weak size_t __read( int handle, unsigned char *buf, size_t bufSize )
    {
      size_t nChars = 0 ;
    
      /* Check for stdin (only necessary if FILE descriptors are enabled) */
      if ( handle != 0 )
      {
        /* remove warnings */
        return 0xfffffff ;
      }
    
      for ( /*Empty*/; bufSize > 0 ; --bufSize )
      {
        uint8_t c;
    	while (uart_read( CONSOLE_UART, &c ))
    	  ;
    
        if ( c == 0 )
        {
          break ;
        }
        *buf++ = c ;
        ++nChars ;
      }
    
      return nChars ;
    }
    
    /**
     * \brief Outputs a character on the UART.
     *
     * \param c  Character to output.
     *
     * \return The character that was output.
     */
    extern __weak signed int putchar( signed int c )
    {
      	while ( !uart_is_tx_ready(CONSOLE_UART) )
    		;
        uart_write( CONSOLE_UART, c ) ;
    
        return c ;
    }
    #endif // defined __ICCARM__
    
    It looks like that is not my problem here !!!.
     
  3. bugman

    bugman New Member

    Joined:
    Mar 17, 2014
    Messages:
    1
    Likes Received:
    0
    Have you solve this issue? I'm having it too. Could you link the post you refer to or explain it a little more about the commented part?
    When it compiles I have:
    Code:
    /opt/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb/libc.a(lib_a-sbrkr.o)
    In function `_sbrk_r':sbrkr.c:(.text._sbrk_r+0xc): warning: undefined reference to `_sbrk'
    
     
  4. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    No , I`ve not found how to solve it.
     
  5. YannXplorer

    YannXplorer New Member

    Joined:
    Feb 12, 2014
    Messages:
    18
    Likes Received:
    0
    Hi Guys,

    It's just an idea, beacause I haven't got this trouble... But have you try to use the last arduino version 1.5.6-r2 and compile with it?

    See you soon!
     
  6. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    I downloaded the Linux. version, but found it was pre compiled for i386.
    Is there a source version, where I can compile it myself?
     
  7. YannXplorer

    YannXplorer New Member

    Joined:
    Feb 12, 2014
    Messages:
    18
    Likes Received:
    0
    I think you can find it here ^^ :
    http://arduino.cc/en/Main/Software#toc3

    For x86 and x64 Linux architecture...
    An other question? :)

    Bye!
     
  8. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    Yep , I`ve download the source files and it is still only designed for I386 .
    I will have to work out to add ARM to the arc list . ( build.xml )
     

Share This Page