Reset notes when using the Green Hills Probe
============================================

The MPC5748G has three debuggable cores:
0. e200z4204 (A)
1. e200z4204 (B)
2. e200z210

As determined by flash contents, one or more of the cores exits reset at a
reset vector, while the other cores remain in a holdoff state. In the factory
default configuration, core 0 boots out of reset. 

The 'reset' command is only valid when directed to a core that has a valid
reset vector (such as core 0). If you attempt to reset a core without a valid
reset vector, the probe outputs the message 'Target does not support hardware
reset', and MULTI waits indefinitely for the core to halt post-reset. To
abort this operation, press the 'Escape' key and retry the reset from a core 
with a valid reset vector. If you see this message while programming flash, 
run the flash programmer from a different core. 

If you change the bootable core, (for example, by modifying the boot header), 
you must disconnect from mpserv and then reconnect. 


Flashing a program to the MPC5748G board 
========================================

To program the internal flash memory on the MPC5748G, the RAM base address 
must be set to 0x40000100. In the flash dialog, enter this address in the 
RAM base text field. If you are programming flash using the flash burn 
command, append -rambase=0x40000100 to the command line. The base address 
of flash should point to the beginning of the UTEST block at 0x00400000. 


Core Libraries
==============
If you are building code to run only on the e200z4204 cores, you can enable
EFPU2 library support by adding -cpu=ppc5748gz4204 (Compiler 2013.5 or later)
or -cpu=ppc5746mz420 to the Top Project build options.

If you are building a multicore program targeting e200z4204 and e200z210 cores,
do not use the -cpu option in the Top Project or Program build options. This
will ensure that your program will use software floating point libraries
compatible with the e200z210 core. To selectively add EFPU2 supprot to certain
parts of your program, add -cpu=ppc5748gz4204 or -cpu=ppc5746mz420 to the
build options of applicable files -- either by adding the option to each file
individually, or by grouping files into a subproject and adding the option
to the subproject.

For information about build options, see "Setting Builder Options" in the
"MULTI: Managing Projects and Configuring the IDE" book.


Board Initialization Library
============================
A custom Board Initialization library can be selected when creating a project.
This includes example code for multicore bringup.

* The library is designed to be run from core 0 (z4204A). Make sure to select
  this core when flashing the program. Core 0 optionally bootstraps the other
  cores, and then runs main().

* boot_core_[n]() functions are provided in mpc5748g_boot.c as examples to help
  boot the secondary cores. Each boot_core_[n]() function uses MC_ME writes to
  start the corresponding core at __ghs_mpc5748g_cpu[n]_entry. The core then
  sets up its stack and calls main_core_[n]() if it exists.

  You may call the boot_core_[n]() functions at any point from your core 0
  code. Alternatively, to boot the cores prior to entering core 0 main(),
  un-comment the code in __ghs_board_devices_init() in mpc5748g.ppc.
  
* After connecting to the Green Hills Probe, use the 'new' command twice so
  that the same binary is bound to all three cores. Then, when flashing to ROM,
  use the 'prepare_target -flash -allcores' command from core 0 to flash the
  project and prepare all the cores.

* To restart the program, issue 'reset' from core 0 and then run. Any existing
  breakpoints on core 1 or 2 will be automatically re-installed when they are
  released from reset. 

* Syscalls (including file i/o) and heap allocation are not supported on cores
  1 or 2 when using libboardinit and the standard libsys.

* Breakpoints may not be set or cleared while a core is held in reset. 

* Software breakpoints are not currently supported in code shared by
  multiple cores.
