0 introduction, 0 features, 0 basic operation – ScanTool STN Bootloader User Manual

Page 3: Introduction, Features, Basic operation, Stn bootloader

Advertising
background image

STN

Bootloader

1.0 Introduction

STN Bootloader is a resident program that is

factory programmed into devices designed by OBD
Solutions. Its job is to write application firmware to the
device’s flash memory, allowing the device to be easily
updated in the field. The updates can be used to
remotely fix problems and add new functionality
without the need for costly product recalls.

OBD Solutions provides a free utility called

Firmware Updater (Figure 1) which can be used to
upload new firmware from any computer that supports
the Microsoft .NET framework. This utility is bundled
with every official firmware release.

Unfortunately, in certain circumstances (e.g., in

embedded environments), using the Firmware Updater
may not be feasible. This document is intended to be
used as a reference to allow programmers to
implement the necessary algorithms for interfacing with
STN Bootloader (version 2.x).

Figure 1 – STN Firmware Updater

2.0 Features

STN Bootloader has a number of properties that

make it ideal for carrying out remote updates:

Tamper-proof. The bootloader resides in a

designated ‘boot block’, a small section of
protected program memory, which is
separate from application program memory.
The firmware images are protected from
tampering using strong military-grade
encryption.

Brick-proof. The bootloader checks the

firmware that is being uploaded, to make
sure it is compatible with the device. If the

upload is interrupted, it can be safely
restarted.

Superior noise immunity. Updates can be

done even over unreliable and noisy
connections. The bootloader features a
robust error recovery mechanism, and the
integrity of each data packet is ensured by a
16-bit CRC.

Automatic baud rate detection allows the

firmware updater application to negotiate the
optimal communication baud rate.

3.0 Basic

Operation

Devices that feature the STN bootloader operate in

three distinct modes:

• Startup

mode

• Bootloader

mode

• Normal

mode

On startup, or after a hard reset, the device is in

startup mode, where it waits for a predefined amount
of time (by default, 200 milliseconds) for the bootloader
session to be initiated. If during this time the device
receives a Connect command from the host, it enters
bootloader mode, and remains there until a reset.
Note that the device will not respond to any bootloader
commands until it receives a valid Connect command.

If the bootloader session is not initiated within the

startup mode window, and valid firmware is present,

the device will enter normal mode and run the
application firmware.

If the firmware is not valid (e.g., a firmware upload

was interrupted by a power loss or a reset) the device
will remain in startup mode indefinitely, until it receives
the Connect command.

To enter bootloader mode, the host application

must first reset the device by cycling its power, pulsing
the RESET pin, or issuing a reset command (‘ATZ’ for
STN1100 family devices). After a short pause to give
the device a chance to restart (approximately 50 ms),
send the Connect command to the bootloader. If the
device replies with a “Connect ACK”, consider the
bootloader session started and proceed with the
firmware upload. See section 6.0 Firmware Update
Procedure” for more info
rmation.

STNBLA www.obdsol.com 3 of 12

Advertising