cancel
Showing results for 
Search instead for 
Did you mean: 

ST10F276 XFLASH/IFLASH Programming Difficulties

tscott
Associate II
Posted on December 02, 2003 at 11:43

ST10F276 XFLASH/IFLASH Programming Difficulties

4 REPLIES 4
tscott
Associate II
Posted on November 07, 2003 at 10:31

I'm going to be contacting an FAE hopefully sometime soon, but thought I'd post the question here as well. Is there any sort of 'trick' to programm XFLASH/IFLASH?

We have developed our own boot strap loader tool and I am working on the level 2 loader for programming. Although it appears that I am erasing FLASH correctly (I see the completion take longer when erasing more sectors), I can't seem to program any bytes. I've even tried using the Write Operation Examples verbatim (both 32-bit and 64-bit variations) in section 9.6 of the Data Sheet to no avail

Here's the order of operations I perform:

1) Disable XPEN in SYSCON

2) Setup XPERCON to enable XRAM1, XRAM2, XFLASH (0x2C)

3) Enable XPEN in SYSCON

4) Attempt to program via the FLASH control registers.

5) Monitor FCR0H's WPG or DWPG bits. When clear, continue.

6) Verify that bytes were programmed correctly.

When I check the bytes that were programmed, they are always 0xFF.

Thanks in advance.

--tim

tscott
Associate II
Posted on November 07, 2003 at 14:27

After some experimenting, I guess I can answer my own question. It turns out that there needs to be a delay between the time you set the FLASH registers to the time you start monitoring for the write operation to complete. My code went something like:

set FCR0H (SMOD etc)

set sector bank erase registers or program data registers

set FCR0H (Set Write Mode Start)

check FCR0H to see if Write Operation is complete

After adding a bit of a delay between setting the Write Mode Start bit and checking it, I was able to get the thing to erase and program correctly.
oliver239955_st
Associate
Posted on November 24, 2003 at 08:57

Don't forget to check if FCR0L.LOCK is zero, bevore reading the flash registers (e.g. FCR0H). (manual V1.3 page 62)

tscott
Associate II
Posted on December 02, 2003 at 11:43

Quote:

On 2003-11-24 13:27, OlJu wrote:

Don't forget to check if FCR0L.LOCK is zero, bevore reading the flash registers (e.g. FCR0H). (manual V1.3 page 62)

Yep, that is exactly it! I've since added a check for this, removed that time delay I originally implemented and things work flawlessly.

--tim