User Guide
UG-1926
Rev. 0 | Page 19 of 20
SAFE CODE DEBUGGING/DEVELOPMENT RECOMMENDATIONS
The
code development and programming tools are
similar or identical to those used on other Analog Devices, Inc.,
microcontroller devices and to microcontrollers from other
companies. Care must be taken to ensure the device can be
reprogrammed to avoid lockup situations. In a lockup, the
connection to the ADuCM420 via programming and debug
tools is no longer possible.
This section lists scenarios that can cause lockup situations. If a
lockup situation occurs, recommendations are provided to
recover a device.
SCENARIOS THAT CAUSE DEVICE LOCKUPS
Page 0 Checksum Error
Address 0x1FFC contains a 32-bit checksum for Flash Page 0.
The on-chip kernel performs a checksum on Page 0 excluding
0x1FFC to 0x1FFF. If the kernel result does not match the value
at 0x1FFC or if 0x1FFC value is not 0xFFFFFFFF, the kernel
detects corruption of Page 0 and does not exit to user code,
resulting in a device lockup. See the
for information about an integrity
check of the internal Flash Page 0 by the on-chip kernel.
To recover from this situation, mass erase the device via the
downloader tool (I
2
C or MDIO), and ensure the user source
code sets Flash Address 0x01FFC = 0xFFFFFFFF.
The example code for the ADuCM420 configures Flash Address
0x01FFC = 0xFFFFFFFF.
See
page0_checksum
in the
system_ADuCM420.c
file.
User Flash Pages—Corruption of Reserved Locations
The top six 32-bit locations of each flash block are reserved, and
care must be taken not to overwrite these locations. The flash
signature for each block and the write protection settings are
stored in these six locations. See the
for information about flash user space
organization.
Ensure the top 32-bit location in each flash page is reserved.
See the example programs included in the installer for details.
Unexpected Resets
Unexpected watchdog resets, software resets, power-on resets,
or external resets can cause debug and programming sessions to
end abruptly because these resets break the serial wire debug
(SWD) interface between the J-Link and the Cortex core. If the
user source code results in regular resets, mass erase the user
flash via the downloader and restart the debug session.
Power Saving Modes
If the user code puts the Cortex core into a power-down state,
the power-down causes issues after a power cycle for the debug
tools that use the SWD interface. Tools like J-Link require the
Cortex core to be fully active.
Keil CMSIS Pack
For Keil µVision users only, ensure Keil CMSIS pack
Version 0.8.0 or later is being used.
RECOVERING LOCKED UP DEVICES
Mass erase the device via either the MDIO or I
2
C downloader
tool.