Shop OBEX P1 Docs P2 Docs Learn Events
Possible to Program EEPROM Without Immediately Restarting Propeller? — Parallax Forums

Possible to Program EEPROM Without Immediately Restarting Propeller?

one-zeroone-zero Posts: 5
edited 2013-04-06 15:52 in Propeller 1
On Propeller, is there a way to reprogram the EEPROM without immediately restarting the Propeller with the new code? Note that pins P28:P31 are not multiplexed with anything in the application. They are dedicated to the EEPROM and the serial host interface. The use case is I have a customer who wants to continue running with their current level code that's in Propeller RAM. Then, when it's convenient for them to restart their application, they can reset the Propeller and it will automatically use the new code stored in the EEPROM? The new code has already been fully tested on an exact copy of their hardware so there are no worries about it not working after the restart.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-04-05 11:56
    You can't do this with the existing ROM bootstrap loader since it always downloads from the serial port to RAM, filling RAM, then writing the RAM contents to the 1st 32K of the EEPROM. You could write your own routines and incorporate them into your application such that the new program, in response to some command, reads the new program a byte at a time or a block at a time from the PC and writes it directly to EEPROM. Typically you'd need a 64 byte or 128 byte buffer for this since that's the page size for an EEPROM write page operation. You couldn't use the Propeller Tool (or any other standard program loader) for this since it resets the Propeller to force control into the ROM bootstrap loader. You might look at the Propeller Backpack's loader for an example of this sort of thing.
  • tonyp12tonyp12 Posts: 1,951
    edited 2013-04-05 12:59
    Is it a custom made board and can you make a new board with extra pins headers/jumpers?

    Make a jumper from FTDI chip to go to a GPIOs instead of Reset, and your software running on Prop will look for this pin and reprogram the eerprom.
    You could use PropTool if you follow the rules of handshaking.

    Or
    Make a pin header on the board for I2C, use a USB to I2C dongle and use a PC program to send binary Prop software directly to eeprom.
  • one-zeroone-zero Posts: 5
    edited 2013-04-06 15:09
    It's a custom board. I'll look into what you suggested for future revisions of the board. I like the later idea of loading the EEPROM directly via an I2C header. That way I don't have to put any hooks into the software running on the Prop.

    Do you know if the Prop2 will allow direct loading of new code to EEPROM without a forced restart?
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-04-06 15:52
    Don't know if this is what you are looking for, but it might give you some ideas.

    In propforth, the spin propgram that is the kernel and current dictionary (list of functions) is in EEPROM,and gets loaded into memory at powerup or reset. There is a word "saveforth" that write the current contents of hub RAM into EEPROM. So if we create new definitions (in forth source code text files) and have loaded these into the prop, we can "saveforth" and the new definitions will be there next powerup. Also, we can "forget" any new definition(s) and do saveforth, and they will NOT be present next powerup.

    This works on any prop board capable of running SPIN.

    So basically, if your application can write to EEPROM, you can have it write whatever you want, including the contents of HUB RAM, modified as you like.
Sign In or Register to comment.