How to read and write to EEPROM using spi interface in imx6ulevk

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to read and write to EEPROM using spi interface in imx6ulevk

1,066 Views
nagaprasadvasam
Contributor III

Hi  Everyone,

         I need the procedure write to eeprom using spi interface, i edited device tree file for enabling ecspi4 in imx6ul.i have followed link provided by community as below.

   https://community.nxp.com/thread/380304

but my log message shows an error as...

fsl-quadspi 21e0000.qspi: n25q256a (32768 Kbytes)
spi_gpio spi4: gpio-miso property not found, switching to no-rx mode
spidev spi3.0: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/spi/spidev.c:757 spidev_probe+0x1a4/0x1d4
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.88+g5e23f9d #14
Hardware name: Freescale i.MX6 UltraLite (Device Tree)
[<8010ecb4>] (unwind_backtrace) from [<8010b394>] (show_stack+0x10/0x14)
[<8010b394>] (show_stack) from [<803c0c4c>] (dump_stack+0x78/0x8c)
[<803c0c4c>] (dump_stack) from [<8012d33c>] (__warn+0xe8/0x100)
[<8012d33c>] (__warn) from [<8012d404>] (warn_slowpath_null+0x20/0x28)
[<8012d404>] (warn_slowpath_null) from [<805738b4>] (spidev_probe+0x1a4/0x1d4)
[<805738b4>] (spidev_probe) from [<80570b30>] (spi_drv_probe+0x7c/0xa8)
[<80570b30>] (spi_drv_probe) from [<804ce99c>] (driver_probe_device+0x1cc/0x2b8)
[<804ce99c>] (driver_probe_device) from [<804ccf94>] (bus_for_each_drv+0x44/0x94)
[<804ccf94>] (bus_for_each_drv) from [<804ce6f0>] (__device_attach+0xb0/0x114)
[<804ce6f0>] (__device_attach) from [<804cdd8c>] (bus_probe_device+0x84/0x8c)
[<804cdd8c>] (bus_probe_device) from [<804cc0f0>] (device_add+0x39c/0x590)
[<804cc0f0>] (device_add) from [<80571a88>] (spi_add_device+0xc8/0x12c)
[<80571a88>] (spi_add_device) from [<805721d8>] (spi_register_master+0x470/0x760)
[<805721d8>] (spi_register_master) from [<80574a94>] (spi_bitbang_start+0xb8/0x124)
[<80574a94>] (spi_bitbang_start) from [<8057764c>] (spi_imx_probe+0x360/0x5a0)
[<8057764c>] (spi_imx_probe) from [<804d0290>] (platform_drv_probe+0x50/0xac)
[<804d0290>] (platform_drv_probe) from [<804ce99c>] (driver_probe_device+0x1cc/0x2b8)
[<804ce99c>] (driver_probe_device) from [<804ceb2c>] (__driver_attach+0xa4/0xa8)
[<804ceb2c>] (__driver_attach) from [<804cceec>] (bus_for_each_dev+0x4c/0x9c)
[<804cceec>] (bus_for_each_dev) from [<804ce02c>] (bus_add_driver+0x188/0x20c)
[<804ce02c>] (bus_add_driver) from [<804cf3b8>] (driver_register+0x78/0xf4)
[<804cf3b8>] (driver_register) from [<801017dc>] (do_one_initcall+0x44/0x170)
[<801017dc>] (do_one_initcall) from [<80e00da4>] (kernel_init_freeable+0x158/0x1e4)
[<80e00da4>] (kernel_init_freeable) from [<809ea538>] (kernel_init+0x8/0x110)
[<809ea538>] (kernel_init) from [<80107950>] (ret_from_fork+0x14/0x24)
---[ end trace ccf64a2020ab6b6f ]---
spi_imx 2014000.ecspi: No CS GPIOs available
spi_imx: probe of 2014000.ecspi failed with error -22

How to over come from this error,can anyone help me regarding this issue.

Thanks&Regards,

Prasad.

Labels (4)
0 Kudos
1 Reply

793 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello nagaprasad,

The CS is configured by MX6QDL_PAD_KEY_ROW1__ECSPI1_SS0 When reading back the content of IOMUXC_SW_MUX_CTL_PAD_KEY_ROW1 by “.
/memtool 32 0x20E0204 1” I get 0, which acc. to the reference manual corresponds
 to mux_mode ALT0 - Select signal ECSPI1_SS0..
I wonder if you are able to see at least the assertion of SS signal.  Also from the dts examples, the ecspi pins have the next configuration:                  pinctrl_ecspi1: ecspi1grp {                         fsl,pins = <                                 MX6QDL_PAD_KEY_COL1__ECSPI1_MISO        0x100b1                                 MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI        0x100b1                                 MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK        0x100b1                         >;                 };
please look at similar issue on community https://community.nxp.com/thread/447204
0 Kudos