Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Can't write more than one byte to the SST39SF010A Flash!

Status
Not open for further replies.

3Deye

Full Member level 2
Joined
Oct 7, 2009
Messages
125
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
EG
Activity points
2,159
I use code composer to program the TMS320C31 DSP (through MPSD) to write to the **broken link removed**flash. I can successfully write one byte to any location of the flash by following the "Chip Erase" then "Byte-Program Algorithm" sequences mentioned in the datasheet.

The problem is when I want to write more than one byte in different locations, only the first byte is written and the rest aren't. I added delays between writes but no difference.

What is the cause of this problem? I searched for drivers (Programming algorithms) for this flash but couldn't find!
 

More details:

First:

This is the code we wrote to program the flash:

void main()

{

volatile unsigned int * start_flash = (volatile unsigned int *)0x00001000;
volatile unsigned int * end_flash = (volatile unsigned int *)0x0001ffff;

volatile unsigned char * flash_addr1 = (volatile unsigned char *)0x005555;
volatile unsigned char * flash_addr2 = (volatile unsigned char *)0x002aaa;
volatile unsigned char * flash_addr3 = (volatile unsigned char *)0x005555;
volatile unsigned char * flash_addr4 = (volatile unsigned char *)0x010000;

volatile unsigned int x = 0;

// Chip Erase

* flash_addr1 = 0xaa;
* flash_addr2 = 0x55;
* flash_addr1 = 0x80;
* flash_addr1 = 0xaa;
* flash_addr2 = 0x55;
* flash_addr1 = 0x10;

// Delay
for(x=0;x<=100000;x++);

// Byte Program

* flash_addr1 = 0xaa;
* flash_addr2 = 0x55;
* flash_addr3 = 0xa0;

// Data in the first address

* (start_flash) = 0xba;

for(x=0;x<=100000;x++);

// Data in the following address

* (start_flash+1) = 0xab;

while(1);

}

"BA" is written correctly in the first address but "AB" isn't.

Second:

We are using an FPGA in the system between the DSP and the Flash (and all other system peripherals). Data and Address of DSP is bypassed to the Flash, and control signals are generated from the FPGA. I think there is no problem in generating the control signals since we are able to write one byte successfully, is that correct?
 
Last edited:

Can you explain this?

volatile unsigned char * flash_addr1 = (volatile unsigned char *)0x005555;

You are declaring flash_addr1 as a pointer to a volatile unsigned char type and then you are assigning another pointer to it. You should assign address of a voltile unsigned char type variable to it.
 

Problem solved and I would like to share the solution:

Software Data Protection

This feature is available on some flashes that requires a software sequence at the beginning of each write cycle in order for a write to be performed. To enable the software data protection feature, a series of three-write commands to specific addresses with specific data must be performed. Once set, the same 3-byte code must begin each write request. This feature is permanently enabled in the flash I'm using.

So the solution is to add the following commands before any byte write operation not only the first one:

* flash_addr1 = 0xaa;
* flash_addr2 = 0x55;
* flash_addr3 = 0xa0;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top