Skip to content
This repository was archived by the owner on Feb 17, 2023. It is now read-only.

Creating Standalone Application

Daniel Bennett edited this page Jan 12, 2018 · 16 revisions

The process of compiling a Simulink model to run as a standalone application on a flash drive is described in detail in this Simulink documentation page. The procedure is summarized below, but the most complete information is found in the documentation.

R2016b

  • Follow the procedure in Setting Up Development PC
  • Create a bootable flash drive with FreeDOS using the Rufus tool (use the following settings)
    • MBR partition scheme for BIOS or UEFI
    • FAT32 file system
    • 8192 bytes cluster size
    • Create bootable disk using FreeDOS
  • Select Stand Alone mode for the boot configuration in the Simulink Real-Time Explorer for the CassieV3 target (make sure to save the change)
  • Build the model that will be loaded onto Cassie (for example, model.slx)
  • After the build completes, copy all files in the model_slrt_emb folder (listed below) to the flash drive (this folder can be found in the directory where the generated code is saved)
    • autoexec.bat
    • xpcboot.com
    • model.rtb
  • Set the target computer's BIOS settings to boot first from the flash drive
  • Plug the flash drive into the target computer and power on

Changes With R2017b

With R2017b, Simulink Real-Time no longer supports booting entirely from a USB drive. It will look for the application file (extension .mldatx) on the hard drive instead of the flash drive. To boot properly, the AUTOEXEC.BAT file will have to be modified to copy the application file to the hard drive before booting the SLRT Kernel. However, FreeDOS only supports 8-character filenames and 3-character extensions, so using the built-in copy function will run into problems with our .mldatx files. To get around this, we will download a FreeDOS module to the flash drive and run that before the copy instruction. To summarize, the following steps are necessary to boot SLRT on our target with R2017b:

  • After creating the bootable USB FreeDOS drive with Rufus, add this file to the drive: doslfn.com
  • Use this file instead of the autoexec file generated by codegen. Make sure to rename it to autoexec.bat This file actually never changes from build to build, so the simplest solution is to copy it to the flash drive once and never overwrite it with the file in the _emb folder. For reference, here is the code in AUTOEXEC.BAT:
doslfn
copy C:\*.mldatx D: /Y /V
xpcboot slrtkrnl.rtb

Clone this wiki locally