Disable The Watchdog In Pre-Initialization - Texas Instruments LaunchPad MSP-EXP430F5529LP User Manual

Table of Contents

Advertisement

www.ti.com
3.5.2
Pre-Initialization
Pre-initialization refers to the activity that happens before the first line of main().
As described for the simpleUsbBackchannel example (see
development to disable the watchdog at the beginning of execution. But for some application programs,
including this demo, there's a twist. Programs that contain a large amount of allocated RAM may never
reach the first line of main(). This is because the first line of execution of a C program is not actually the
first line of main(); instead, the compiler inserts code prior to main that handles preparatory functions, like
initializing variables.
So if the amount of allocated RAM is large enough, the time required to initialize it may exceed the
watchdog's expiration time. To the developer, this appears as execution never quite arriving to the first line
of main().
A solution to this is to define a pre-init function. In CCS, this is the function _system_pre_init(); in IAR, it is
the function __low_level_init(). The developer can write code here that executes immediately after a reset,
before RAM is initialized. When large amounts of RAM are allocated, it can be necessary to hold the
watchdog here.
The F5529 LaunchPad software demo does this.
system_pre_init.c file in the project and the function inside it.
3.5.3
Initialization
This demo uses driverlib somewhat more heavily than the simpleUsbBackchannel example does. driverlib
is used for the initialization of clocks, power, and ports. The use of driverlib makes the code appear
different in the two examples, but the same actions are being taken. See
information on how to initialize these functions and initialize USB.
The following sections describe initialization that is unique to this example.
3.5.3.1
Configuring the Keyboard
The keyboard function must be initialized before operation. Keyboard.c maintains a report structure that
will later be sent by the USB API.
3.5.3.2
Configuring the MSC Interface
The MSC interface also must be initialized. First, initMscIntf() obtains from the USB API a pointer to a
structure that will later be used to exchange information about SCSI READ and WRITE commands. It also
registers with the API the location of a RAM buffer that the application has allocated for the exchange of
block data during READ and WRITE commands.
SLAU533B – September 2013 – Revised June 2014
Submit Documentation Feedback
Figure 29. Disable the Watchdog in Pre-Initialization
MSP-EXP430F5529LP LaunchPad™ Development Kit User's Guide
Copyright © 2013–2014, Texas Instruments Incorporated
Section
3.6.5.1), it is often convenient during
Figure 29
shows the implementation of both the
Section 3.6.5
Software Examples
for more
35

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LaunchPad MSP-EXP430F5529LP and is the answer not in the manual?

Table of Contents