EmbeddedRelated.com
Forums

Force hard reset?

Started by leob...@gmail.com June 25, 2008
Does anyone know if there is a way to programmatically hard reset (or cold-start or reboot) a BL2600 processor board without power cycling or using the reset button? By "hard reset", I mean that the firmware will be reloaded from the flash memory to RAM and begin executing, and variables will be initialized. I'd like to be able to command the board to reboot via a serial or ethernet link. Thanks all.

l...@gmail.com wrote:
> Does anyone know if there is a way to programmatically hard reset (or cold-start or reboot) a BL2600 processor board without power cycling or using the reset button? By "hard reset", I mean that the firmware will be reloaded from the flash memory to RAM and begin executing, and variables will be initialized. I'd like to be able to command the board to reboot via a serial or ethernet link. Thanks all.
>
Use the watchdog timer to force a reset:

void reboot(void)
{
#asm
ld a,0x53
ioi ld (WDTCR),a
xor a
ioi ld (WDTTR),a
..wait_wdt:
jr ..wait_wdt
#endasm
}
--
------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
* |Rain| prepares for polygon soup
<|Rain|> sweet merciful crap, it works?
* |Rain| faints
Thanks for the prompt response Scott! Maybe I'm confused about the
meaning of hard/soft resets. According to the Dyn C Function Ref
manual, a watchdog timeout is not a hardware reset. (chkHardReset
function). Does a watchdog timeout force the firmware to reload?

On Wed, Jun 25, 2008 at 3:43 PM, Scott Henion wrote:
> l...@gmail.com wrote:
>> Does anyone know if there is a way to programmatically hard reset (or
>> cold-start or reboot) a BL2600 processor board without power cycling or
>> using the reset button? By "hard reset", I mean that the firmware will be
>> reloaded from the flash memory to RAM and begin executing, and variables
>> will be initialized. I'd like to be able to command the board to reboot via
>> a serial or ethernet link. Thanks all.
>>
> Use the watchdog timer to force a reset:
>
> void reboot(void)
> {
> #asm
> ld a,0x53
> ioi ld (WDTCR),a
> xor a
> ioi ld (WDTTR),a
> ..wait_wdt:
> jr ..wait_wdt
> #endasm
> }
>
> --
> ------
> | Scott G. Henion| s...@shdesigns.org |
> | Consultant | Stone Mountain, GA |
> | SHDesigns http://www.shdesigns.org |
> ------
> Rabbit libs: http://www.shdesigns.org/rabbit/
> today's fortune
> * |Rain| prepares for polygon soup
> <|Rain|> sweet merciful crap, it works?
> * |Rain| faints

L. Bostjancic wrote:
> Thanks for the prompt response Scott! Maybe I'm confused about the
> meaning of hard/soft resets. According to the Dyn C Function Ref
> manual, a watchdog timeout is not a hardware reset. (chkHardReset
> function). Does a watchdog timeout force the firmware to reload?
>

It generates a hardware reset. The only difference is the GCSR register
will have a status saying the reset was caused by a watchdog timeout
instead of an external reset.

There is one other difference due to a hardware bug in the 3k CPU. It
will reset but the watchdog will still be enabled.

chkHardReset() returns the GCSR status to show the cause of the hardware
reset: external /RESET, watchdog, or no cause.

--

------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
They don't know how the world is shaped. And so they give it a shape, and
try to make everything fit it. They separate the right from the left, the
man from the woman, the plant from the animal, the sun from the moon. They
only want to count to two.
-- Emma Bull, "Bone Dance"