NetBurner 3.5.0
PDF Version
 
Recovery: SOMRT1061

Introduction

Applicable Hardware Platforms: SOMRT1061

Device recovery in the event of an errant application running on the device is an important part of the development process. This document describes recovery procedures for a device stuck in a repeating trap/reset condition, or a totally unresponsive device.

Boot Components and Features Overview

An overview of the key components and features of the boot process are listed below. The remainder of this article will provide further details and usage on each.

  • Boot Monitor. Executes at power-up or reset. Decompresses Application, performs system verification and jumps to application to begin execution.
  • Application. Your custom program/application that runs when things are working properly.
  • Configuration Server. Runs as part of the Application. For recovery, the boot sequence can be aborted in the initialization process (the init() function in UserMain() will not return), enabling you to change configuration parameters or upload a new application. Note that the application must be able to boot and run to the init() function to use this feature. The Configuration Server can be accessed through the web server interface or the serial console port. A new application can be uploaded to the device through any of the following:
    • Configuration Server web page at <device IP>:20034
    • nbupdate utility
    • wget utility
    • serial console interface
  • Alternate Boot Monitor. Used as part of a recovery method when aborting to the Configuration Server is not possible. There are two use cases:
    • If you can abort to the Configuration Monitor but are unable to load a new application for some reason, you can issue the command "ABOOT" through the serial console and the device will reboot to the Alternate Boot Monitor without having to use the jumper recovery procedure. You can then issue the "Erase All" command to erase Flash memory.
    • If there is no application programmed into the device, it will boot to the Alternate Boot Monitor.
    • If the application is crashing before UserMain() starts, such as a crashing global constructor, you will need to boot to the Alternate Boot Monitor with the recovery jumper procedure described later in this article.



Boot Sequence Overview

Normal Boot

For a properly running application. Boot Monitor starts, decompresses application to RAM, performs system checks, then jumps to the start of the application.

Incorrect Network Settings

Symptom:** The application boots and runs, but the network IP settings are such that the device cannot communicate. Resolution:** Abort to the Configuration Server and modify network settings with serial console interface.

Application Starts, But Traps After Application Initialization

Symptom:** The application boots and can run to the point of initialization (the init() function in UserMain()), but traps afterwards.
Resolution:** Abort to the Configuration Server and upload corrected application.

Application Starts, But Traps Before Application Initialization

Symptom:** The application traps immediately upon boot. The Configuration Server is not accessible.
Resolution:** Abort to the Alternate Boot Monitor and upload corrected application. Access through the serial console interface or telnet.



Procedure to Abort to the Configuration Server

Abort the boot sequence and run the Configuration Server, accessible on the web interface and serial console interface.

  • Run a serial terminal such as MTTTY and connect to the device serial console interface.
  • Reset or power cycle the module.
  • Press the "A" key when the message: Type "A" to Abort is displayed. Note that "A" is the default abort command, but the command is configurable in the Configuration Server settings. If the abort command is different, use that command instead of "A".
  • At the > prompt you can now type serial console commands, or use the web interface if you have network connectivity.
  • A new application can be uploaded as described int he Uploading a New Application section.



Uploading a New Application

The following application update methods can be used from the Configuration Server or Alternate Boot Monitor.

Web Page Upload

  • Locate the device using discover.netburner.com, the localdiscover utility, or open a web browser and type the device address in the URL field: <device IP>:20034. For example, 192.168.1.10:20034.
  • In the Update Application section, select the new .bin file to download and select the Send File button.

NBUpdate

  • Open a command prompt.
  • Type nbupdate <file name> <device IP>

Serial Console Interface

Note
MTTTY is a serial terminal program. You should be able to use any serial terminal program of your choice. When starting the download the binary file must be sent as text or raw data.
Warning
The .bin file is a binary file. You must have serial software flow control disabled. If using MTTTY, from the main menu select TTY > Flow Control and uncheck both Xon/Xoff Input Control and Xon/Xoff Input Control. Otherwise the data stream will be corrupted.
  • At the > prompt, type fla into the serial prompt and then hit enter.
  • At the message 'Begin Download', start the file download (if using MTTTY, type the F5 key).
  • When the file window opens, navigate to the .bin application file that you want to load.
  • Hit 'Open', and the application will start the load process.



Procedures to Abort to the Alternate Boot Monitor

There are three instances in which the Alternate Boot Monitor is needed for device recovery. A new application can be uploaded as described in the Uploading a New Application section.

No Valid Application

If no application had been programmed into the device, or the checksum verification fails when an application is decompressed from Flash to RAM, the Boot Monitor will automatically jump to the Alternate Boot Monitor.

Configuration Server Access Operational

If the Configuration Server can run but code updates are not working correctly, the "ABOOT" command can be used on the Serial Console Interface to invoke the Alternate Boot Monitor without having to perform the jumper recovery procedure.

Application Traps Before UserMain() Starts

If the application is crashing before UserMain() starts, such as a crashing global constructor, access to the Configuration Server is not possible as it is part of the application. Your only choice will be to access the Alternate Boot monitor with the recovery jumper. Please see the recovery jumper procedure section.



Hardware Jumper Recovery

In a situation in which the device is completely unresponsive, continually trapping prior to the "Type A to Abort" prompt, or if there is no access to the device's serial console interface, shorting the recovery pad to ground on the device (referred to as "jumper recovery") can be used to abort the boot process and run the Alternate Boot Monitor. The device will then be ready to receive a new application using any of the procedures described in the download a New Application section.

Recovery Jumper Operation

The recovery pad can be shorted with a jumper in two ways:

  • Short Hold: Boot to Configuration Server. Loads existing configuration and mount file system. Remove shorting jumper right after reset or power-on. The device should now be running the Configuration Server which can be accessed via the serial console interface or web interface.
  • Long Hold: Boot to Alternate Boot Monitor. Do not load existing configuration or mount file system. Hold shorting jumper in place throughout the entire boot process until the Alternate Boot Monitor command prompt appears in the serial console interface or the network LEDs on the RJ-45 jack become active. Application Flash is not accessible except for the Erase All command in the Alternate Boot Monitor. After erasing Flash memory, the next time the device boots it will reset to factory defaults.
Note
A Long Hold will initialize the device to factory default settings, such as network configuration set to DHCP, AutoIP enabled and Local Discovery enabled.

Procedure

  • Power off the device.
  • Short the jumper recovery pad to the nearby ground pad or some other accessible ground location with a shorting jumper or wire.
  • Reset or power on the device.
  • Hold shorting jumper in place for either a Short Hold or Long Hold.
  • Remove the jumper or wire.



Recovery Jumper Location

The recovery pad and ground pad are located on the corner of the module between P2 and P3. Using a pair of tweezers may be easiest for shorting the two pads. Alteratively, the recovery pad can be shorted to any ground pin to achieve the same result, which may be easier, especially if using the DEV-SOMRT1061 development board.