SPI NOR FLASH Problem on the iMX6SL MCIMX6SLEVK

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

SPI NOR FLASH Problem on the iMX6SL MCIMX6SLEVK

Jump to solution
3,750 Views
nathanpalmer
Contributor IV

I have the MCIMX6SLEVK eval board and I am having problems with the on-board SPI NOR.  I have tried to probe for the device using the latest U-BOOT built for the EVK and also with the Freescale SDK imx6_platform_sdk_v1.1.0.  Both of these fail to read from the device.  I just wanted to ask if anyone has gotten the SPI NOR FLASH to work on the MCIMX6SLEVK.  The board is REV B, although I don't think that matters from looking at the change log. 

Also, is there a public repo to get updates for the Freescale i.MX6 SDK?

Labels (2)
0 Kudos
1 Solution
1,338 Views
fabio_estevam
NXP Employee
NXP Employee

Nathan,

I have just submitted this patch which fixed the spi nor probe:

http://lists.denx.de/pipermail/u-boot/2014-April/177351.html

Regards,

Fabio Estevam

View solution in original post

0 Kudos
11 Replies
1,338 Views
fabio_estevam
NXP Employee
NXP Employee

Can you post the changes you did in patch format to add support for the SPI NOR in U-boot?

Regards,

Fabio Estevam

0 Kudos
1,338 Views
nathanpalmer
Contributor IV

I used the latest version of u-boot from :

git://git.denx.de/u-boot.git

And applied the attached patch.

0 Kudos
1,338 Views
fabio_estevam
NXP Employee
NXP Employee

Your CONFIG_SF_DEFAULT_CS configuration does not look correct.

For reference, take a look at:

commit 8bfa9c692e024bcf2b0b95be33adfa710301f83f

Author: Fabio Estevam <fabio.estevam@freescale.com>

Date:   Fri Nov 8 16:20:54 2013 -0200

    mx6sabresd: Add SPI NOR support

   

    mx6sabre board has a m25p32 SPI NOR connected to ECSPI1 port.

   

    Add support for it.

   

    This patch allows the SPI NOR flash to be succesfully detected:

   

    => sf probe

    SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB

   

    Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

0 Kudos
1,338 Views
nathanpalmer
Contributor IV

Ah, I see that the CS is not JUST the chip select, it is an encoded GPIO value to enable long holds for the CS pin.  I have made the change:

#define CONFIG_SF_DEFAULT_CS        (0 | (IMX_GPIO_NR(4, 11) << 8))

However, it still does not work.  I wonder if there is some initialization I missed?  Also, is it strange that the SDK doesn't work either?

0 Kudos
1,338 Views
fabio_estevam
NXP Employee
NXP Employee

I have tried the following patch:

http://pastebin.com/hamK7Ybb

and it fails to probe the SPI NOR:

=> sf probe                                                               
SF: Unsupported flash IDs: manuf 00, jedec 0000, ext_jedec 0000           

Failed to initialize SPI flash at 0:27392

I would recommend to start a thread at the U-boot list and post the patch as reference for the discussion.

If I launch the kernel, then the SPI NOR flash is correctly probed.

0 Kudos
1,338 Views
nathanpalmer
Contributor IV

Thanks for the help.  I submitted an email to the u-boot mailing list. let me know if you think of anything else to try.

0 Kudos
1,339 Views
fabio_estevam
NXP Employee
NXP Employee

Nathan,

I have just submitted this patch which fixed the spi nor probe:

http://lists.denx.de/pipermail/u-boot/2014-April/177351.html

Regards,

Fabio Estevam

0 Kudos
1,338 Views
nathanpalmer
Contributor IV

That did the trick, Thanks!  I got u-boot booting from SPI FLASH.  The only other gotcha I had was having to offset the image to 0x400 in the SPI FLASH, is that in the documentation somewhere? I just saw that I had to do that on some random forum.

0 Kudos
1,338 Views
fabio_estevam
NXP Employee
NXP Employee

Yes, the required offset is described in the reference manual.

0 Kudos
1,338 Views
fabio_estevam
NXP Employee
NXP Employee

Ok, great. I will monitor your thread in the U-boot list then.

0 Kudos
1,338 Views
fabio_estevam
NXP Employee
NXP Employee

Nathan,

Are you able to check the SPI signals via an oscilloscope? Do you see activity in the MISO/MOSI/CLK and CS lines?

0 Kudos