FX3 Programmers Manual, Doc. # 001-64707 Rev. *C 87
FX3 Application Structure
8.1.1.2 Tool Chain Initialization
The next step in the initialization sequence is the tool chain initialization. This is defined by the
specific Toolchain used and provides a method to initialize the stacks and the C library.
As all the required stack initialization is performed by the firmware entry function, the Toolchain
initialization is over ridden, i.e., the stacks are not re-initialized.
The tool chain initialization function written for the GNU GCC compiler for ARM processors is
presented as an example below.
.global CyU3PToolChainInit
CyU3PToolChainInit:
# clear the BSS area
__main:
mov R0, #0
ldr R1, =_bss_start
ldr R2, =_bss_end
1:cmp R1, R2
strlo R0, [R1], #4
blo 1b
b main
In this function, only two actions are performed:
■ The BSS area is cleared
■ The control is transferred to the main()
8.1.1.3 Device Initialization
This is the first user defined function in the initialization sequence. The function main() is the C
programming language entry for the FX3 firmware. Three main actions are performed in this
function.
1. Device initialization: This is the first step in the firmware.
status = CyU3PDeviceInit (NULL);
if (status != CY_U3P_SUCCESS)
{
goto handle_fatal_error;
}
As part of the device initialization:
a. The CPU clock is setup. A NULL is passed as an argument for CyU3PDeviceInit() which
selects the default clock configuration.
b. The VIC is initialized
c. The GCTL and the PLLs are configured.
The device initialization functions is part of the FX3 library