Brad's Spin Tools has problems with checksums in EEPROM files
Wossname
Posts: 174
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.
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.
eeprom
32K
Comments
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.
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...
http://forums.parallax.com/showthread.php/101336-Code-protect?p=710871&viewfull=1#post710871