Flash Programming (to update your firmware)

Discussion in 'Embedded Systems and Microcontrollers' started by KansaiRobot, Apr 22, 2012.

  1. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    Hello All.

    In the Past this forum has been very helpful and I am very grateful about this. I hope this time I can get help too.

    My current problem deals with updating a firmware for a microprocessor through LAN. Any architecture would be fine, I just need some general talk on how to proceed.

    So far what I have is a program (which is the one I have to program in the microprocessor) that also does the uploading (how confusin is that!?).

    It seems the program ask for data from a host through a LAN connection and once received it writes it in certain sections of the memory. But if that is so, how do I put this program there in the first time? Or is the program that is previously there???

    -------------------------------------------------
    (from here more detailed data - read if you want to understand the problem better)

    I have a SH7709 (with a external memory chip I suppose since I ve been told that the chip itself does not have memory) and a program in a host computer that supposedly sends the mot file through a LAN line.

    In the program example I have I found that one piece of code gets executed if a pin is up (supposedly copy some memory into the other) and another piece of code gets executed if the pin is down (normal operation)

    My question is, this program (that also does the memory coping) is actually the program that I am trying to upload, right? How if I send it from the host computer, it is going to gets executed if it is not uploaded there yet??? or if I am updating the firmware , am I supposed to use the previous version??

    Someone with experience in flash programming and firmware updating can talk to me about this in simple terms? I would be very grateful for this
     
  2. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    nobody? :(
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    Microprocessors and microcontrollers usually come with a blank memory. So how does one get the program into code memory? There are various mechanisms employed depending on which one the manufacturer chooses. Sometimes this is called bootstrapping using a bootstrap loader.

    The manufacturer may provide a hardware mechanism to get a primitive program into code memory, usually using a serial interface such as the UART, SCI, SPI, ISP, ICSP, JTAG. This mechanism can be used without much error checking in order to load a more robust program which can then perform more extensive error checking. This program is called the binary loader but sometimes it is still called the bootstrap loader.

    In your case, the Hitachi SH7709 microprocessor has no internal memory and no bootstrap loader. This must be provided by an external EPROM or ROM which has been programmed externally by an EPROM programmer. Once this binary loader is in place it can use any mechanism such as a serial port or a LAN port to program the on-board program memory.

    As long as the bootstrap/binary loader program in EPROM is never erased one should be able to upgrade the application program remotely. This is done today in many embedded systems such as a modem, for example.
     
    KansaiRobot likes this.
  4. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    Thank you fro your answer.

    One quick question. When erasing Flash Memories (before reprogramming) do I always have to fill it with 1's (as in 0xFFFF FFFF)???
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    When you erase memories you don't get to choose whether it gets erased to zeros or ones.
    The standard convention is it gets erased to ones.
     
  6. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    318
    5
    I couldnt understand your reply until I read the datasheet of the flash memory we are using.
    It seems that the ones or zeros are put by the memory, I should only give commands to the chip... Why nobody says anything like this in all the sites I have visited?:(

    Anyway, do any one have experience programming flash memories?? (if Spansion memories much better):rolleyes:

    Help appreciated!
     
Loading...