Forums

HCS12 COP Reset

Started by Adrian Vos July 15, 2004
Hi All,

I am using the DP256. I am using the COP reset to initiate a desired reset
at times, but I am also trying to use it to detect corrupted firmware (the
application is field programmable firmware upgradable with protected
firmware permanent). I was planning on detecting the difference by writing
data to a ram location during normal firmware running that I could check
after the COP reset, but this ram is being reset with the COP reset, and I
am trying to work out whether the COP reset will generate a hardware reset
of RAM locations, or whether it is the startup code on the C compiler I am
using. Unfortunately I have been unable to find any data sheets with
information on the RAM status after a COP reset. If someone can answer this
question for me, or point in the direction of relevant documentation, that
would be appreciated.

Thanks,

Adrian



"Adrian Vos" vosadrian@y wrote

COP reset, like other resets, doesn't clear RAM.

Edward

> Hi All,
>
> I am using the DP256. I am using the COP reset to initiate a desired reset
> at times, but I am also trying to use it to detect corrupted firmware (the
> application is field programmable firmware upgradable with protected
> firmware permanent). I was planning on detecting the difference by writing
> data to a ram location during normal firmware running that I could check
> after the COP reset, but this ram is being reset with the COP reset, and I
> am trying to work out whether the COP reset will generate a hardware reset
> of RAM locations, or whether it is the startup code on the C compiler I am
> using. Unfortunately I have been unable to find any data sheets with
> information on the RAM status after a COP reset. If someone can answer
this
> question for me, or point in the direction of relevant documentation, that
> would be appreciated.
>
> Thanks,
>
> Adrian


Thanks for the responses all!!

I had an error in my macros, and the ram location I was using was a general
global variable in the compilers ram space rather than a ram variable I
manually located (like a register). Metrowerks by default initialises the
ram space of variables it allocates in the startup code, so it was being
reset. Now that I have located it manually, it is not being reset, and I can
achieve what I was after.

In my case I initialise this variable to 0 on the power on reset vector, I
then set it in the general firmware. If the firmware is corrupt data, the
variable will not be set, and I can check this in the COP vector to see if
the COP resulted from a planned reset or from corrupt code.

Thanks again!!

-- Adrian

----- Original Message -----
From: "Edward Karpicz" <>
To: <>
Sent: Friday, July 16, 2004 4:43 PM
Subject: Re: [68HC12] HCS12 COP Reset > "Adrian Vos" vosadrian@y wrote
>
> COP reset, like other resets, doesn't clear RAM.
>
> Edward
>
> > Hi All,
> >
> > I am using the DP256. I am using the COP reset to initiate a desired
reset
> > at times, but I am also trying to use it to detect corrupted firmware
(the
> > application is field programmable firmware upgradable with protected
> > firmware permanent). I was planning on detecting the difference by
writing
> > data to a ram location during normal firmware running that I could
check
> > after the COP reset, but this ram is being reset with the COP reset, and
I
> > am trying to work out whether the COP reset will generate a hardware
reset
> > of RAM locations, or whether it is the startup code on the C compiler I
am
> > using. Unfortunately I have been unable to find any data sheets with
> > information on the RAM status after a COP reset. If someone can answer
> this
> > question for me, or point in the direction of relevant documentation,
that
> > would be appreciated.
> >
> > Thanks,
> >
> > Adrian >
> Yahoo! Groups Links