Searching \ for '[PIC] Program CRC checksum in PIC18FxxJxx' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/method/errors.htm?key=crc
Search entire site for: 'Program CRC checksum in PIC18FxxJxx'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Program CRC checksum in PIC18FxxJxx'
2007\10\13@093755 by Morgan Olsson

flavicon
face
Is there an existant method for calculating and storing a program CRC sum into a PIC18FxxJxx?
(Specifically 18F66J15)

My collegue programming the chip say the J-series lacks thoose storage locations the non-J series have, that the tools can use automatically for things like this.  (i did not dig into the details myself)


Background:
Our intent is to let the program self-verify each boot.
In order to catch any cell getting old during the boot and avoid crashing running, the PIC have one pin connected via a resistor to the feedback of the external regulator, thus:
Tristate = Normal VDD
Low = Max VDD
High = Min VDD

So the program begins with running a CRC of all flash,
(possibly omitting the CRC code itself)
First with the pin low, then high.
(it waits shortly for stable VDD after changing pin state)
If any error it will flash CRC error code on status LEDs.
(after having set VDD normal.)
If all OK it set VDD normal, stabilisation pause, RUN.

Hardware is working, we have a CRC routine already etc, but we miss one inportant step:
How can we do to get the CRC into the hex file before flashing it into the PIC ??

I was thiking we can write a program that converts the hex file;  calculate and add the CRC-sum at a specific location.
But it really feels like we are re-inventing the wheel.


( We do *not* want to use the method of itself at fisrt boot caluate CRC itself and store that, because then any initial programming errors are not detected.  We want to be able to use simple straigth forward programming and the possibility of ahvin tit bootload new versions in the future so it must verify itself securely.  Also the hardare makes it difficult to use a production programmer that verifies using varying voltages.  Instead we want it to verify itself at max and min VDD agains a pre-generated checksum, and we will allways have top class verification, every boot. )

--
Morgan Olsson

2007\10\13@181454 by Peter P.

picon face
Use a command line programmer and a simple script (Perl or tcl works) to do the
editing of the hex file (or binary if you like). The batch file will run the CRC
calculator before it will run the programmer so it will be correct every time,
even if you use serialization. On *nix the batch file is called a Makefile.

You can probably order such a program from one of the web sweatshops that do
contract programming (rentacoder.com etc). It's a 3 hour job imho.

(how's the weather in Tuvalu ? (your email tld is .tv ;^))
Peter P.


2007\10\14@082903 by Gerhard Fiedler

picon face
Peter P. wrote:

> Use a command line programmer and a simple script (Perl or tcl works) to
> do the editing of the hex file (or binary if you like).

There are also existing specialized programs for this. Many programmers
come with such a tool, and also some compilers (like the Hi-Tech C
compilers).

> On *nix the batch file is called a Makefile.

Ah, not only on *x :)  FWIW, there are also alternatives to makefiles.
Makefiles have some disadvantages.

Gerhard

2007\10\14@092257 by Xiaofan Chen

face picon face
On 10/14/07, Peter P. <spam_OUTplpeter2006TakeThisOuTspamyahoo.com> wrote:
> On *nix the batch file is called a Makefile.

Hmm, I believe shell script is also kind of batch file under Unix or
Windows with some kind of interpreter (eg: bash, perl) installed.

> (how's the weather in Tuvalu ? (your email tld is .tv ;^))

I think he is not. There is a company selling domain name end with
".tv".

2007\10\14@142521 by Morgan Olsson
flavicon
face
Den 2007-10-14 15:22:55 skrev Xiaofan Chen <.....xiaofancKILLspamspam@spam@gmail.com>:

>> (how's the weather in Tuvalu ? (your email tld is .tv ;^))
>
> I think he is not. There is a company selling domain name end with
> ".tv".

Yes, my ISP where i have this account for PICLIST mail, use .tv althogh we are in Sweden.
My company use .eu for European Union, as wh have a likely named company who registered under the .se domain...

Nice tip about Hi-Tech, i plan top try their compiler and IDE anyway whenever i find time...

--
Morgan Olsson

2007\10\15@052107 by Gerhard Fiedler

picon face
Morgan Olsson wrote:

> Nice tip about Hi-Tech, i plan top try their compiler and IDE anyway
> whenever i find time...

Look for hexmate -- that's their tool that deals with hex files. (Try
"hexmate -help".)

Gerhard

2007\10\15@075432 by Spehro Pefhany

picon face
At 04:18 AM 10/15/2007, you wrote:
>Morgan Olsson wrote:
>
> > Nice tip about Hi-Tech, i plan top try their compiler and IDE anyway
> > whenever i find time...
>
>Look for hexmate -- that's their tool that deals with hex files. (Try
>"hexmate -help".)
>
>Gerhard

Pronounced "hexmite", one might assume.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffspamKILLspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com



More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...