S12P Dataflash writing problem

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

S12P Dataflash writing problem

512 Views
nands
Contributor I

Dear All,

 

I've written driver for Dataflash writing. It is working for 127 bytes (first sector) and not for other sectors. I'm erasing whole (4096 bytes) dataflash before writing data into it.

 

I'm writing DFlash using PROGRAM_D_FLASH (0x11) command for single word only (not using burst sequence).

 

How to change sector while programming it?

 

-- NKG

Labels (1)
0 Kudos
2 Replies

332 Views
nands
Contributor I

Sorry...sector size is 256 byte (127 words).

 

Any suggestion or help?

 

--- NKG

0 Kudos

332 Views
stephenmcginty
NXP Employee
NXP Employee

Hey NKG,

There really should be nothing special about writing to the second sector or any others vs. the first sector - incrementing the address field is all that is required.

I wonder if the problem is that your driver updates the address field only when trying to transition to the 2nd sector and leaves the CCOBIX set to 1?

Note that it must be set to between 2 and 5 which would happen naturally when you write address -> data, but if you were only writing the address then it might not.

Note also that the LSB of the address must always be 0, could you be adding 1 to the address to try and move to the next sector?

Not sure if that helps but if you can provide some more details I can help more - particularly the value of the FSTAT reg after a failed attempt to write sector 2.

Cheers,

Stephen