Reply by Laurent April 25, 20042004-04-25
Well i'm not surprised that you code worked, the problem is at sectors 8 &
9.
Sector 10 was fine :)

Cheers,
Laurent ----- Original Message -----
From: "Mike Petty" <>
To: <>
Sent: Saturday, April 24, 2004 4:56 PM
Subject: Re: [c6x] Small bug fix in the TMS320C6713 SDK Flash code > I've been able to erase and reprogram the last sector without any
> problems. Here's the code I've been using.
>
> //erase the last sector
> DSK6713_FLASH_erase(DSK6713_FLASH_BASE+((DSK6713_FLASH_PAGES-1)*
> DSK6713_FLASH_PAGESIZE),
> (Uint32)DSK6713_FLASH_PAGESIZE);
>
> //write a variable to the start of the last sector
>
> DSK6713_FLASH_write((Uint32)&Data,DSK6713_FLASH_BASE+
>
> ((DSK6713_FLASH_PAGES-1)*DSK6713_FLASH_PAGESIZE),8);
>
> I've been using this routine to write variables to the final sector in
> flash while the DSP is running for some time now.
>
> Mike
>
> Laurent wrote:
>
> > Hi All,
> >
> > I'm new to the list and i'm sure i'll have a lot of questions to ask
> > in the future !
> >
> > I've figured out that the DSK6713_FLASH_erase() function did not work
> > as described in the documentation as i was unable to erase some
> > specific sectors of the AMD29LV400BT Flash.
> >
> > I guess this bug might not have been detected because the function
> > works fine when we try to erase the whole chip ( this is because the
> > blocks are all contiguous ), and this is generally what people do.
> > I looked at the AMD29LV400BT Flash PDF documentation and i think i've
> > found out what's wrong.
> >
> > In the dsk6713_flash_erase.c they define :
> >
> > /* Constant table containing end address of each sector */
> > static Uint32 sector_end[DSK6713_FLASH_SECTORS] = {
> > DSK6713_FLASH_BASE + 0x007fff, /* Sector 0 */
> > DSK6713_FLASH_BASE + 0x00ffff, /* Sector 1 */
> > DSK6713_FLASH_BASE + 0x017fff, /* Sector 2 */
> > DSK6713_FLASH_BASE + 0x01ffff, /* Sector 3 */
> > DSK6713_FLASH_BASE + 0x027fff, /* Sector 4 */
> > DSK6713_FLASH_BASE + 0x02ffff, /* Sector 5 */
> > DSK6713_FLASH_BASE + 0x037fff, /* Sector 6 */
> > DSK6713_FLASH_BASE + 0x039fff, /* Sector 7 */
> > DSK6713_FLASH_BASE + 0x03bfff, /* Sector 8 */
> > DSK6713_FLASH_BASE + 0x03dfff, /* Sector 9 */
> > DSK6713_FLASH_BASE + 0x03ffff /* Sector 10 */
> > };
> > while it should be ( according to the Flash doc ) :
> >
> > /* Constant table containing end address of each sector */
> > static Uint32 sector_end[DSK6713_FLASH_SECTORS] = {
> > DSK6713_FLASH_BASE + 0x007fff, /* Sector 0 */
> > DSK6713_FLASH_BASE + 0x00ffff, /* Sector 1 */
> > DSK6713_FLASH_BASE + 0x017fff, /* Sector 2 */
> > DSK6713_FLASH_BASE + 0x01ffff, /* Sector 3 */
> > DSK6713_FLASH_BASE + 0x027fff, /* Sector 4 */
> > DSK6713_FLASH_BASE + 0x02ffff, /* Sector 5 */
> > DSK6713_FLASH_BASE + 0x037fff, /* Sector 6 */
> > DSK6713_FLASH_BASE + 0x03bfff, /* Sector 7 */
> > DSK6713_FLASH_BASE + 0x03cfff, /* Sector 8 */
> > DSK6713_FLASH_BASE + 0x03dfff, /* Sector 9 */
> > DSK6713_FLASH_BASE + 0x03ffff, /* Sector 10 */
> > };
> > There are some slight differences on the block sizes, at the end...
> >
> > Now that i've fixed this, i can erase ( then program ) the desired
> > sectors at the end of the flash ( sector 9 ).
> > I hope that can help some of you...
> >
> > Cheers,
> > Laurent
> >
> >
> > _____________________________________
> > Note: If you do a simple "reply" with your email client, only the
> > author of this message will receive your answer. You need to do a
> > "reply all" if you want your answer to be distributed to the entire
group.
> >
> > _____________________________________
> > About this discussion group:
> >
> > To Join: Send an email to
> >
> > To Post: Send an email to
> >
> > To Leave: Send an email to
> >
> > Archives: http://www.yahoogroups.com/group/c6x
> >
> > Other Groups: http://www.dsprelated.com
> >
> >
> >
> >
> > *>.
> >
> >
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author
of this message will receive your answer. You need to do a "reply all" if
you want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://www.yahoogroups.com/group/c6x
>
> Other Groups: http://www.dsprelated.com
>
> Yahoo! Groups Links >


