Thread (44 messages) 44 messages, 12 authors, 2009-11-01

RE: Accessing flash directly from User Space

From: Jonathan Haws <hidden>
Date: 2009-10-29 16:48:23

On Tue, Oct 27, 2009 at 04:52:40PM -0600, Jonathan Haws wrote:
quoted
quoted
Will the device respond to 0x1234 being written at offset zero?
You
quoted
quoted
generally have to poke these things pretty specifically in order
to
quoted
quoted
get
them to go into command mode.
It should because that is the first data location in flash.
=20
I don't follow.  Even if you have an Intel command set flash (and
thus don't
need unlock writes), 0x1234 isn't a valid command that I know of.
The flash
doesn't behave as a register that you can read back; it just
responds in a
certain way based on what you write to it.
=20
quoted
Also, just to be sure I am telling the truth, I tried writing to
one of
quoted
the registers to setup an erase and got the same results - the
value did
quoted
not get written.
=20
Following the exact sequence that the driver uses?  What did you
write, what
did you expect (you're generally not going to get the same thing
back that
you wrote), and what did you get?  What kind of command set, bus
width, and
interleaving do you have?
I used the erase pattern, then write pattern for my flash device.  When I t=
ried to read back the value that should have been stored, it was what it wa=
s previously.
=20
If you manually do the same exact accesses from a firmware prompt,
external
debugger, etc. does it work?
=20
quoted
quoted
quoted
The driver works perfectly in VxWorks,
=20
On this exact hardware?
Yes.
quoted
quoted
Including the 0x1234 thing?
Actually, I have not tried that - I have not had to since the
driver worked.
=20
What happens without the 0x1234?
Have not bothered to try it.  My guess, after finding out what the problem =
is that it would not read back 0x1234.  In the test I performed, I intended=
 to erase the sector, prep it for write, then write out 0x1234 to the first=
 two bytes in flash.  However, I failed in include the code to erase and pr=
ep the sector for writing in my rush to find out what the heck was going on=
.

As I mentioned previously, I was just not allowing the correct sequence of =
operations to take place to erase the sector (that is where my problem bega=
n) because when I setup the sector for erasure, the sequencing did not take=
 place correctly because what I would assign to flash was not committed imm=
ediately.

I hope that makes sense.

Thanks,

Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help