2010-01-27 15:57:56     u-boot 2009r1-rc3 bf537 & m25p64 SPI

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2010-01-27 15:57:56     u-boot 2009r1-rc3 bf537 & m25p64 SPI

Adrien Cottenceau (CANADA)

Message: 85210   

 

I have a custom board based on the blackfin bf537-stamp board.

 

I try to use a m25p64/128 spi dataflash on CSS1 with u-boot 2009r1-rc3.

 

I occure some problems with it. I can probe the dataflash, and write to it, but reading from the spi flash seems to have some problem. In fact, I don't know if the problem is the write or the read command but data desn't seems to be modified by the write command.

 

I have enabled some debug message:

 

 

 

bfin> sf probe 1

bus: 0, cd: 1, hz: 20000000, mode: 3

spi_setup_slave: bus:0 cs:1 mmr:ffc00500 ctl:5c01 baud:2 flg:0

spi_xfer: bus:0 cs:1 bitlen:8 bytes:1 flags:1

spi_xfer: tx:9f rx:ff

spi_xfer: bus:0 cs:1 bitlen:24 bytes:3 flags:2

spi_xfer: tx:0 rx:20

spi_xfer: tx:0 rx:20

spi_xfer: tx:0 rx:17

SF: Got idcode 20 20 17

SF: Got idcode 20 20 17

spi_xfer: bus:0 cs:1 bitlen:8 bytes:1 flags:1

spi_xfer: tx:9f rx:ff

spi_xfer: bus:0 cs:1 bitlen:24 bytes:3 flags:2

spi_xfer: tx:0 rx:20

spi_xfer: tx:0 rx:20

spi_xfer: tx:0 rx:17

SF: Detected M25P64 with page size 256, total 8388608 bytes

SF: STMICRO_FLASH

8192 KiB M25P64 at 0:1 is now current device

 

bfin> sf write 0x1000000 0 10

PP: 0x01000000 => cmd = { 0x02 0x000000 } chunk_len = 16

spi_xfer: bus:0 cs:1 bitlen:8 bytes:1 flags:3

spi_xfer: tx:6 rx:ff

spi_xfer: bus:0 cs:1 bitlen:32 bytes:4 flags:1

spi_xfer: tx:2 rx:ff

spi_xfer: tx:0 rx:ff

spi_xfer: tx:0 rx:ff

spi_xfer: tx:0 rx:ff

spi_xfer: bus:0 cs:1 bitlen:128 bytes:16 flags:2

spi_xfer: tx:e rx:ff

spi_xfer: tx:e1 rx:ff

spi_xfer: tx:ec rx:ff

spi_xfer: tx:f rx:ff

spi_xfer: tx:4e rx:ff

spi_xfer: tx:e1 rx:ff

spi_xfer: tx:b0 rx:ff

spi_xfer: tx:ff rx:ff

spi_xfer: tx:90 rx:ff

spi_xfer: tx:61 rx:ff

spi_xfer: tx:10 rx:ff

spi_xfer: tx:3e rx:ff

spi_xfer: tx:1 rx:ff

spi_xfer: tx:60 rx:ff

spi_xfer: tx:21 rx:ff

spi_xfer: tx:36 rx:ff

spi_xfer: bus:0 cs:1 bitlen:8 bytes:1 flags:1

spi_xfer: tx:5 rx:ff

spi_xfer: bus:0 cs:1 bitlen:8 bytes:1 flags:0

spi_xfer: tx:0 rx:0

spi_xfer: bus:0 cs:1 bitlen:0 bytes:0 flags:2

SF: STMicro: Successfully programmed 16 bytes @ 0x0

 

 

bfin> sf read 0x10e0000 0 10

spi_xfer: bus:0 cs:1 bitlen:40 bytes:5 flags:1

spi_xfer: tx:b rx:ff

spi_xfer: tx:0 rx:ff

spi_xfer: tx:0 rx:ff

spi_xfer: tx:0 rx:ff

spi_xfer: tx:0 rx:ff

spi_xfer: bus:0 cs:1 bitlen:128 bytes:16 flags:2

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:a0

spi_xfer: tx:0 rx:f

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:0

spi_xfer: tx:0 rx:21

spi_xfer: tx:0 rx:0

 

bfin>

 

May be someone can help me to find were i'm wrong?

 

 

 

Adrien.

QuoteReplyEditDelete

 

 

2010-01-27 21:39:03     Re: u-boot 2009r1-rc3 bf537 & m25p64 SPI

Mike Frysinger (UNITED STATES)

Message: 85212   

 

there have been a few spi fixes in 2009R1.1, but i dont think they'll make a difference here

 

do you have a scope ?  might want to make sure the things the being written in software are being transmitted that way.

 

have you tested the SPI at all before ?  do you have all the right pull ups on the SPI lines ?

QuoteReplyEditDelete

 

 

2010-01-28 11:05:33     Re: u-boot 2009r1-rc3 bf537 & m25p64 SPI

Adrien Cottenceau (CANADA)

Message: 85264   

 

Mike,

 

I have a scope, i will try later to see if transmitions are ok with the sf commands.

 

I think all pull-ups and pull-down are ok, because u-boot can detect the SPI flash product ID.

 

Something weird: I have tried with the eeprom read/write commands, and it has worked!

 

I'm able to read/write to the m25p64 correctly with the eeprom commands. But I cannot use the sf commands as mentioned in this post:

 

http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:serial-flash

 

 

 

Anyway, I can boot the Blackfin on SPI mode, that's the most important for me.

 

But now, i'm facing the same problem as Kevin Dimmer with the environment on SPI flash:

 

https://blackfin.uclinux.org/gf/project/u-boot/forum/?_forum_action=ForumMessageBrowse&thread_id=37428&action=ForumBrowse&forum_id=51

 

Hoping this will be solved soon...

 

 

 

Adrien.

QuoteReplyEditDelete

 

 

2010-01-28 21:20:47     Re: u-boot 2009r1-rc3 bf537 & m25p64 SPI

Mike Frysinger (UNITED STATES)

Message: 85271   

 

did you erase the sector first then ?  you know that SPI flashes are "normal" in that you cant write to something without erasing it first.

Attachments

    Outcomes