April 23rd, 2012, 02:03 AM
Flash Programming (to update your firmware)
Does anyone have experience in flash programming?
I have been handled some code for a microprocessor and am having the following situation:
So far, I have come to find that the code I have been handled(*) has three "modes":
1) Mode 1: The program writes ALL the data from an Area 0 (which is where the startup code is situated I am guessing and is Flash) to an Area 5(which I think it is RAM). Then goes into an infinite loop to signal its end.
2) Mode 2: The program writes the data that receives through a LAN cable to certain sectors of the memory (the addresses are also given through the LAN cable from a host computer). Once finished it goes to an infinite loop to signal its end
3) Mode 3. Normal operation. The program performs just its normal workings.
Since Mode 1 and Mode 2 finish in infinite loops I am guessing to change the modes I have to change some dip switches and jumpers and reset.
The original programmer put very few comments so this is what I have come to know by reading the code.
Now, my guess is Mode 1 is used to copy a "bootloader" into RAM, mode 2 is to activate this bootloader so as to copy the whole program (update the firmware) and mode 3 is normal operation and this is the sequence I should use to update the firmware
- But isnt the RAM contents going to be erased if I reset the chip to change modes???
- And in the second mode, if I have the bootloader in RAM, is it going to be called from that area 5 and not normally from area 0?
Any thoughts or guesses that can illuminate my understanding will be greatly appreciated