/* ------------------------------------------------------------------------------------------------ */
/* FILE :        CreatingNewTarget.txt                                                              */
/*                                                                                                  */
/* CONTENTS :                                                                                       */
/*               Instructions to port demos to a new target											*/
/*                                                                                                  */
/*                                                                                                  */
/* Copyright (c) 2019, Code-Time Technologies Inc. All rights reserved.      	             		*/
/*                                                                                                  */
/* Code-Time Technologies retains all right, title, and interest in and to this work                */
/*                                                                                                  */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS                          */
/* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF                                       */
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL                          */
/* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR                             */
/* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,                            */
/* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR                            */
/* OTHER DEALINGS IN THE SOFTWARE.                                                                  */
/*                                                                                                  */
/*                                                                                                  */
/*  $Revision: 1.1 $                                                                                */
/*  $Date: 2019/02/19 01:05:50 $                                                                    */
/*                                                                                                  */
/* ------------------------------------------------------------------------------------------------ */

1 - You need to assign a new platform number for your target as it is not current supported.
    Read the file ../Platform/inc/Platform.h as it explains how to select the platform number and
    what information to add to fully define the new platform.
    Your newplatform number will likely be alike 0xFF#####

2 - You have to create projects for the new target.
    - Select an exiting project with the desired demo.  The current target for that demo is not
      important. Projects directories / folders located in the directory / folder Workspace.
    - Clean that project
    - Copy and Paste that project giving it a new name

3 - In the new project there is a file named Makefile. Edit it:
    - set the new target platform number in the assignment of PLATFORM
    - Add / modify any other set-up as required.

4 - In the new project there is a file with the .launch extension.
    Rename it that will be meaningfull for the demo # and your new target.
    
5 - In the new project there is a file named debug-nonhosted.ds. Edit it
    - You need to use the SPL (U-Boot) tailored for the new platform.
      Search for u-boot - this is the line where the spl is loaded.
      Set the correct path & file name for your spl
    - You need to load on the target the appripritae ELF / image file
      Search for axf  - this is the line where the ELF / image  is loaded.
      Change the file name to the one matching your target (See item 7 -).
      If not sure, once you'll build the demo for the newproject, the .axf file in
      the new project directory / folder is the filename to use

6 - In the Workspace (one level above the projects) there are a few Demo#_GCC.make files
    Look at the one for the desired demo and if at the top of the file there are some
    condition statements based on the platform number, i.e. ifeq ($(PLATFORM), ...
    You need to add a conditional for the new target platform:
        else ifeq ($(PLATFORM), ...
    Make sure to fill all the assignements with the values describing the new platform

7 - In the Workspace (one level above the project) there is a file named Common_GCC.make
    At the top of the file there are some conditional statements based on the platform number,
          i.e. ifeq ($(PLATFORM), ...
    Add a new conditional for the new platform:
        else ifeq ($(PLATFORM), ...
    And set the assignements with the values describing the new platform

8 - Edit the debug configuration
    - In the "Connection" pane, make sure the connection is the one useb with your target
    - In the "Debugger" pane, edit the "Run debug initialization debugger script (.ds/.py)
      to use the dirextory / folder name of your new project
    - Make sure the check box "Use Default" under "Host working directroy" is checked  

NOTE:
    In makefiles, conditionals are performed with string comparisons. So make sure the hex
    value assigned to PLATFORM in the Project's Makefile is exactly the same as the
    value, cases and all digits, used in the comnparison in the ifeq ($(PLATFORM), ...

/* EOF */
