AnsweredAssumed Answered

i.MX6S with U-Boot and SPI-Flash

Question asked by Steffen Doster on Apr 28, 2017
Latest reply on May 8, 2017 by Steffen Doster

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:

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:

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?

Outcomes