Embedded Target for Motorola MPC555 Release Notes |
Simulation and Co-Simulation
Production Code Generation
Code and Performance Analysis
Web-viewable code generation report includes:
Applications Development and Rapid Prototyping
Device Driver Support
CAN Support
Code Validation and Performance Analysis
Code Validation. Since signal data is available to Simulink during each sample interval in a PIL simulation, you can observe signal data on Scopes or other Simulink signal viewing blocks. You can also store signal data to MAT-files via To File blocks. To validate the results obtained by the generated code running on the target processor, you can compare these files to results obtained using a normal Simulink plant/controller simulation.
Determining Code Size. In control design it is critical to ensure that the size of the generated code does not exceed physical limitations of RAM and ROM. The Embedded Target for Motorola MPC555 automatically produces a code generation report that displays the RAM usage and ROM size of the generated code.
This capability is useful when selecting which code generation optimizations will be used. After determining the size of the required RAM and ROM, you can consider which code generation optimizations to use, and consider modifications to the model design.
Known Software and Documentation Problems
This section describes known software and documentation problems in Version 1.0.1.
Accelerator Mode
Models that contain CAN blocks from the Embedded Target for Motorola MPC555 libraries do not operate properly in Simulink Accelerator mode.
CAN Blocks and CAN Download Control Panel
candnload
utility, require correct installation of a CAN card and drivers from Vector-Informatik.
vcand32.dll
library, and add the path to the location where vcand32.dll
was installed to the Windows system path.
If the system path is not updated correctly, errors in the use of the CAN Drivers (Vector) blockset and the candnload
utility occur.
If however, you are using a CANCardX in a laptop, there may be some differences in the way the CAN transmit queue is flushed. In this case the download may fail. To work around this limitation, make sure there is always at least one enabled CAN device on the CAN bus. One way to do this is to use a Y-cable to connect both CAN ports on your PC together with the CAN port on the target.
If you are using the second CAN port on the PC in this way, you must make sure that it is initialized. To do this, 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:
CAN Calibration Protocol Block Incompatibility
with lcc C Compiler
Due to a current Stateflow limitation, it is not possible to use the CAN Calibration Protocol Block if you use the lcc C Compiler as the default compiler (as designated by the mex -setup
command). "Undefined reference" errors will occur when the model is updated if you attempt to use this block with lcc.
The CAN Calibration Protocol Block is fully compatible with the Microsoft Visual C/C++ compiler. To use the CAN Calibration Protocol Block, you must install Microsoft Visual C/C++ and associated environment variables as described in the "Installing Real-Time Workshop" section of the Real-Time Workshop documentation) and set Microsoft Visual C/C++ to be the default compiler via the mex -setup
command.
This limitation will be removed in a future Stateflow release.
Compiler Optimizations
In some very rare instances, due to compiler defects, compiler optimizations applied to Embedded Target for Motorola MPC555 generated code may cause the executable program to produce incorrect results, even though the code itself is correct.
When using the RT target, you can set the Optimize compiler for option to none to work around problems caused by compiler optimizations.
For the PIL and AE targets, please refer to your compiler's documentation for information on how to lower the optimization level of the compiler or turn off optimizations. Then, having found the optimization switches required, you can enter the options directly into the Make command field in the Target configuration category of the Real-Time Workshop pane of the Simulation Parameters dialog.
By default, the Make command field contains the command
To add your optimization switches, append the following to the make_rtw command:
For example, if the correct switch for your compiler is -O
, the Make command field would contain
Configuration for Non-Default Hardware
The Embedded Target for Motorola MPC555 has been developed and fully tested using Phytec phyCORE-MPC555 development board. We strongly recommend the use of this board for getting started with the Embedded Target for Motorola MPC555.
If you are using different MPC555 hardware, it may be necessary to perform some additional manual configuration. The section Hardware Clock Configuration describes how to configure the Embedded Target for Motorola MPC555 real-time target for use on hardware with external oscillator frequencies other than 20 MHz.
The following sections give additional examples of hardware-specific configuration changes that may be required. This information is not intended to be exhaustive.
Using the PIL Target With Non-Default Hardware
If you are using the Metrowerks CodeWarrior development environment, the relevant hardware configuration settings are contained in
matlabroot
/toolbox/rtw/targets/mpc555dk/pil/BSPs/phyCORE-555/
src/phyCORE-MPC555_BDM_relocate_init.cfg
If you are using the Diab and SingleStep development environment, the configuration settings are contained in
The necessary changes to these files depend on the hardware that you are using. As an example, the following settings should be made for an Axiom CME-555 development board:
BR1
from 0xFFF00001
to 0xFFF00003
(CodeWarrior)
BR1
from 0x00000001
to 0x00000003
(SingleStep)
OR1
from 0xFFE00000
to 0xFFF80002
SCCR
from 0x00000000
to 0x00010000
PLPRCR
from 0x00000000
to 0x00400000
Note that these values are given only as an example.
Depending on your hardware, you may also need to configure switches and jumper settings. Consult the documentation for your development board.
Using the RT Target With Non-Default Hardware
As with the PIL target, the exact changes required for the real-time target will depend on your hardware. You should make the changes to the values for BR1
, OR1
, SCCR
and PLPRCR
by modifying each of the files
matlabroot
/too
lbox/rtw/targets/mpc555dk/common/drivers/ app_startup/mw_ram.wspmatlabroot
/
toolbox/rtw/targets/mpc555dk/common/drivers/ app_startup/mw_flash.wspmatlabroot
/
toolbox/rtw/targets/mpc555dk/common/drivers/ bootcode/bootloader.h
Note that after making any changes to bootloader.h
, you must re-compile the boot code as described in Boot Code Parameters for CAN Download in the Embedded Target for Motorola MPC555 User's Guide.
Default Changed for CCP Block Total Number
of Object Descriptor Tables
The default value for the Total Number of Object Descriptor Tables (ODTs) parameter of the CCP block has been changed to 8
. Formerly, the default value was 254
.
Device Driver Blocks Support Limitations
The Embedded Target for Motorola MPC555 real-time (RT) target supports all blocks in the Embedded Target for Motorola MPC555 libraries.
The Algorithm Export (AE) and PIL targets and Simulink Accelerator also provide limited support for blocks in the Embedded Target for Motorola MPC555 libraries. These limitations will be removed in a future release.
Table 1-1 and accompanying notes summarize the blocks that are supported by each of these targets.
Block or Block Group |
Supported by RT Target |
Supported by PIL Target |
Supported by AE Target |
Supported by Simulink Accelerator |
Yes |
Yes |
Yes |
Yes |
|
Watchdog |
Yes |
Yes |
Yes |
Yes |
Modular Input/Output System (MIOS1) block group |
Yes |
Yes |
Yes |
Yes |
Queued Analog-Digital Converter Module-64 block group |
Yes (see Note 1) |
Yes |
Yes (see Note 1) |
No |
CAN 2.0B Controller Module (TouCAN) block group |
Yes |
Yes (see Note 2) |
Yes (seeNote 3) |
No |
CAN Message block group |
Yes |
Yes |
Yes |
No |
CAN Drivers (Vector) block group |
Yes |
Yes |
Yes |
No |
Note 1. When using the QADC Analog In block, or the TOUCAN Transmit make sure that the block output is connected to the input of another block. Otherwise, the build process will terminate with an error.
Note 2. The PIL target does not support the TOUCAN Interrupt Generator block or the Can Calibration Protocol Block.
Note 3. The AE target does not support the Can Calibration Protocol Block.
Hardware Clock Configuration
For an external clock frequency of 4 Mhz:
Note that if you select a sample time slower than the slowest possible for your clock frequency, Simulink issues a warning message.
Also note that the fastest sample time may not be achievable because timer overruns may occur, depending on your model.
For the real-time target, you can set the crystal frequency from the System Configuration parameters of the MPC555 Resource Configuration block (see System Configuration Parameters in the Embedded Target for Motorola MPC555 User's Guide).
If you are using the PIL target, we recommend that you use a board with a 20 MHz crystal frequency. We specifically recommend the Phytec PhyCORE-MPC555 board for use with the PIL target.
If your hardware uses a 4 MHz crystal frequency, you must edit the System Configuration parameters of the MPC555 Resource Configuration block. Change the Oscillator Frequency parameter to 4 MHz, and change the USIU_PLPRCR_B_MF parameter to 4.
In addition, it is necessary to re-configure the boot code and driver code. To do this:
gmd_ppc_cmf_300_A61_200_04.c
, and rename the copy to gmd_ppc_cmf_300_A61_200.c
(replacing the .c
file you deleted in step 1).
matlabroot/toolbox/rtw/targets/mpc555dk/common/drivers/libmods/timers/clocks_common.h
bootcode_flash.bin
file.
bootcode_flash.bin
onto the target hardware, as described in Downloading Boot Code in the Embedded Target for Motorola MPC555 User's Guide.
gmd_ppc_cmf_300_A61_200.c
with the file gmd_ppc_cmf_300_A61_200_20.c
.
PIL Target
subsystem
_pil_sf.dll
, is located and add this directory to the MATLAB path.
LPT
speed setting for the BDM port. This note describes how to configure the parallel port speed.
pildnload
utility: Speed values are obtained from the file
matlabroot\toolbox\rtw\targets\mpc555dk\common\tools\diab\sdsgetport.m.
In sdsgetport.m
, edit the string
and change the parameter value to the right of the = sign. If you are not sure what the correct speed value is, we suggest that you follow the procedure described in Configure SingleStep Parameters in the Embedded Target for Motorola MPC555 User's Guide until you obtain a Delay value that works. Then enter this number as the speed value.
SingleStep Debugger
TargetDebuggerExe
preference, must specify the full path to the executable file, on either an actual hard drive on your PC, or a mapped drive. Do not use a UNC.
Other Limitations and Warnings
TargetCompilerPath
property of the target preferences. The TargetCompilerPath
property is only required if you are using the Diab compiler.
preloadfcn
callback of the model. If you wish to add a command to the preloadfcn
callback of a model that already has an MPC555 Resource Configuration block, do not remove the commands that are already installed.
preloadfcn
callback and append your commands. Then set the preloadfcn
to the merged command. If you corrupt the preloadfcn
, you can retrieve the command from any model has an MPC555 Resource Configuration block, as the preloadfcn
will be the same for all models. You can retrieve the preloadfcn
with the following command:
Warning: Loading model 'mpc555pil_fuelsys' generated with a newer version(4.10) of Simulink. Loaded Stateflow module Version 4.1 (R12.1) dated May 21 2001, 01:15:03
mpc555library
) is not implemented in this release. Use the Help button in the mpc555library
window instead.
For these blocks, the quickest route to online help is the "Block Reference" section of the Embedded Target for Motorola MPC555 documentation.
Upgrading from an Earlier Release
This section describes the upgrade issues involved in moving from the The Embedded Target for Motorola MPC555 1.0 to Version 1.0.1.
ASAP2 Files Now Written to Build Directory
In the previous release, when generating an ASAP2 file, the Embedded Target for Motorola MPC555 real-time target wrote the ASAP2 file to the same directory as the source model.
In version 1.0.1, ASAP2 files are written to the build directory. If you have scripts or other procedures that assume the generation of ASAP2 files in the same directory as the source model, you should update them.
Embedded Target for Motorola MPC555 1.0.1 Release Notes |