Resetting the device, Restarting the application – Echelon Neuron C User Manual

Page 181

Advertising
background image

Neuron C Programmer’s Guide

169

• Log an error

These actions can be combined. For example, you can log an error and then take

the application offline. Alternatively, you can disable a functional block and

change functional block status.

The Neuron firmware also logs system errors for errors detected by the firmware.

Resetting the Device

You can reset a device by calling the node_reset( ) function. This function

immediately resets all processors (application, network, media access, and for
Series 5000 devices, interrupt) on the Neuron Chip or Smart Transceiver. The

Neuron reset pin is driven low; this signal can be used to reset external

transceivers and logic. You typically take this action for catastrophic errors that
require a hardware reset. A device can also be reset by expiry of the watchdog

timer, or by a reset command received from the network.
When a device is reset, it executes the entire initialization sequence. The amount
of time required for initialization is a function of the amount of off-chip memory

as well as the size of the application program, but must be less than 18 seconds
before the application is online. See the Smart Transceivers databooks

for a

detailed formula to calculate reset time.
When you reset a device, all state information that is not kept in EEPROM is
lost. All pending incoming and outgoing messages and network variable updates

are lost. The network processor could receive duplicate packets. In addition, any

packets that have been acknowledged by the network processor but not processed
by the application are lost.

Restarting the Application

You can reset the application processor, but not the network or media-access

processors or (for Series 5000 devices) the interrupt processor, using the
application_restart( ) function. You typically take this action for application

errors that can be recovered by restarting the application, but that do not require

an external hardware reset.

When you call this function, the Neuron firmware clears all timer objects and

initializes I/O objects, non-configuration network variables, and static variables

and then executes the reset clause. Some synchronization cleanup is done before
restarting the application. Any outgoing messages in progress are terminated.

Incoming messages are unaffected. Outstanding completion events and
responses are discarded. An application restart does not lose network state

information. Because only the application processor is reset, the network and

MAC processors continue to process network traffic, and the interrupt processor
continues to process interrupts.
Typical applications that use interrupt tasks share some amount of data between

when tasks and interrupt tasks. During the application restart, some of the
assumptions made for that data sharing might not be valid; you should consider

disabling all interrupts (by calling the interrupt_control( ) function) before calling

application_restart( ). You can re-enable interrupts during the application’s
when(reset) task.

Advertising