TOC PREV NEXT



3.6 Using SNiFF+

In this section, you will learn how to use SNiFF+ to perform some basic development tasks. You can:

From pRISMSpace Wizard, select SNiFF+ as your development tool of choice.

3.6.1 Choosing a pSOSystem Sample Application As a Starting Point

This tutorial will use a pSOSystem sample application, pdemo, to show you how to use pRISM+ tools. The steps are as follows:

  1. From pRISMSpace Wizard, choose Start with a pSOSystem example application, then click Next.
  2. From the list of sample applications, select pdemo, then click Next.

3.6.2 Setting Up a New Project

NOTE:   When you start with a pSOSystem sample application, the pRISMSpace name is, by default, the same as the name of the pSOSystem sample application you're using. It is not user modifiable. You will also notice that the pRISMSpace directory is not user modifiable. The reason for this is explained in the exploring SNiFF+ section.

Click Finish to exit pRISMSpace Wizard. pRISM+ will place your pRISMSpace file in the pRISMSpace directory. This will also start SNiFF+.

pRISM+ Manager will start SNiFF+ and open a shared version of the sample application pdemo in your private workspace.

This completes the steps of configuring your first pRISMSpace.

3.6.3 Getting Acquainted with SNiFF+

pRISMSpace Wizard will start SNiFF+ for you and open the pdemo application. When this is successful, you will see the SNiFF+ Project Editor window showing the pdemo project as in Figure 3-9 on page 3-14.

NOTE:   Extensive on-line help is available for SNiFF+. To access on-line help, click the ? in the SNiFF+ menu bar as shown in Figure 3-8.


FIGURE 3-8 SNiFF+ Launch Window

Looking At pdemo with SNiFF+ Project Editor

Now let's use SNiFF+ to look at the pdemo sample application (see Figure 3-9 on page 3-14). SNiFF+ offers a hierarchical project view. You can see the individual source files as well as the overall project structure. Some points of interest are:

Project Hierarchy


FIGURE 3-9 SNiFF+ Project Editor (PE) Window

Note the project structure that contains other parts of pSOSystem needed by pdemo are in the Projects area. This source project is made up of pSOSystem include files (include.shared), operating system components files (os.shared), system configuration files (configs.std.shared), and the BSP projects (bsp.shared and bsp-src.shared).

NOTE:   Ensure that the BSP shown in the Project Editor window matches the board you are using.

NOTE:   If the BSP shown does not match what you plan to use for the tutorial, select PrismSpace > Settings from pRISM+ Manager to change the BSP setting as shown in Figure 3-10.


FIGURE 3-10 Project Settings Dialog Box

Editing a File with SNiFF+
To edit any file, double click on the name of the file in the Project Editor (PE) window.

NOTE:   There are TWO exceptions:
    • pSOSystem Configuration File sys_conf.h
      (Double click opens the pRISM+ Wizard)
    • Project Description Files like <project name>.shared and <project name>.proj
      (Double click opens the PE)
They can be edited in the SE using the context menu entry "Edit".

NOTE:   The pSOSystem SNiFF+ integration implements file sharing out-of- the-box. In order not to corrupt shared files, after you complete this tutorial refer to Chapter 6 on how to use SNiFF+ in your development environment.

NOTE:   You do not need to change anything in the pdemo sample application to be able to continue with the tutorial.

Configuring pSOSystem for Your Application

Associated with each pSOSystem sample application is a pSOSystem configuration file called sys_conf.h. This file is used to specify which OS components are to be included in an application and how these components are configured.

Use this procedure to configure your application for pSOSystem.

  1. To see the default setup for the pdemo sample application, double click on sys_conf.h in the file list to bring up the pRISM+ Configuration Wizard.

NOTE:   The default editor for sys_conf.h (the pSOSystem configuration file) is the pRISM+ Wizard, and not the default SNiFF+ Source Editor tool.

  1. If you choose to use the SNiFF+ Source Editor, right click on sys_conf.h and choose the Edit option.

NOTE:   You do not need to change anything to continue with the tutorial.

Browsing pSOSystem with SNiFF

We will use some simple examples to see how SNiFF+ can help you understand pSOSystem code by allowing you to browse and navigate the pSOSystem source tree.

First look at how the configuration parameters in the sys_conf.h file are used to configure pSOSystem. Specifically, let's see what happens in pSOSystem when you select the pSOS+ component. To do so, follow these steps.

  1. Right click on sys_conf.h in the PE window.
  2. Choose the Edit option from the pop-up menu to open sys_conf.h in the Source Editor window. From the Source Editor window you will see that SC_PSOS is set to YES for pdemo.
  3. Locate and highlight SC_PSOS and select Info > Retrieve SC_PSOS from all source projects.

You will see a list of every instance in pSOSystem where this parameter is used (see Figure 3-11 on page 3-17). You can then navigate to a pSOSystem configuration file sysinit.c where all the OS component initialization routines are called if the component is enabled in sys_conf.h file.


FIGURE 3-11 SNiFF+ Retriever (RE) Window

The following steps show how the SNiFF+ Symbol Browser ("SB") can help you to quickly access any function of interest, and how the SNiFF+ Cross Referencer can help you to see call relationships between functions.

  1. From the PE window, select Tools > Symbol Browser to bring up the SNiFF+ Symbol Browser tool.
  2. Use SB to look for a function called PsosSetup as shown in Figure 3-12 on page 3-18. If Select from All Projects has not already been selected, you must do the following:
    1. Select pdemo.shared; right-click it.
    2. Select Select from All Projects.
    3. In the Filter tab, type in PsosSetup.
    4. Press Enter to search for the function PsosSetup in the pdemo project.


      FIGURE 3-12 SNiFF+ Symbol Browser (SB) Window

  3. If Select from All Projects has already been selected, double-click on PsosSetup to take you to the source file where this function is implemented.
  4. To see all the other functions PsosSetup refers to, from the SE window choose Info > PSOSSetup Refers-To. This will open the SNiFF+ Cross Referencer.

You will see a call tree that consists of PsosSetup and all the functions that it refers to. From here, you can see exactly how pSOS+ is configured.

Building a Target Executable

Return to the Project Editor (PE) window to build and compile your sample application to produce a target executable. In the PE window, highlight pdemo.shared and select Target Make ram.elf.

This concludes the brief SNiFF+ tutorial. For more information on using SNiFF+, see Chapter 6, Using SNiFF+ in the pRISM+ Environment.

To download the executable you have just built to the target, see Section 3.8, Configuring the Target Communications Parameters.


TOC PREV NEXT