i.MX6S with U-Boot and SPI-Flash

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

i.MX6S with U-Boot and SPI-Flash

1,000 Views
steffendoster
Contributor IV

Hi,

I want to user a STMicro M25PX16 SPI-NOR-Flash with U-Boot (2015.01) on my i.MX6S.

I also want to use the U-Boot to write to this flash to update itself if there is an newer u-boot image available via TFTP.

But my main problem at this time:

To write to the Flash with a command like
mw.b 0x10800000 0xFF 0x80000;tftp 0x10800000 u-boot.bin;sf probe 3:2;sf erase 0x0 0x80000;sf write 0x10800000 0x0 0x80000

I have to do
sf probe
first. This should initialize the flashBut this doesn't work. I messured the SPI-Signals to the SPI-Flash and got this:
SCRN0185.BMP

Orange: Chip select

Magenta: Clock

Cyan: MOSI

Green: MISO

So it seems that the Flash really doesn't respond.

But otherwise I did an alternative Test with

sspi 3:0.0 32 9F

and got this:

SCRN0184.BMP

The correct response was 00207115 (ID for the specific Flash).

I checked the command. On both it is 0x9F, the command to read out the ID-Register.

I derived my Board-C and -H file from sabresd. Here are some configs related to SPI and Flash:
C-File:

#define SPI_PAD_CTRL ( \
PAD_CTL_HYS |\
PAD_CTL_SPEED_MED |\
PAD_CTL_DSE_40ohm |\
PAD_CTL_SRE_FAST)

static iomux_v3_cfg_t const ecspi4_pads[] = {
MX6_PAD_EIM_D21__ECSPI4_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_D28__ECSPI4_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_D22__ECSPI4_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_EIM_A25__ECSPI4_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL),
MX6_PAD_EIM_D20__ECSPI4_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL),
};

H-File:
#define CONFIG_CMD_SF
#define CONFIG_CMD_SPI
#ifdef CONFIG_CMD_SF
#define CONFIG_SPI_FLASH
#define CONFIG_SPI_FLASH_STMICRO
#define CONFIG_MXC_SPI
#define CONFIG_SF_DEFAULT_BUS 3
#define CONFIG_SF_DEFAULT_CS 0
#define CONFIG_SF_DEFAULT_SPEED 1000000
#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
#endif

Why does sf probe interrupts the chip-select? Is someone out there who had the same problem? Any suggestions?

Labels (3)
0 Kudos
2 Replies

561 Views
steffendoster
Contributor IV

I already posted the IOMUX-config, but here you have a sample from our schematic.Flash_Schematic.bmp

0 Kudos

561 Views
jimmychan
NXP TechSupport
NXP TechSupport

how you connect the flash?

0 Kudos