Embedded Target for Motorola MPC555    

Downloading Application Code

The following sections describe how to download generated image files and run generated code on the target hardware. They also describe how to download to RAM and to flash memory, via either the BDM port, or via CAN.

Downloading the Application Code to RAM

To download application code to RAM, you must generate a code file in Motorola S-record format, which is suitable for downloading and execution in RAM. To do this, select the RAM option from the Target memory model menu in the MPC555-DK (real-time) options category of the Real-Time Workshop pane. The build process creates two files in the working directory:

You can download to RAM:

Downloading the Application Code to Flash Memory

To download application code to flash memory, you must generate a code file in flash binary format, which is suitable for downloading and execution in flash memory. To do this, select the FLASH option from the Target memory model menu in the MPC555-DK (real-time) options category of the Real-Time Workshop pane. The build process creates the files model_flash.bin and model_flash.out in the working directory. The model_flash.bin file contains an image of the executable code. The model_flash.out file contains symbols suitable for use with a symbolic debugger such as Wind River SingleStep.

You can download to flash memory:

Downloading the Application Code
to Flash Memory via BDM and SingleStep

You can use SingleStep to download application code to flash memory via the BDM port. The procedure is almost identical to that for downloading boot code to flash memory.

If you have not created shortcuts to SingleStep, as described in Configure Shortcuts to SingleStep, do so before proceeding. Then, follow the download procedure given in Configuring SingleStep and Downloading Boot Code, with the following differences:

  1. Start SingleStep using the shortcut file SingleStep On Chip (MPC5xx) for Flash.
  2. In the Setup tab of the Flash Programmer dialog box, enter the session file name:

    matlabroot\toolbox\rtw\targets\mpc555dk\common\drivers\app_startup\app_flash.pts

  3. The application code must be programmed into memory starting at the second bank of flash memory. On the Program/Verify pane of the Flash Programmer dialog box, set the Bank, Sector field to 1,1 and the Address field to 0x00008000.
  4. On the Program/Verify pane of the Flash Programmer dialog box, enter the name of your application, model_flash.bin, as the S-record or Binary Image File.

Downloading Application Code to Flash Memory via CAN

You can use the Download Control Panel to download generated application code to the MPC555 flash memory.

To download application code to flash memory, you must generate a code file in flash binary format, which is suitable for downloading and execution in flash memory. To do this, select the FLASH option from the Target memory model menu in the MPC555-DK (real-time) options category of the Real-Time Workshop pane. The build process creates the file model_flash.bin in the working directory.

Do the following before you begin:

To download the generated model_flash.bin file to RAM:

  1. Type the following command at the MATLAB command prompt:
  2. The Download Control Panel window opens.
  3. Select Flash application code from the Download type menu.
  4. Enter the name of the file to be downloaded into the Filename field. Alternatively, you can use the Browse... button to navigate to the desired file. The Download Control Panel should now appear as shown in this picture.

  1. Click on the CAN Options tab. If necessary, select an appropriate card/port from the CAN hardware pop-up menu. The default settings for the other parameters are appropriate for the default boot process. This picture shows the CAN Options configured for a Vector-Informatik CAN-AC2-PCI card, channel 1.

  1. The next step is to download code. The default method for download over CAN requires that you manually reset the target processor in order for the download process to begin. Under the following conditions, you do not have to reset the target processor:
    1. There is an application currently running on the target.
    2. The application running on the target implements the CAN Calibration Protocol (as described in "Downloading Boot or Application Code via CAN Without Manual CPU Reset" on page 3-32).
  1. If the conditions a and b given in Step 6 are not met, you must download by the default method. Click on the Download tab. Then click on the Download button, and immediately press the reset button on your PhyCORE-MPC555 board.
  2. Downloading commences, and the Download button caption changes to Stop.
  3. While downloading proceeds, numerous messages are displayed in the MATLAB command window. A successful download ends with the following messages:
  1. After the download, the Stop button caption changes back to Download.

    If the download does not succeed, reset the board and return to step 6.

    You can monitor the progress of the flash download using a program such as CANalyzer. Alternatively, you can use the btest32 utility supplied with the Vector Informatik driver software. You can invoke the btest32 utility from the PC command prompt. The following example runs btest32 with a baud rate of 500000:

  1. Close the Download Control Panel window.

Once the download process is complete, the application starts running immediately on the target hardware.


  Downloading Boot Code Downloading Boot or Application Code via CAN Without Manual CPU Reset