Shop OBEX P1 Docs P2 Docs Learn Events
Brad's Spin Tools has problems with checksums in EEPROM files — Parallax Forums

Brad's Spin Tools has problems with checksums in EEPROM files

WossnameWossname Posts: 174
edited 2013-02-03 03:26 in Propeller 1
EDIT: In summary, brads spin tools doesn't appear to calculate or verify EEPROM file checksums in the same way that the Propeller Tool does. The in many cases I have found, the BST loader will reject an EEPROM file that is accepted by the Prop Tool.

I have attached an example of a hand-written EEPROM file that just makes the Propeler chip blink an LED on pin P13. This EEPROM file is rejected by the linux version of bstl but is happily accepted by the Propeller Tool and is programmed into the Propeller correctly.

I'll try to get in touch with "Brad" if I can find him and ask him what's going on with this checksum issue.








Original post follows...

Hi all,

bstl is moaning that my EEPROM checksums are wrong...

I'm trying to get bstl to program my propeller chip with a custom-modified EEPROM file. This is difficult as I cannot seem to get a clear idea of how bstl validates the checksum within the EEPROM image file (the 32kb file generated by bstc -e). I am doing peculiar things to the EEPROM file, but am I right in thinking that as long as the checksum byte (at offset 0x05) is correct, I should be able to load anything into the Propeller?

I can't seem to find any source code for bstc or bstl on it's website (is this mythical Brad still maintaining this set of tools?) so I'm forced to assume it's closed-source.

Does anyone know with certainty *exactly* how bstl validates a EEPROM file's checksum? Is Brad available for comment on such topics?

Even the Parallax app note on soft loading prop code omits any detail about checksum calculation.


Any and all help gratefully received.

Cheers.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-02 11:37
    It's very simple ...

    The ROM bootstrap loader (and other loaders / compilers / etc.) calculate an 8-bit sum of the entire 32K and this sum must come out to zero to be correct. The checksum byte is part of this sum and must be set to the 2's complement of the sum of the rest of memory in order for this checksum operation to work out. What's sometimes forgotten is that a long word of $FFFF9FFF (I think that's right) is put just below the start of the main stack space prior to the checksum being calculated by the ROM bootstrap loader and has to be figured into the checksum. You can see this stack marker long word in the hex listing of the compiled program in the Propeller Tool.
  • WossnameWossname Posts: 174
    edited 2013-02-02 12:47
    Hmm. Perhaps I need more sleep or something.

    I have two different eeprom files of the same length (32768 bytes) with the same 8-bit checksum (0x00) and only 1 of them is accepted by bstl and actually programmed onto the device the other fails checksum verification. The standard Windows Propeller Tool also reject that same file and accepts the other one.

    I don't understand how that is possible unless I'm trampling on some other part of the file that is supposed to remain unchanged... but I can't find any documentation to verify that.

    Do Parallax have an official document (available to the public) that documents the EEPROM format required to successfully boot up a Propeller? Damned if I can find it. :(

    I'm using this version of bstl, which is the newest I can find...
    Brads SpinTool Loader v0.07-pre1 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Linux at 13:24:15 on 2010/04/28
  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-02 13:06
    There are no "official" documents that document the EEPROM file format in detail. There are a variety of forum postings and the source code of the ROM bootstrap loader is publicly available. Have a look at the Propeller Wiki for some of this information. Also check out the attached file.
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-02-02 16:15
    It a function of the prop rom code. However, I made a simple loader/programmer boot code to do write to a 24LC64 that fooled the eeprom loader because the loader loads a full 32KB and this eeprom is only 8KB. Search for the thread on using smaller eeproms such as the 24LC64 for the code.
  • WossnameWossname Posts: 174
    edited 2013-02-03 03:26
    I found a link to Mr Gracey's original spin interpreter ROM code...

    http://forums.parallax.com/showthread.php/101336-Code-protect?p=710871&viewfull=1#post710871
Sign In or Register to comment.