This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding i2c support in x-loader

Hi,

I added i2c support in x-loader by copying omap24xx_i2c.c into driver directory.

While compiling i2c,it gives error as:

arm-none-linux-gnueabi-ld: error: Source object /home/rajee/toolchain/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_divsi3.o) has EABI version 5, but target x-load has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file /home/rajee/toolchain/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_divsi3.o)
arm-none-linux-gnueabi-ld: error: Source object /home/rajee/toolchain/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_dvmd_lnx.o) has EABI version 5, but target x-load has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file /home/rajee/toolchain/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_dvmd_lnx.o)
/home/rajee/toolchain/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_dvmd_lnx.o): In function `__aeabi_ldiv0':
(.text+0x8): undefined reference to `raise'
make: *** [x-load] Error 1

I tried with different toolchains,but the same thing is happening.

Please help me on this.Thanks in advance.

Regards,

RajeeSankar

  • Hi,

    This issue got resolved by editing -lgcc as -lgcc_eh in Makefile.

    Now my x-loader source compiled properly.But I can't read or write into i2c lines.

    i2c_init also not working.I added the following lines to set i2c clocks.After that also i2c_init not working.

    sr32(CM_FCLKEN1_CORE, 15, 3, 0x7);
    sr32(CM_ICLKEN1_CORE, 15, 3, 0x7);
    i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
    
    
    Please help me guys.Thanks.
    Regards,
    RajeeSankar
  • Hi RajeeSankar

    I am also not able do i2c read and write from X-loader

    and i2c_init fails with the below error

    ERROR: Timeout while waiting for soft-reset to complete

    Any idea is it because of timing or configuration the above error happened

    Thanks

    Kavitha

  • Hi Rajeesankar,

    make[1]: Leaving directory `/home/ladstech/santosh_vastrad/source_code_android/android/x-loader/drivers'
    UNDEF_SYM=`/home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-objdump -x board/omap3beagle/libomap3beagle.a cpu/omap3/libomap3.a lib/libarm.a fs/fat/libfat.a disk/libdisk.a drivers/libdrivers.a |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
             /home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-ld -Bstatic -T /home/ladstech/santosh_vastrad/source_code_android/android/x-loader/board/omap3beagle/x-load.lds -Ttext 0x40200800  $UNDEF_SYM cpu/omap3/start.o \
                --start-group board/omap3beagle/libomap3beagle.a cpu/omap3/libomap3.a lib/libarm.a fs/fat/libfat.a disk/libdisk.a drivers/libdrivers.a --end-group -L /home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0 -lgcc_eh  \
                -Map x-load.map -o x-load
    /home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-ld: cannot find -lgcc_eh
    make: *** [x-load] Error 1
    l

    I got above error, when added i2c configuration support in x-loader,

    Even i tried by changing in Makefile, lgcc by lgcc_eh

    still not compiling,

    And you got succeeded by adding i2c support?

    Regards,

    santosh vastrad

  • HI Kavitha,

    May be base address of the I2C may be wrong?

    According to which i2c bus you are using give base addreses!!!!!!!!

    Regards ,

    santosh vastrad

  • Hi Santhosh,

    Try with different toolchain. I tried to compile by arm-none-linux-gnueabi toolchain.. u-boot build worked for me.

    Regards,

    RajeeSankar

  • Hi Rajeeshankar,

    No not success, tried with other toolchain also!!!!!!!!!!!!!!!

    you implemented and succeeded in x-loader right!

    But you said u-boot built,,,,,,,,,,,,,,,  I didn't get?

    Regards,

    santosh vastrad

  • Hi Santosh,

    Sorry sorry typo error. X-load compilation worked for me.

    Regards,

    RajeeSankar

  • Hi,

    make[1]: Leaving directory `/home/ladstech/santosh_vastrad/source_code_android/android/x-loader/drivers'
    UNDEF_SYM=`/home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-objdump -x board/omap3beagle/libomap3beagle.a cpu/omap3/libomap3.a lib/libarm.a fs/fat/libfat.a disk/libdisk.a drivers/libdrivers.a |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
             /home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-ld -Bstatic -T /home/ladstech/santosh_vastrad/source_code_android/android/x-loader/board/omap3beagle/x-load.lds -Ttext 0x40200800  $UNDEF_SYM cpu/omap3/start.o \
                --start-group board/omap3beagle/libomap3beagle.a cpu/omap3/libomap3.a lib/libarm.a fs/fat/libfat.a disk/libdisk.a drivers/libdrivers.a --end-group -L /home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0 -lgcc_eh \
                -Map x-load.map -o x-load
    /home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-ld: cannot find -lgcc_eh

    Like this  it came, when added lgcc_eh in makefile!!!!!!!!!!

    Regards,

    santosh vastrad

  • Hi Rajeesankar,

    The issue is solved,

    We should remove division experssions from the i2c_function ,

    then it will work okay

    Regards,

    santosh vastrad

  • Gud findings Santosh. congrats.