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.

Using I2C in X-Loader

Other Parts Discussed in Thread: AM3517

This is a long shot but I thought best to try: Has anyone ever used I2C on the AM3517 from X-loader? I'm using both the AM35x-OMAP35x-PSP 03.00.01.06 and the AM35x-OMAP35x-PSP 04.02.00.07. In both cases, the code for x-loader has header file defines for the I2C registers but doesn't access them. Has anyone ever tried using the I2C modules on the AM3517 before the jump to U-boot?

 

I'm attempting to get access to a temperature sensor over I2C during the boot process to resolve a temperature issue with NAND.

 

Thanks,

Jemiah

.

  • Jemiah,

    I2C is not implemented and supported in x-loader in any of the PSP releases. The header file (i2c.h) is not getting used anywhere, you can say that it's stale code.

    Coming back to I2C support in X-loader, it should be pretty easy to achieve, since X-loader is stripped version of u-boot. So for you it should be straight forward to port I2C code to x-loader.

    Thanks,

    Vaibhav

  • Thanks Vaibhav.  It turns out that the thermal issue that I thought was attributed to the flash was actually a known issue with the SDRAM. The jury is still out on if it's something that can be compensated for. If it is then I'll go the route you suggest and port the I2C driver from u-boot into x-loader. The end goal would be to adjust what will most likely be a timing issue so that the SOM can boot without getting ECC errors and then revert the settings once the board has warmed up (self-heated).


    Thanks,
    Jemiah

    .


  • Hi Vaibhav,

    I have added i2c support in x-loasder,

    But while compilling , i got an error , given below!

    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 \
                -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: ERROR: Source object /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/libgcc.a(_divsi3.o) has EABI version 5, but target x-load has EABI version 0
    /home/ladstech/santosh_vastrad/source_code_android/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-ld: failed to merge target specific data of file /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/libgcc.a(_divsi3.o)
    make: *** [x-load] Error 1

    Please help me in resolving this?

    Regards,

    santosh vastrad

  • Hi

    I am writing a code to access a peripheral through the i2c protocol in  the OMAP AM3517 processor . The drivers are present but i am unable to open the device with the 

    "/dev/i2c-2"  as there is no entry of i2c-2 in the /dev .More over i see the i2c-2 driver at the location /sys/class/i2c adapter/i2c -2. 

    How can I access the i2c device to read and write ?

    Regards

    Karan

  • Karan:

    Check in kernel configuration, whether  i2c  is configured,

    then only you will see in /dev path. After booting.

    Regards,

    santosh vastrad

  • Hi Santosh

    Thanks for your reply, I found that it was disabled in the kernel menuconfig. When I enabled it I got what I needed .Thanks for your advice .