logo

Could not compile stylesheet for simplistic. Using last compiled stylesheet.

/dev/spidev2.0 issue with Igep COM ELECTRON board

posted in IGEP COM MODULE
Thursday, February 21 2013, 07:13 PM
0
Hi
I met an issue with the spidev2.0 on the ELECTRON COM MODULE.
In the igep.ini file, when the machineID is equal to 2717, the spidev2.0 driver does not appear in the /dev directory. Then if you take a look at the board-igep0030.c in the kernel source file (2.6.37.5 version), the SPI is not defined.
Am i correct or not? if yes, how can i modify this board-igep0030.c file to be able to use the SPI?
thanks for your help
regards
julien

Accepted Answer

Friday, February 22 2013, 09:03 AM - #permalink
0
Hi jherbert,

By default these pins are not configured as spi beacause had multiple configuration options, so yes, you should modify the board-igep0030.c or better add an exp-yourexpansion.c (see http://labs.isee.biz/index.php/Linux_Ke ... ion_Boards)

Basically you should add new spidev struct,

static struct spi_board_info board_spidev_board_info __initdata = {
         .modalias       = "spidev",
         .bus_num        = 2,
         .chip_select    = 0,
         .max_speed_hz   = 20000000,
         .mode           = SPI_MODE_2,
};


and register the spi when the board initializes

spi_register_board_info(&board_spidev_board_info, 1)


Also this article can help you:

http://labs.isee.biz/index.php/How_to_use_SPI

Hope it helps you.
The reply is currently minimized Show
Responses (6)
  • Accepted Answer

    Monday, March 04 2013, 06:43 PM - #permalink
    0
    hi eballetbo

    thanks for your reply ; i was out of the office that's the reason why i answer now.
    i created an expansion board as you proposed (see attachment derived from base0010.c). i only use the spi and a lcd display.
    Now the driver spidev2.0 appears in the /dev directory.
    I want the ELECTRON board as a master device on the spi bus and the electron board must manage the CS0 signal.
    The spi is not working ; no signals appears at the output of the IGEP board.
    IS there something to declare about GPIOs? Input /Output...
    Did i forget something else?
    thanks in advance
    julien
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, March 05 2013, 08:30 AM - #permalink
    0
    Note that you're muxing spi1 not spi2
    OMAP3_MUX(MCSPI1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
    OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
    OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
    OMAP3_MUX(MCSPI1_CS0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
    


    The correct mux should be something like this:
    OMAP3_MUX(MCSPI2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
    OMAP3_MUX(MCSPI2_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
    OMAP3_MUX(MCSPI2_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
    OMAP3_MUX(MCSPI2_CS0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
    


    See that CLK is configured as INPUT, this is better and more generic as when you configure pin as INPUT can work as a INPUT and OUTPUT.

    Hope it helps.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, March 05 2013, 03:50 PM - #permalink
    0
    HI eballetbo thank you very much now it's working. However if i use the bus_num=2 and the mcspi2 it does not work. The spi is working only with bus_num=1 and mcspi1 !! if you have any idea it would be interesting. anyway thanks a lot julien
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 06 2013, 08:14 AM - #permalink
    0
    Which pins of the J1 or J4, are you using ?
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 06 2013, 08:28 AM - #permalink
    0
    Here are the pins i use

    CS J4:27
    SIMO J4:44
    SOMI J4:45
    CLK J4:43

    rgds
    jhebert
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, March 07 2013, 08:31 AM - #permalink
    0
    Sorry I did a mistake.

    These pins are connected to the MCSPI1 bus, so as you observed, the device only will work with bus_num=1 (mcspi)

    As you can see in IGEP COM Hardware Reference Manual the MCSPI2 bus is not available in J1-J4 connectors. So the correct way to do is mux mcspi1 pins and use /dev/spidev1.0 device.
    The reply is currently minimized Show
Your Reply

SUPPORT


This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
IGEP Community Wiki
IGEP Community Forum
IGEP Community Online Chat