To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxtOpen lugnet.robotics.nxt in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / 120
119  |  121
Subject: 
Re: Flash Write Cycles
Newsgroups: 
lugnet.robotics.nxt
Date: 
Sun, 10 Sep 2006 12:28:01 GMT
Viewed: 
12387 times
  
In lugnet.robotics.nxt, David Wallace wrote:
Does anyone know how the NXT firmware handles writing program files into flash?
If you re-flash a program with the same name, does it first erase the sectors
that the old program was located in and then re-flash these sectors with the new
program? Or, does it write the new program (with the same name), to a different
set of sectors and then erase the old program?

...

Any knowledgeable people out there in this area?

David Wallace

One probable reason that the NXT does not do any wear leveling is that it
executes instructions directly from flash (the instructions in the firmware
itself), which is memory mapped. This requires that these instructions are
contiguous, which makes wear-leveling difficult or impossible (this is called
XIP in some of the technical literature, for execute-in-place).

The instructions of NXT bytecodes are not machine instructions, so it would
probably be possible to move their blocks/pages around the flash, to level the
wear, at least around the areas that are used by files, not by firmware code.
This would make the cost of reading a word from flash a bit more expensive (to
do the logical-to-physical page traslation), but for 256-byte pages, it would be
just a tiny bit slower. Not much. There would be some waste of space for
headers, to be able to reconstruct the mapping at boot time.

I disagree with ealier posts that wear leveling requires counting erasures. It
can also be done very effectively by randomly swapping pages at some fixed low
probability. It's not very hard to implement good wear leveling.

If anybody would like to build wear-leveling into the firmware, I'll be happy to
supply relevant pointer and help.

But I do agree with earlier posts that wear leveling is probably not that
useful. As long as wear is caused by a person clicking on the "download" button,
it will be hard to wear out the flash on the NXT. But if you write a program
that reads data from sensors every few ms, writes that to the same file over and
over again for hours or days, then you might discover what the actual endurance
limit of the flash is :-)

Sivan Toledo



Message has 1 Reply:
  Re: Flash Write Cycles
 
"Sivan Toledo" <stoledo@tau.ac.il> wrote in message news:J5DMMp.Bs5@lugnet.com... (...) firmware (...) called (...) True, you can't level the firmware - only file systems can be wear leveled. I understand that there has been discussion concerning (...) (18 years ago, 10-Sep-06, to lugnet.robotics.nxt)

Message is in Reply To:
  Flash Write Cycles
 
Does anyone know how the NXT firmware handles writing program files into flash? If you re-flash a program with the same name, does it first erase the sectors that the old program was located in and then re-flash these sectors with the new program? (...) (18 years ago, 9-Sep-06, to lugnet.robotics.nxt)

14 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR