Pyxos FT EVK Evaluation Kit 1.0 Patch 1

ReadMe File
August 2009

Copyright © 2009 Echelon Corporation
All Rights Reserved

1      Overview

This file contains important information about the patch 1 update to the Echelon Pyxos FT EVK Evaluation Kit 1.0.  It describes the problem fixed, as well as how to install the patch files to update a Pyxos FT EVK Evaluation Kit 1.0 installation.

This package updates the example applications included with the Echelon’s Pyxos FT EVK Evaluation Kit 1.0.  It describes the changes made to the example projects and applications, as well as how to install the updated example files.  You must have previously installed the Echelon’s Pyxos FT EVK Evaluation Kit 1.0 in order to apply this patch.

For the latest information about updates to the Pyxos FT EVK Evaluation Kit product and examples that it contains, see the Pyxos Web page at www.echelon.com/pyxos.

2      Contents

1        Overview.. 1

2        Contents. 1

3        Problem Fixed. 2

4        Contents of the Patch. 2

5        Installation Instructions. 2

6        Changes Made. 2

6.1         Project Files. 3

6.2         Linker Configuration. 3

6.3         CStartup.s79 and IRQ_Handler.s. 3

6.4         init.c. 4

6.5         flash.c and interrupts.s79. 4

6.6         PilotFlash.c. 4

6.7         psImpl.c. 5

 

3      Problem Fixed

Echelon’s Pyxos FT EVK Evaluation Kit 1.0 includes example applications built using IAR Embedded Workbench for ARM 4.31a Kickstart.  These examples cannot be built using IAR Embedded Workbench for ARM 5.0 Kickstart or later.  This update addresses this issue by providing projects and source files that are compatible with IAR Embedded Workbench for ARM 5.40 Kickstart.

4      Contents of the Patch

This zip-format patch includes the following files:

  1. EvkPilot.eww, EvkPilot.ewp and EvkPilot.ewd
    Updated versions of the IAR project files for the Pyxos FT EV Pilot example.
  2. EvkActuatorPoint.eww, EvkActuatorPoint.ewp and EvkActuatorPoint.ewd
    Updated versions of the IAR project files for the Pyxos FT EV Actuator example application.
  3. at91SAM7S64_NoRemap.icf
    A new linker command file, compatible with IAR version 5.x.  This replaces at91SAM7S64_NoRemap.xcl.
  4. IRQ_Handler.s
    A new assembly source file to handle IRQ interrupts.  Previously this function was handled by the obsolete Cstartup.s79.
  5. init.c, flash.c, PilotFlash.c and psImpl.c
    Updated versions of these files to support changes in IAR 5.x

5      Installation Instructions

To install this patch, uncompress the zip file into your Pyxos FT EVK folder (typically, this will be at C:\Program Files\Echelon\Pyxos FT EVK).  Because this will overwrite the existing IAR project files and some source files, you may wish to backup your Pyxos Network Example folder (typically at C:\Program Files\Echelon\Pyxos FT EVK\Pyxos Network Example) prior to unzipping the patch.

6      Changes Made

The sections below describe the changes included in this update.

6.1    Project Files

The project files for both the Pyxos FT EV Pilot example and the Pyxos FT EV Actuator example applications were modified as follows:

  1. Automatically converted by IAR Embedded Workbench for ARM 5.40 Kickstart.
  2. In the Linker Config settings for both the Flash Debug and Flash Release, overrode the default linker configuration file to use “$PROJ_DIR$\..\AT91SAM7S64\resource\at91SAM7S64_NoRemap.icf”.
  3. Removed the obsolete source file“CStartup.s79” (under Source\CStartup).
  4. Add new source file “Pyxos Network Example\AT91SAM7S64\SrcIAR\IRQ_Handler.s” (under Source\CStartup).

In addition, the project files for the Pyxos FT EV Pilot example were modified to remove the obsolete source file Interrupts.s79 (under Source\Flash).

6.2    Linker Configuration

IAR 5.x requires a new linker configuration format.  The file at91SAM7S64_NoRemap.icf replaces at91SAM7S64_NoRemap.xcl with equivalent linker configuration.

6.3    CStartup.s79 and IRQ_Handler.s

The previous examples included CStartup.s79.  This file is now obsolete (as are all assembly source files).  The updated project files use the standard CStartup.s file provided by, and automatically included by the IAR toolkit.  However, there are some functional differences between the CStartup.s79 previously used by the examples the standard CStartup.s, as described below:

  1. CStartup.s79 handled IRQ interrupts.  This is now handled by the new file IRQ_Handler.s.
  2. CStartup.s79 enabled interrupts.  This is now handled by the updated version of init.c.
  3. CStartup.s79 called AT91F_LowLevelInit();  This is now handled by the updated version of init.c.
  4. CStartup.s79 included the default interrupt handlers AT91F_Default_FIQ_handler and AT91F_Default_IRQ_handler.  These are now defined in init.c.

6.4    init.c

Changed to support new startup model as described in the previous section.  Specifically:

  1. Added the following include statement:

#include "intrinsics.h"

  1. Added the following statement as the first line of the function arm7Init:

    AT91F_LowLevelInit();

  1. Add the following statement as the last line of the function arm7Init:

    __enable_interrupt();

  1. Add the following functions to init.c (just after SpuriousInterruptHandler, for example):

void AT91F_Default_FIQ_handler(void)

{

    while (1);

}

 

void AT91F_Default_IRQ_handler(void)

    while (1);

}

6.5    flash.c and interrupts.s79

The functions AT91F_disable_interrupt and AT91F_enable_interrupt were defined in the now obslete interrupts.s79.  Calls to these functions have been changed to use the intrinsics __disable_interrupt and __enable_interrupt:

  1. Added the following include statement:

#include "intrinsics.h"

  1. Removed the following two lines:

extern  void AT91F_disable_interrupt(void);

extern  void AT91F_enable_interrupt(void);

  1. Globally replaced “AT91F_disable_interrupt()” with “__disable_interrupt()”
  2. Globally replaced “AT91F_enable_interrupt()” with “__enable_interrupt()”

6.6    PilotFlash.c

The Pilot used to store data in a page of flash allocated using “segments”.  The IAR no longer supports “segments”, but instead support “sections”.  The linker configuration file at91SAM7S64_NoRemap.icf defines a flash data section, and PilotFlash.c was modified to use this section as follows:

  1. Replaced the following lines:

#define PERSISTENT_FLASH_PAGE (((unsigned int)&flashData)/FLASH_PAGE_SIZE_BYTE)

#define PERSISTENT_MEMORY(page) \

    ((unsigned int)(( unsigned int *) AT91C_IFLASH + \
     ( page * FLASH_PAGE_SIZE_LONG)))

 

// Declare the flash data in a separate flash sector

__no_init NonVolatilePointInfo flashData @ "FLASH";

 

With:

#define FLASH_DATA_ADDR \
    ((NonVolatilePointInfo *)__section_begin("FLASH_DATA"))

#define PERSISTENT_FLASH_PAGE   \
  ((((unsigned int)FLASH_DATA_ADDR) - \
   (( unsigned int) AT91C_IFLASH))/FLASH_PAGE_SIZE_BYTE)

#define PERSISTENT_MEMORY(page) \
   ((unsigned int)(( unsigned int *) AT91C_IFLASH + \
    ( page * FLASH_PAGE_SIZE_LONG)))

 

/* Declare the flash data in a separate flash sector */

#pragma section = "FLASH_DATA"

 

  1. As the first line of function ReadNonVolatileData, added following pointer declaration:

    NonVolatilePointInfo *pFlashData = FLASH_DATA_ADDR;

 

  1. Globally replaced “flashData.” With “pFlashData->”.
  2. Globally replaced “&flashData” with “pFlashData

6.7    psImpl.c

Due to improved compiler optimization, data that is modified by an interrupt routine and checked by another function must now be declared using the non-volatile keyword.  The updated version of psImpl.c was modified to support these optimizations as follows:

  1. Changed the definition of global variable driver to use the volatile keyword.  Change line 67 from:

LfsDriver driver;

to:

volatile LfsDriver driver;

 

  1. Changed line 69 from:

unsigned char* const PS_PBUFFER = &driver.buff[2];

to:

unsigned char* const PS_PBUFFER = (unsigned char *)&driver.buff[2];

 

  1. Changed line 208 in function psWrite from:

lfs_getOpCode(addr, 1, &driver.buff[0], &driver.buff[1]);

to:

lfs_getOpCode(addr, 1, (unsigned char *)&driver.buff[0],
                        (unsigned char *)&driver.buff[1]);

 

  1. Changed line 239 in psRead from:

lfs_getOpCode(addr, 0, &driver.buff[0], &driver.buff[1]);

to:

lfs_getOpCode(addr, 0, (unsigned char *)&driver.buff[0],
                        (unsigned char *)&driver.buff[1]);