About the QP-lwIP Integration using Code Sourcery G++ ===================================================== Because of the use of the Cortex Microcontroller Software Interface Standard (CMSIS), the source code for the QP-lwIP integration using Code Sourcery G++ is *identical* to the integration using the IAR EWARM. Therefore, the Application Note "QP and lwIP TCP/IP" (included in PDF in the code download) is fully applicable to the QP-lwIP integration with Sourcery G++. The only differences between the two toolchains are in the build process and debug environment, which are briefly outlined below. Building and Debugging the QP-lwIP Example with Sourcery G++ ============================================================ The QP-lwIP example has been tested with the Stellaris EV-LM3S6965 board from Texas Instruments and Sourcery G++ for ARM-EABI Professional Edition (http://www.codesourcery.com/sgpp/professional_edition.html). The example can be built from command line or from the Sourcery G++ IDE (Eclipse). The provided Makefile is designed to be used in both cases. The Makefile also supports building the Debug, Release, and Spy configurations. The Makefile provided with this project assumes that the environment variable QPC is defined and it points to the location of the QP/C framework. For example, assuming that you have installed QP/C into the directory C:\software\qpc, you should define the environment variable QPC to C:\software\qpc. Editing the Environment Variables on Windows -------------------------------------------- Open the Windows Explorer and right-click on the Computer icon. Then select Properties from the pop-up menu. This opens a window with the basic information about your computer. In the left panel of this window, click on "Advanced system settings". This opens the dialog "System Properties". Click the "Environment Variables..." button. To add a new environment variable, click the "New..." button in the System variables section and provide the variable name (e.g., QPC) and value (e.g., C:\software\qpc). Editing the Environment Variables on Linux ------------------------------------------ You need to edit the ~/.bash_profile file to add the following line: export QPC=~/qpc assuming that you have installed QP/C into ~/qpc. **** NOTE: After updating envrinment variables, you should log off your account and then log on again so that all applications can pick up the changes. **** Building the Examples from Command Line --------------------------------------- The QP-lwIP code contains Makefile, which uses the Sourcery G++ 2010.09-66 toolset. The Makefile assumes that the toolchain is installed in the directory: C:\tools\CodeSourcery\ You need to adjust the symbol GNU_ARM at the top of the Makefile if you have installed the Sourcery G++ toolset in a different location. The Makefile supports two build configurations: Debug (default), Release, and Spy. You choose the build configuration by defining the CONF symbol at the command line, as shown in the table below (the table assumes that you use the Code Sourcery make utility cs-make): Build Configuration | Build command --------------------------------+------------------------- Debug (default) | cs-make Release | cs-make CONF=rel Spy | cs-make CONF=spy Clean the Debug configuration | cs-make clean Clean the Release configuration | cs-make CONF=rel clean Clean the Spy configuration | cs-make CONF=spy clean Building the Examples from Sourcery G++ IDE (Eclipse) ----------------------------------------------------- The example code contains the Eclipse projects for building and debugging the QP-lwIP example with Sourcery G++ Professional Edition. (You need the Professional edition for debugging the code in the embedded target.) The provided Eclipse projects are Makefile-type projects, which use the same Makefiles that you can call from the command line. In fact the Makefiles are specifically designed to allow building all supported configurations from the Sourcery G++ IDE (Eclipce). To use the project in Eclipse, you need to import a Makefile-type project into the Eclipse workspace. The provided Makefiles correctly support the Debug, Relase, and Spy build configurations, which you can choose from the IDE as well as clean targets, so invoking Project | Clean..." menu for any build configuration works as expected. Downloading to Flash and Debugging the Examples =============================================== The provided project files contain pre-configured debug sessions. Once the project is opened in the Sourcery G++, you should see the debug session. Sourcery G++ Professional edition contains the GDB server called the "debug Sprite", which is launched automatically when you start debugging. Contact information =================== Quantum Leaps, LLC 103 Cobble Ridge Drive Chapel Hill, NC 27516 USA info@quantum-leaps.com www.state-machine.com