www.gusucode.com > simulinkcoder 案例源码程序 matlab代码 > simulinkcoder/ConfigureCharacteristicsOfTargetSystemExample.m
%% Configure Target Hardware Characteristics % Simulink(R) allows you to configure the hardware implementation % characteristics of your target system. Failure to do so can result in % code that is incorrect or inefficient. % %% Open Example Model % Open the example model |rtwdemo_targetsettings|. % Copyright 2015 The MathWorks, Inc. open_system('rtwdemo_targetsettings'); %% % Open the *Hardware Implementation* pane of the Configuration Parameters % dialog box by double-clicking the yellow button in the model. %% Hardware Board Configuration % % By default, the model is configured for the code generator to determine % the hardware board configuration based on the specified system target % file. The default system target file setting is |grt.tlc|. % % If you have installed support for a hardware board, that board should % appear in the *Hardware board* menu. If you select it, the dialog box displays % parameters that are relevant to your hardware board. % %% My Hardware Board is Not Listed % % If you are using a hardware board that is not listed, add it to % the menu by installing the corresponding target support package. Start % the Support Package Installer by setting *Hardware board* to |Get hardware % Support Packages|, or by entering |supportPackageInstaller| in the MATLAB(R) % Command Window. % % After installing support for a hardware board, reopen the Configuration % Parameters dialog box and select the hardware board. % %% Cross-Development Systems that Include Source Level Debuggers % % If you use a cross-development system that includes a source level debugger: % % 1. Configure the model for your hardware board. % % 2. Generate code and build an executable using your target development system. % For details about retrieving file and path information, see the documentation % on the Simulink Coder(R) Build Information API. % % 3. Download the executable to the target hardware and set breakpoints at % the model output code for each outport of the model. % % 4. Run a debugging session and observe the behavior of the code as it % executes on the target hardware. As you step through the code, it computes % the values for target hardware device characteristics. % % If your target development system does not support source level debugging, % generate code and add |printf| statements or other code that gets the % results. % % 5. On the *Hardware Implementation* pane of the Configuration Parameters % dialog box, set *Device vendor* to |Custom processor|, click the *Device % details* arrow, and adjust the microprocessor device settings manually.