Shop OBEX P1 Docs P2 Docs Learn Events
Loading EEPROM with extra data — Parallax Forums

Loading EEPROM with extra data

spinbobspinbob Posts: 27
edited 2013-05-18 00:18 in Propeller 1
I have an EEPROM image that has extra data in it(from an upload) and the Propeller tool won't program or load the extra data. I have looked hard and got hits for the same problem and can't find the answer. I presume it's a checksum(this could be bad) or some other issue. Anyone have a app to program the EEPROM regardless of contents. Thanks

Comments

  • Daniel HarrisDaniel Harris Posts: 207
    edited 2013-05-15 13:45
    Hi Spinbob,

    The Propeller always programs the entire lower 32 KB of EEPROM when you do an EEPROM load from the Propeller Tool (or any other loading utility). It never touches anything above 32 KB, unless you use an EEPROM object to programatically write into that memory space. There is no checksumming that takes place.

    Consider using an object like this one:

    http://obex.parallax.com/object/23

    Does the data you want to erase live below (<32 KB) or above (>32 KB) the 32 KB line?
  • spinbobspinbob Posts: 27
    edited 2013-05-15 14:10
    Lower 32k stuff. The problem shows itself when I try to load the .eeprom in both Propeller tool and Propellent. It comes up with " found extra data in file, wont load the extra". My code was compiled, download, run, and it writes to EE on pwr up. I have uploaded this image and now I'm trying to put it on another unit.
  • Daniel HarrisDaniel Harris Posts: 207
    edited 2013-05-15 14:58
    Ah, I see. I think I misunderstood your original post. I understand now, though.

    The boot code in the Propeller's ROM that is responsible for writing your program to EEPROM when you program EEPROM only knows to talk to the lower 32 KB. Thus, Propellent and the Propeller Tool won't be able to load into the upper EEPROM.

    Since there is this limitation, you will have to load your large application in two stages - the lower half then the upper half. The upper image will have to be loaded into RAM, and then programmatically copied into upper EEPROM. I'd split your .eeprom image at the 32 KB line and "include" the upper bits with the "file" operator in a DAT section. Your included data will have an address in the Hub RAM image, which you can point the I2C EEPROM driver at as a source, with the destination being upper EEPROM starting at your desired address.

    Or, perhaps you could write an EEPROM duplicator program if you need to load more than a few. This way, you can get one just the way you want, and then read that EEPROM as a source and write your target EEPROM byte for byte, up to the size (number of bytes) you need.

    Make sense?
  • spinbobspinbob Posts: 27
    edited 2013-05-15 15:10
    I only have 20K of code used. I am trying to duplicate units. Unit #1 runs a program that gathers data and writes to EE. I power this one off, upload the 32K EE and try to write that image to another identical unit and many more. The Propeller tool and Propellent flag an error when I load the image. " found extra data in file, wont load the extra". For some unknown reason these apps parse the image in the 32K and see something they dont like. There must be something in there telling the tools that there is an end to compiled code or something. I found that others had the same problem. Thanks
  • Daniel HarrisDaniel Harris Posts: 207
    edited 2013-05-15 15:26
    It sounds like the image you "upload" back to your computer is greater than 32 KB in size. That is what the Propeller Tool and Propellent are warning you about. If you use a Hex Editor, you can look at the byte contents of your uploaded file and see that there is data beyond 0x7FFF (<---32 KB).

    To be able to load this data into another EEPROM, you will have to use a Propeller program that explicitly writes the additional data into upper EEPROM because the Propeller's boot loader was not designed to be able to write into that memory space.
  • kuronekokuroneko Posts: 3,623
    edited 2013-05-15 16:30
    IIRC PropTool & Co optimise the upload in that they only transfer the actual code section of an .eeprom file (what's effectively a .binary). If you want a 1:1 copy you'll have to use some other tool which programs the EEPROM manually. You could try the Hydra Asset Manager (which needs adjusting re: _clkmode & Co).

    Update: Just dug out my copy of HAM and modified it. It then happily uploads anything you throw at it.
  • spinbobspinbob Posts: 27
    edited 2013-05-15 19:05
    Thanks Kuroneko. I tried Ham, nice program. It has shown me a checksum error is probably the issue. I guess the writing of the EE changes the checksum calcs in the propeller tool. Just guessing, I will have to calculate a new checksum and try it. Any one have a checksum calculator. Thanks all, will keep you updated here when I fix it.
  • kuronekokuroneko Posts: 3,623
    edited 2013-05-15 19:22
    spinbob wrote: »
    It has shown me a checksum error is probably the issue. I guess the writing of the EE changes the checksum calcs in the propeller tool. Just guessing, I will have to calculate a new checksum and try it. Any one have a checksum calculator. Thanks all, will keep you updated here when I fix it.
    Which is odd. When an EEPROM image has a checksum error PropTool (1.3.2) shows a checksum error (you mentioned extra data). Anyway, yes, writing to EEPROM may invalidate the image checksum but it is only tested during upload. Calculating the checksum is easy, the byte at location 5 needs adjusting so that the LSB of the sum of all 32K bytes is 0. HTH
  • spinbobspinbob Posts: 27
    edited 2013-05-15 20:29
    The LSB of the sum of all 32K bytes is 0. LSB is one bit. Is this true?

    For folks following this; The Ham program has a hex editor, that will come in handy with the checksum issue.
    Thanks for the help.
  • kuronekokuroneko Posts: 3,623
    edited 2013-05-15 20:36
    spinbob wrote: »
    The LSB of the sum of all 32K bytes is 0. LSB is one bit. Is this true?
    LSByte as opposed to LSbit. Sorry for the confusion.
  • spinbobspinbob Posts: 27
    edited 2013-05-15 22:22
    I just did a test and the problem is not the checksum. I added a 01 up at the top of EE and changed the checksum - 1 and tried +1 and still an error. I am going to throw this to Daniel Harris. Is there something that can be done? It appears that the propeller tool and propellent have the same issue, they don't load and image of the entire 32K, they stop at the end of compiled code and anything else is considered an error. Thanks
  • kuronekokuroneko Posts: 3,623
    edited 2013-05-16 01:42
    FWIW, with extra data added and no checksum adjustment I do get a checksum error, after adjustment I'm left with data after codespace which in a way is acceptable. Not sure if I want the tools to change unless it's some kind of full size option. Until then you have at least one solution.
  • spinbobspinbob Posts: 27
    edited 2013-05-16 07:51
    My goals are to support Production. Thank you Kuroneko for the help with your program. I do consider it temporary until I find a tool that can be used in a production enviorment. I need tools that are load and program, ready to go. I need to do 100+ boards every couple months.
  • Daniel HarrisDaniel Harris Posts: 207
    edited 2013-05-16 17:34
    Spinbob,

    How did you generate the image you are attempting to download?
  • spinbobspinbob Posts: 27
    edited 2013-05-16 18:12
    I used the app "unload_prop". Got it off the forum here. It creates a .eeprom.
    I did get a unit programmed today and ready to ship. This is a big deal, we were just about to start pulling the EEPROms off the board to stick in the programmer.,
  • kuronekokuroneko Posts: 3,623
    edited 2013-05-16 22:05
    spinbob wrote: »
    I did get a unit programmed today and ready to ship. This is a big deal, we were just about to start pulling the EEPROms off the board to stick in the programmer.,
    Looks like propeller-load from the Simple IDE package does what you want but it's commandline only. It accepts an EEPROM image (with correct checksum) and uploads it as is (32K). You can omit -r if you don't want it to restart after programming.
    propeller-load -e -r image.eeprom
    
  • spinbobspinbob Posts: 27
    edited 2013-05-18 00:18
    You are right, propeller-load works. I made a batch file so loading is now point and click. Thanks so much.
Sign In or Register to comment.