Reply by Mike Petty April 25, 20042004-04-25
I've been able to erase and reprogram the last sector without any
problems. Here's the code I've been using.

//erase the last sector
DSK6713_FLASH_erase(DSK6713_FLASH_BASE+((DSK6713_FLASH_PAGES-1)*
DSK6713_FLASH_PAGESIZE),
(Uint32)DSK6713_FLASH_PAGESIZE);

//write a variable to the start of the last sector

DSK6713_FLASH_write((Uint32)&Data,DSK6713_FLASH_BASE+

((DSK6713_FLASH_PAGES-1)*DSK6713_FLASH_PAGESIZE),8);

I've been using this routine to write variables to the final sector in
flash while the DSP is running for some time now.

Mike

Laurent wrote:

> Hi All,
>
> I'm new to the list and i'm sure i'll have a lot of questions to ask
> in the future !
>
> I've figured out that the DSK6713_FLASH_erase() function did not work
> as described in the documentation as i was unable to erase some
> specific sectors of the AMD29LV400BT Flash.
>
> I guess this bug might not have been detected because the function
> works fine when we try to erase the whole chip ( this is because the
> blocks are all contiguous ), and this is generally what people do.
> I looked at the AMD29LV400BT Flash PDF documentation and i think i've
> found out what's wrong.
>
> In the dsk6713_flash_erase.c they define :
>
> /* Constant table containing end address of each sector */
> static Uint32 sector_end[DSK6713_FLASH_SECTORS] = {
> DSK6713_FLASH_BASE + 0x007fff, /* Sector 0 */
> DSK6713_FLASH_BASE + 0x00ffff, /* Sector 1 */
> DSK6713_FLASH_BASE + 0x017fff, /* Sector 2 */
> DSK6713_FLASH_BASE + 0x01ffff, /* Sector 3 */
> DSK6713_FLASH_BASE + 0x027fff, /* Sector 4 */
> DSK6713_FLASH_BASE + 0x02ffff, /* Sector 5 */
> DSK6713_FLASH_BASE + 0x037fff, /* Sector 6 */
> DSK6713_FLASH_BASE + 0x039fff, /* Sector 7 */
> DSK6713_FLASH_BASE + 0x03bfff, /* Sector 8 */
> DSK6713_FLASH_BASE + 0x03dfff, /* Sector 9 */
> DSK6713_FLASH_BASE + 0x03ffff /* Sector 10 */
> };
> while it should be ( according to the Flash doc ) :
>
> /* Constant table containing end address of each sector */
> static Uint32 sector_end[DSK6713_FLASH_SECTORS] = {
> DSK6713_FLASH_BASE + 0x007fff, /* Sector 0 */
> DSK6713_FLASH_BASE + 0x00ffff, /* Sector 1 */
> DSK6713_FLASH_BASE + 0x017fff, /* Sector 2 */
> DSK6713_FLASH_BASE + 0x01ffff, /* Sector 3 */
> DSK6713_FLASH_BASE + 0x027fff, /* Sector 4 */
> DSK6713_FLASH_BASE + 0x02ffff, /* Sector 5 */
> DSK6713_FLASH_BASE + 0x037fff, /* Sector 6 */
> DSK6713_FLASH_BASE + 0x03bfff, /* Sector 7 */
> DSK6713_FLASH_BASE + 0x03cfff, /* Sector 8 */
> DSK6713_FLASH_BASE + 0x03dfff, /* Sector 9 */
> DSK6713_FLASH_BASE + 0x03ffff, /* Sector 10 */
> };
> There are some slight differences on the block sizes, at the end...
>
> Now that i've fixed this, i can erase ( then program ) the desired
> sectors at the end of the flash ( sector 9 ).
> I hope that can help some of you...
>
> Cheers,
> Laurent > _____________________________________
> Note: If you do a simple "reply" with your email client, only the
> author of this message will receive your answer. You need to do a
> "reply all" if you want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://www.yahoogroups.com/group/c6x
>
> Other Groups: http://www.dsprelated.com >
>
> *>.




