DSPRelated.com
Forums

Is it possible for a 5510A to rewrite its own flash?

Started by chri...@hyperspace.org.uk April 29, 2009
I'm using a 5510A in a custom modem product and I'm booting it from a
parallel flash just like a DSK5510. I use flashburn to load my application
into the product and that uses an app loaded into the 5510 to write to the
flash. Is it possible to rewrite part of the flash from my own app? Is
there an example for this or must I try to hack something up from the fbtc
code? Has anyone done this themselves?

Thanks for any help you can give.

Chris
--
Chris Eilbeck
On Apr 28, 2009, at 13:19, c...@hyperspace.org.uk wrote:
> I'm using a 5510A in a custom modem product and I'm booting it from a
> parallel flash just like a DSK5510. I use flashburn to load my
> application
> into the product and that uses an app loaded into the 5510 to write
> to the
> flash. Is it possible to rewrite part of the flash from my own app? Is
> there an example for this or must I try to hack something up from
> the fbtc
> code? Has anyone done this themselves?

Hi Chris,

A good starting place would be the documentation for the specific
Flash that is on your custom modem board. Each Flash chip has its
own programming modes, which sometimes use specific pins and/or
commands. Once you know what your Flash needs to happen to erase and
reprogram sections of memory, you can probably write your own
application to rewrite part of the Flash.

Apparently there must be some standards for the wiring, since
FlashBurn is able to write to Flash generically. I have not used
FlashBurn yet, so I don't know how many variations are supported, but
if FlashBurn is working for you, then you should be able to write
your own code to do the same.

Note that sometimes you may be required to erase larger sections than
you program. At least the Flash that I most recent wrote firmware
for was organized to erase 1024 bytes at a time, but program 64 bytes
at a time.

Brian Willoughby

Sound Consulting
We actually did reprogram the flash during runtime.
I think our code base for the flash programming came from some
DSK-example (probably DSK5510), but as the previous writer writes,
reading specs for your flash will give you most of the information you
need. The flash we used could only erase entire sectors, so we had to
reflash everything each time.

When the program was loaded into RAM, we had an update mode which we
could enter. To reprogram we first erased the flash sectors where we
had decided that program data should reside, then received new data
from the serial port. There are probably better ways to do this =) But
there weren't any problems reflashing during program execution. The
problem you can have is if you get an error when reflashing - then you
won't be able to boot. But as long as you don't pull the plug on the
board, you still have a working program in RAM and you can erase the
sectors and try again.

Our first plan was to have two (groups of) flash sectors, so that we
always could have an older, working version of the program in one
sector, and use the other to reflash with a new program version. Then
you can try boot the new program and you have a fallback in case
something goes wrong.

All in all, it wasn't extremely complicated to do. You need to think
through how you want your flash sectors to be mapped, e.g. if you want
some sectors for program data and some to store configurations and
other non-program data. Some sort of CRC on the data your are sending,
so that the receiving end can double check that the data is correct
before writing to flash.

HTH and don't hesitate if you need any clarifications.
Sima

On Thu, Apr 30, 2009 at 9:28 PM, Sound Consulting
wrote:
>
> On Apr 28, 2009, at 13:19, c...@hyperspace.org.uk wrote:
>> I'm using a 5510A in a custom modem product and I'm booting it from a
>> parallel flash just like a DSK5510. I use flashburn to load my
>> application
>> into the product and that uses an app loaded into the 5510 to write
>> to the
>> flash. Is it possible to rewrite part of the flash from my own app? Is
>> there an example for this or must I try to hack something up from
>> the fbtc
>> code? Has anyone done this themselves?
>
> Hi Chris,
>
> A good starting place would be the documentation for the specific
> Flash that is on your custom modem board. Each Flash chip has its
> own programming modes, which sometimes use specific pins and/or
> commands. Once you know what your Flash needs to happen to erase and
> reprogram sections of memory, you can probably write your own
> application to rewrite part of the Flash.
>
> Apparently there must be some standards for the wiring, since
> FlashBurn is able to write to Flash generically. I have not used
> FlashBurn yet, so I don't know how many variations are supported, but
> if FlashBurn is working for you, then you should be able to write
> your own code to do the same.
>
> Note that sometimes you may be required to erase larger sections than
> you program. At least the Flash that I most recent wrote firmware
> for was organized to erase 1024 bytes at a time, but program 64 bytes
> at a time.
>
> Brian Willoughby
>
> Sound Consulting
Hi Chris,

As Brian said I too say that you should go through the datasheet of the Flash you are using.

As general rule of flash writing, you should
1. Initially erase the flash
2. Write the flash....

Be careful about not erasing/overwriting the FLASH where your boot code is stored..

Code for this is generally not very complex especially when you are working with processors. Just follow the commands in datasheet to erase and write the flash.

Regards,
Onkar Patki,
Design Engineer.
----------------------------
Mechatronics Test Equipment (I) Pvt.Ltd.
B, Mayur complex, Opp. Bhelke nagar,
Kothrud, Pune 411 038.
Tel.: 91 20 25386926,27,28,29
Fax:: 91 20 25386930
Mob: 919881730876
Email: m...@vsnl.net
URL: www.mte-india.com
----- Original Message -----
From: Sound Consulting
To: c...
Sent: Friday, May 01, 2009 12:58 AM
Subject: Re: [c55x] Is it possible for a 5510A to rewrite its own flash?

On Apr 28, 2009, at 13:19, c...@hyperspace.org.uk wrote:
> I'm using a 5510A in a custom modem product and I'm booting it from a
> parallel flash just like a DSK5510. I use flashburn to load my
> application
> into the product and that uses an app loaded into the 5510 to write
> to the
> flash. Is it possible to rewrite part of the flash from my own app? Is
> there an example for this or must I try to hack something up from
> the fbtc
> code? Has anyone done this themselves?

Hi Chris,

A good starting place would be the documentation for the specific
Flash that is on your custom modem board. Each Flash chip has its
own programming modes, which sometimes use specific pins and/or
commands. Once you know what your Flash needs to happen to erase and
reprogram sections of memory, you can probably write your own
application to rewrite part of the Flash.

Apparently there must be some standards for the wiring, since
FlashBurn is able to write to Flash generically. I have not used
FlashBurn yet, so I don't know how many variations are supported, but
if FlashBurn is working for you, then you should be able to write
your own code to do the same.

Note that sometimes you may be required to erase larger sections than
you program. At least the Flash that I most recent wrote firmware
for was organized to erase 1024 bytes at a time, but program 64 bytes
at a time.

Brian Willoughby

Sound Consulting