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.

SPI in omap4430 doesnt work under Android ICS

Hi, is just that i have no idea why the SPI is not working in OMAP4430 in Pandaboard running Android ICS with kernel 3.0.8, when i enable the SPIDEV and MCSPI drivers at the same time, the system never starts, it crashes immediately, i dont know if it is that there is a problem with the OMAP4430 for the support of SPI in Android ICS, i don't know why i cant enable both drivers at the same time, if someone could help me on this, it would be great, i am kind of desperate with this, please help. Thanks in advanced.

Best Regards.

  • Hi Michelle,

    Have you try following the instructions in this link? http://www.omappedia.org/wiki/PandaBoard_SPI

  • Hi, thanks for the reply, and yes, i did it already, and that's why i dont know what to do because when i enable SPIDEV and MCSPI drivers at the same time, the system crashes, i took the output of the serial port since i turn on the Pandaboard, and apparently the drivers are registered (SPIDEV and MCSPI) but then, the system doesn't find system binaries even when they are in the SD card, and this only happens if i have both drivers enabled, this is one of the errors that i got:

    [   10.959869] init: using deprecated syntax for specifying property 'sys.usb.config', use ${name} instead
    [   11.609436] init: cannot find '/system/bin/app_process', disabling 'zygote'
    [   12.131896] (stc): add_channel_to_table: id 2
    [   12.137237] (stc): st_register(3)
    [   12.142700] (stc): add_channel_to_table: id 3
    [   12.149658] (stc): st_register(4)
    [   12.153442] (stc): add_channel_to_table: id 4
    [   14.208160] (stc): remove_channel_from_table: id 2
    [   14.214263] (stc): remove_channel_from_table: id 3
    [   14.219970] (stc): remove_channel_from_table: id 4
    [   14.226684] (stc):  all chnl_ids unregistered
    [   14.226684] (stk) :ldisc_install = 0
    [   14.236724] (stc): st_tty_close
    [   14.240905] (stc): 2 not un-registered
    [   14.245361] (stc): 3 not un-registered
    [   14.249786] (stc): 4 not un-registered
    [   15.259155] init: cannot find '/system/bin/surfaceflinger', disabling 'surfaceflinger'
    [   15.268920] init: cannot find '/system/bin/drmserver', disabling 'drm'
    [   15.277008] init: cannot find '/system/bin/mediaserver', disabling 'media'
    [   15.285614] init: cannot find '/system/bin/uim-sysfs', disabling 'uim'
    z ls
    [   86.578033] init: cannot find '/system/bin/sh', disabling 'console'

    and then the system restarts and i never get to even get into the shell through the USB cable, it happens too fast, at the start of the previous result, what i got from the serial port,  i got this:

    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5
    RKšY®+5¡ª—šY®+5¡”éšY®+5

    and it happens for a long time, i could only see it with the serial port, because the USB is unaccessible.

    i don't know what could cause this or if there is an OMAP problem with those drivers regarding to Android ICS.

    Please help.

  • What release notes or instructions are you using?, it seems like an error I have seen when using incorrect init files, but I would like to know if you are using the same release notes first.

    Also, if you remove your changes your system works again?

  • Hi, this is the configuration that i'm using:

    in the board-omap4panda.c


    static const struct spi_board_info panda_spi[] __initconst = {
         {
                   .modalias = "spidev",
                   .bus_num = 1,
                   .chip_select = 0,
                   .max_speed_hz = 400000,
                   .mode = SPI_MODE_1,
         }
     };

     static void __init panda_spi_devices_init(void) {
          /* muxing pins might be only required if
           * you've connecting
           * device to CS other than CS0 */
          spi_register_board_info(panda_spi, ARRAY_SIZE(panda_spi));
     }



    and i'm calling  the panda_spi_devices_init();  function in omap4_panda_init(void).


    and this is the configuration in the kernel:

    CONFIG_SPI=y
    # CONFIG_SPI_DEBUG is not set
    CONFIG_SPI_MASTER=y

    #
    # SPI Master Controller Drivers
    #
    # CONFIG_SPI_ALTERA is not set
    CONFIG_SPI_BITBANG=y
    CONFIG_SPI_GPIO=y
    # CONFIG_SPI_OC_TINY is not set
    CONFIG_SPI_OMAP24XX=y
    # CONFIG_SPI_PXA2XX_PCI is not set
    # CONFIG_SPI_XILINX is not set
    # CONFIG_SPI_DESIGNWARE is not set

    #
    # SPI Protocol Masters
    #
    CONFIG_SPI_SPIDEV=y
    # CONFIG_SPI_TLE62X0 is not set

    #


    i even changed the bus_num to 5, someone said that someone else was using it, but anyway, i don't think the error is in this configurations, the problem is when the SPIDEV and the MCSPI are enabled together, i erased the configuration in the board-omap4panda.c and the problem was the same with the system, if i disable one of the drivers (SPIDEV or MCSPI) and i only enable one of them (i already checked with both), the system works, but the SPI doesnt, and if i keep both drivers enabled, the system crashes and the output in the serial port is the previous one, i think that the problem is by having both drivers enabled, the kernel that i'm using is the 3.0.8, and the android version is the Ice Cream Sandwich, and the problem is the i need specifically the SPI transmission from Pandaboard, i don't know what to do anymore, or what to test, or anything. please help.
  • Seems like the changes I made and are working (patch attached), can you try with the same speed I am setting?

    3465.0001-Testing-changes-for-SPI-issue.txt

  • Hi, thank you for the help, i'm going to try with the changes you made right now and i'll post the results in around 20 minutes.

    Best Regards.

  • Hi, i made the changes, and it got worst, now the x-loader hangs, i am going to attach the output of the serial port whit the previous configuration (the one that i sent  before but complete), and the output of the serial port with the configurations that you sent in the patch, something that i just saw, was an error that was about I2C read, i don't know if this would be related to the crash of the system when the SPIDEV and the MCSPI drivers are at the same time with the I2C or something like that, is just that from the patch, in the static int __init omap4_panda_i2c_init(void) function, in my board-omap4panda.c file, there is an initialization, and in the patch, it is returning 0, i am going to send you my board-omap4panda.c file for you to see that there is some kind of difference, maybe it is related too. 6102.before_the_patch.txt 4375.after_the_patch.txt 1423.board-omap4panda.c

    Best Regards.

  • Hi, i would like to ask you if you could please send me your SPIDEV (spidev.c) and MCSPI (omap2_mcspi.c) drivers and your board-omap4panda.c file, for me to make a diff and know if we have the same source codes or if we have different versions and my version has bugs or something like that. thanks in advanced.

    Best Regards.

  • It doesn't make sense to me that now is not working and is failing at xloader, because the changes are for kernel...

    Where did you get the kernel source code from?

    I am using ICE from the panda Notes +  the patch: http://omappedia.org/wiki/4AI.1.4_OMAP4_Icecream_Sandwich_Panda_Notes

  •    I got the kernel from the AOSP site at the Building Kernels section:

    $ git clone https://android.googlesource.com/kernel/omap.git


    could it be the kernel sources?


    Best Regards.
  • Well, there are some differences in the drivers/spi/spi.c and drivers/spi/omap2_spi.c files, and some more significant differences in omap platform related stuff. So for sure the differences in kernel have some impact on that.

    Have you tried to use the other kernel?, it might be better since is the one from TI. Because even when the one from google seems to be based in a more recent version of the Linux kernel, TI's has more stable the features of the omap and soon or later might be merged in Linux kernel main line.

  • Hi, i downloaded the other kernel, applied the patches and compiled it, i used the zImage to recompile Android ICS but when i plugged the SD card, the graphics didn't start, i took the output of the console using an USB cable, the file attached has the output, the most significant error is at the end, and it says:

    <3>[   16.739776] init: untracked pid 167 exited
    <3>[   21.919616] init: untracked pid 188 exited
    <3>[   27.064117] init: untracked pid 211 exited
    <3>[   27.205444] init: untracked pid 226 exited
    <3>[   31.352142] init: untracked pid 256 exited
    <3>[   31.357025] init: untracked pid 297 exited
    <3>[   36.489410] init: untracked pid 327 exited
    <3>[   36.493988] init: untracked pid 356 exited

    0676.console_output_with_ti_kernel.txt

    Best Regards.

  • That is because the graphics drivers are not compiled in the kernel image, those have to be compiled as modules, look at the section "Building SGX driver" in the wiki. Also you can try enabling it as driver in the image instead of module.

  • Hi, i would like to know if you used an updated Ducati for Pandaboard under Ice Cream Sandwich?

  • In the wiki is a link to download a ducati binary that should work.

    Was the issue about SPI solved?