Reply by Laurent April 24, 20042004-04-24
Hi All,
 
I'm new to the list and i'm sure i'll have a lot of questions to ask in the future !
 
I've figured out that the DSK6713_FLASH_erase() function did not work as described in the documentation as i was unable to erase some specific sectors of the AMD29LV400BT Flash.
 
I guess this bug might not have been detected because the function works fine when we try to erase the whole chip ( this is because the blocks are all contiguous ), and this is generally what people do.
I looked at the AMD29LV400BT Flash PDF documentation and i think i've found out what's wrong.
 
In the dsk6713_flash_erase.c they define :
 
/* Constant table containing end address of each sector */
static Uint32 sector_end[DSK6713_FLASH_SECTORS] = {
    DSK6713_FLASH_BASE + 0x007fff, /* Sector 0  */
    DSK6713_FLASH_BASE + 0x00ffff, /* Sector 1  */
    DSK6713_FLASH_BASE + 0x017fff, /* Sector 2  */
    DSK6713_FLASH_BASE + 0x01ffff, /* Sector 3  */
    DSK6713_FLASH_BASE + 0x027fff, /* Sector 4  */
    DSK6713_FLASH_BASE + 0x02ffff, /* Sector 5  */
    DSK6713_FLASH_BASE + 0x037fff, /* Sector 6  */
    DSK6713_FLASH_BASE + 0x039fff, /* Sector 7  */
    DSK6713_FLASH_BASE + 0x03bfff, /* Sector 8  */
    DSK6713_FLASH_BASE + 0x03dfff, /* Sector 9  */
    DSK6713_FLASH_BASE + 0x03ffff  /* Sector 10 */
};
while it should be ( according to the Flash doc ) :
 
/* Constant table containing end address of each sector */
static Uint32 sector_end[DSK6713_FLASH_SECTORS] = {
    DSK6713_FLASH_BASE + 0x007fff, /* Sector 0  */
    DSK6713_FLASH_BASE + 0x00ffff, /* Sector 1  */
    DSK6713_FLASH_BASE + 0x017fff, /* Sector 2  */
    DSK6713_FLASH_BASE + 0x01ffff, /* Sector 3  */
    DSK6713_FLASH_BASE + 0x027fff, /* Sector 4  */
    DSK6713_FLASH_BASE + 0x02ffff, /* Sector 5  */
    DSK6713_FLASH_BASE + 0x037fff, /* Sector 6  */
    DSK6713_FLASH_BASE + 0x03bfff, /* Sector 7  */
    DSK6713_FLASH_BASE + 0x03cfff, /* Sector 8  */
    DSK6713_FLASH_BASE + 0x03dfff, /* Sector 9  */
    DSK6713_FLASH_BASE + 0x03ffff, /* Sector 10  */
};
There are some slight differences on the block sizes, at the end...
 
Now that i've fixed this, i can erase ( then program ) the desired sectors at the end of the flash ( sector 9 ).
I hope that can help some of you...
 
Cheers,
Laurent