Embedded Target for OSEK/VDX Previous page   Next Page

Tutorial 4: Automated Downloading and Debugging

Both the OSEKWorks target and the ProOSEK target let you automatically download generated applications, with optional initiation of a debugging session. The SingleStep debugger is required to use these features.

The Build action pull-down menu supports the following options:

In this tutorial, we will rebuild the osek_mrate application used in the previous tutorials, and use the Download_and_debug option to download the code and start a debugging session.

Make sure you have done the following before you begin:

  1. Return to the Real-Time Workshop pane of the Simulation parameters dialog box and select the target-specific options for your implementation (either OSEKWorks code generation options or ProOSEK code generation options) from the Category menu.
  2. Select Download_and_debug from the Build action pull-down menu. The figure below shows this option selected for the OSEKWorks target.

  3. Click the Build button to initiate the build process. The build process begins to display status messages in the MATLAB Command Window.
  4. On successful completion of the build process, messages similar to the following are displayed, indicating that SingleStep has been started up:

    Execute SingleStep as: start \\depot\hub\share\apps\WindRiver\SingleStepDebugger\sds762\cmd\bdmp58.exe -P -S D:\Work\r12\toolbox\rtw\targets\osek\osek\@osek_diab_tgtaction\phycore-555.wsp -a d:\work\osek_tut\osek_mrate.elf -r d:\work\osek_tut\osek_mrate_osekworks\osek_mrate_ram.scr

    ### Successful completion of Real-Time Workshop build procedure for model: osek_mrate

  5. SingleStep displays an initial splash screen. After a few seconds, the SingleStep Debug window is displayed, with the Program Counter arrow pointing at the first executable instruction.
  6. The executable is now downloaded to the target, and ready to execute under control of SingleStep. You can now conduct a SingleStep debugging session, or simply start the program.
  7. Select Exit from the File menu of the SingleStep window to close the debugging session.
  8. You may also want to try the Download_and_run option. If so, make sure you have closed any existing SingleStep sessions, as multiple SingleStep sessions can conflict with each other. Then return to the Build action pull-down menu, select Download_and_run, and click the Build button. After completion of the build process, SingleStep starts up and downloads and runs the program on the target, without a breakpoint or any manual intervention.

In the next and final tutorial, Tutorial 5: Downloading Generated Code to FLASH, we will use a different model to generate code and download it to FLASH rather than RAM.


Previous page  Observing the Generated Code Tutorial 5: Downloading Generated Code to FLASH Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2010 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS