Introduction
The CY3663 EZ-Host and EZ-OTG Development Kit contains
a full set of standard GNU-based tools. These tools have
been ported to our CY16 processor-based EZ-Host and
EZ-OTG products. This application note describes how to
build a simple stand-alone project with these tools that will run
in either debug mode or out of an EEPROM. This document
is intended to help those less familiar with the GNU devel-
opment environment. It is not intended to be a complete tools
reference, but rather a quick example to get you familiar with
the tools.
The example in this document is presented from start to finish
and is all-inclusive. To make things easier to follow, this
example does not have any dependencies on ROM BIOS
code (except for initialization), Frameworks, Makefiles, or any
other presupplied code that the design examples in our
CY3663 development kit use. It is strongly recommended that
production designs do not start from scratch as this example
does. Instead, production designs should rely heavily on our
BIOS and Frameworks code. For more information on devel-
oping around the BIOS and Frameworks, please see the book
USB Multi-Role Device Design by Example included in the
CY3663 development kit.
Required Tools Components
Below is a list of tools that are required to build and run the
example in this application note (or any other project, for that
matter). All of the required tools listed below, including many
other tools, are installed automatically when the CY3663 CD
is installed. In fact, these tools have many environmental
dependencies in order to work properly that are also automat-
ically handled by the install, so please properly install the
CY3663 CD before attempting to build an EZ-Host or
EZ-OTG project. For complete documentation on all utilities
below, including standard RedHat GNUPro documentation,
please refer to the CY3663 documentation folder.
Cypress Semiconductor Corporation
• cy16-elf-gcc: Port of standard GNU GCC compiler
• cy16-elf-as: Port of standard GNU GAS assembler
• cy16-elf-ld: Port of standard GNU LD linker
• cy16-elf-objdump: Port of standard GNU objdump
• cy16-elf-objcopy: Port of standard GNU objcopy
• cy16-elf-gdb: Port of standard GNU GDB debugger
• cy16-elf-libremote: Port of standard GNU libremote
• scanwrap: Cypress-developed utility
• qtui2c: Cypress-developed utility
• BASH_ENV.BAT: Cypress-developed batch file
Building an EZ-Host/OTG Project From Start to Finish
•
3901 North First Street
Buttons and Lights Example Description
To properly understand how to use these tools, it is best to
actually build a simple project. This application note uses the
ever-popular Buttons and Lights as that example. Buttons
and Lights is a very basic application so as to allow focus to
remain on the tools, but at the same time presents a visual
indication that the code is running. It should be noted that this
is not the same Buttons and Lights example presented in the
USB Multi-Role Device Design By Example book.
The Buttons and Lights example presented here can run on
either the EZ-Host or EZ-OTG stand-alone boards shipped
with the CY3663 development kit. When this code is running,
pressing the S5 button will turn ON LEDs D1, and D9:D7.
When button S1 is pressed, these LEDs will turn off.
The EZ-Host and EZ-OTG stand-alone boards indirectly
memory map these LEDs and buttons through the U8 CPLD.
Therefore, this example bit bangs a standard memory
interface to RD/WR the CPLD. A complete description of
these boards, including the CPLD indirect memory map, is
included in the CY3663 Hardware Users Manual included
with the CY3663 kit.
Steps for building the Buttons and Lights example are
covered in later sections of this application note.
Buttons and Lights Project Files
Below is a short list of the files that make up this Buttons and
Lights example.
BAL.c File Description
This file contains a simple main routine along with functions
to read and write the CPLD. The main routine is just a
“while(1)” loop that looks for button presses and illuminates
the LEDs as appropriate.
StartupNoBIOS.s/StartupWithBIOS.s File Description
The default GNU start-up code is generally contained within
crt0.s. The crt0.s file contains a lot of code overhead in
functions that are rarely used for embedded applications.
Therefore, we will supply our own start-up code in a.s file and
instruct the compiler to use it instead of the default crt0.s file.
This will save quite a bit of code space. For more information
on minimizing code space by not using crt0.s, please see the
OTG-Host Boot Code Design white paper included in the
CY3663 kit.
• BAL.c
• StartupNoBIOS.s or StartupWithBIOS.s
• cy7c67200_300.h
• BAL.ld
•
San Jose
,
CA 95134
August 20, 2003, rev. 0.A
•
408-943-2600