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
Summary of Contents for EX-USB FX3
Page 8: ...8 FX3 Programmers Manual Doc 001 64707 Rev C Contents...
Page 12: ...12 FX3 Programmers Manual Doc 001 64707 Rev C Introduction...
Page 48: ...48 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Overview...
Page 74: ...74 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Firmware...
Page 76: ...76 FX3 Programmers Manual Doc 001 64707 Rev C FX3 APIs...
Page 84: ...84 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Application Examples...
Page 98: ...98 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Application Structure...
Page 148: ...148 FX3 Programmers Manual Doc 001 64707 Rev C FX3 P Port Register Access...
Page 165: ...FX3 Programmers Manual Doc 001 64707 Rev C 165 FX3 Development Tools Click next...
Page 178: ...178 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools Click on Apply...
Page 180: ...180 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools d Start the GDB server...
Page 185: ...FX3 Programmers Manual Doc 001 64707 Rev C 185 FX3 Development Tools...
Page 186: ...186 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools...
Page 187: ...FX3 Programmers Manual Doc 001 64707 Rev C 187 FX3 Development Tools...
Page 188: ...188 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools...
Page 192: ...192 FX3 Programmers Manual Doc 001 64707 Rev C GPIF II Designer...