SLAU533D September 2013 – April 2017
Pre-initialization refers to the activity that happens before the first line of main().
As described for the simpleUsbBackchannel example (see Section 3.6.5.1), it is often convenient during 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 development kit software demo does this. Figure 29 shows the implementation of both the system_pre_init.c file in the project and the function inside it.