Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/05/08 23:09
Read: times


 
#150357 - flash corruption or write failure
Responding to: ???'s previous message
I recently had a problem with flash corruption on an SiLabs part.

The project is an audio switcher with some buttons to select channels and the ability to store up to 32 "scenes" or combinations of enabled channels. Each scene requires 8 bytes. The scenes are stored in a page of the flash.

At power-up, the micro fetches the 32 scenes and stores them in XRAM. When the user press the "recall scene" button and chooses a scene, I don't read from the flash, I just read the scene data from the RAM and configure the switches appropriately.

When the user presses "store scene" and selects which slot to save it in, the RAM copy of the scene is updated. Then the page containing all of the scenes is erased and finally the RAM is copied to the flash.

And this all seemed to work. Power off, power on, it all restored, great. But if the thing was off overnight, the flash recall at power-up returned garbage. I thought it was the reset, or the clock, or a bit backwards somewhere, or I was writing to an illegal location, or that my code was just too big, but none of that was the case.

After stepping through the code in the debugger, I noticed that the flash page write function was exiting early, because it thought it was supposed to write zero bytes. Of course that was not what I intended.

I then checked the function call, which accepted as one of its parameters an unsigned char called BytesToWrite.

I left the three clues to why this failed in my post above. Can anyone see the REAL cause of the "flash corruption" ???

-a

List of 32 messages in thread
TopicAuthorDate
C8051F340 Flash corruption problem            01/01/70 00:00      
   use an open collector supervisor ana a pullup            01/01/70 00:00      
   No problem on my end            01/01/70 00:00      
      Grant, can you confirm            01/01/70 00:00      
         Not at this time            01/01/70 00:00      
         Yes, it's a 4k7 pullup            01/01/70 00:00      
   Why do you believe it's going awry during powerup?            01/01/70 00:00      
      likelyhoods            01/01/70 00:00      
         This is funny!            01/01/70 00:00      
            statistical probability            01/01/70 00:00      
               So you conclude that the world is flat?            01/01/70 00:00      
                  who on earth in his right mind would do that?            01/01/70 00:00      
                     someone who is curious about RESET.            01/01/70 00:00      
                        8051f12x/f13x            01/01/70 00:00      
                           It's not that simple ...            01/01/70 00:00      
                              I have a paid job            01/01/70 00:00      
                                 Indeed you have            01/01/70 00:00      
                                    if 1 million people get sick ...            01/01/70 00:00      
                                       It ain't necessarily so            01/01/70 00:00      
                                          3 things you did not respond to            01/01/70 00:00      
                                             that's not how it works            01/01/70 00:00      
                                                it his not 'details'            01/01/70 00:00      
                                                   What does "works" mean?            01/01/70 00:00      
   SiLabs view on this issue            01/01/70 00:00      
      re a point            01/01/70 00:00      
         I am reading some interesting discussion            01/01/70 00:00      
            AP, yes, Richard read that all say the same.            01/01/70 00:00      
            That means NO??            01/01/70 00:00      
               HUH?            01/01/70 00:00      
   Qazi Please provide some details            01/01/70 00:00      
   flash corruption or write failure            01/01/70 00:00      
      answer to quiz!            01/01/70 00:00      

Back to Subject List