Build a system image

Next, you can use the QNX Momentics IDE to build an image file that can be loaded onto the target board, and debugged by the Abatron BDI2000 Debugger.
To build a system image:
  1. Download a BSP (Board Support Package) corresponding to your target hardware.
    You can find BSPs for a wide variety of architectures from the QNX Foundry27 BSP Directory (after you log on) at:

    Ensure that you download a version of the BSP installer appropriate for your host machine as well.

  2. Install the BSP downloaded in the previous step.
  3. Launch the QNX Momentics IDE and switch to the System Builder perspective.
  4. In the System Builder Projects view, right-click and select Import.
  5. Select QNX > QNX Board Support Package as an import source.

  6. Click Next.
  7. Select a BSP package to import, and click Finish. If you're prompted with the message, Build the projects from the imported package?, click Yes. Wait for the build to finish before proceeding. Note that the import process may take several minutes, depending on the BSP you selected.
  8. Open the project.bld file from the System Builder Projects view, and from the new view that appears, select the image that corresponds to your board.
  9. In the Properties view on the right, ensure that the Create startup sym file? property is set to Yes, and that the Boot file type is set to elf or set to a supported type such as elf. Also, make note of the Image Address value, as you'll need it later.
  10. Open the Project Explorer view.
    Steps 10 to 13 are only relevant if your BSP is not imported as one managed project; that is, if _libstartup is a separate project.
  11. Right-click on the project whose name ends with _libstartup, and select Properties.
  12. From the menu on the left, select QNX C/C++ Project, and click the Compiler tab.
  13. In the Code generation section, ensure that the Optimization level is set to No optimize, and add -g to the end of the Other Options field to build with no optimization and the debug variant.
    Occasionally, you might have to specify a -O0 in the Other Options field in order to overwrite the macros defined, which could contain optimization. Click OK, and when prompted to rebuild the C++ project, click Yes and wait for the build to finish.
  14. Return to the System Builder Projects view and rebuild the image by right-clicking on the project and selecting Build Project.
  15. In the Console view, you'll observe some output. For example, scroll up to locate a line that looks similar to this:
    400280 d188 403960 --- startup-bios.sym

    Or something like this:

    200280 10188 202244 --- startup-mpc8349e-qs.sym
    Note: The exact numerical values and filename will differ; however, you want to focus on the line ending with .sym. Take note of the first and third numerical values on this line, as you'll need them later.
Now, in the System Builder Projects view, if you expand the Images directory, it should contain an .elf file and a .sym file. This is the QNX Neutrino image that is ready to be uploaded and debugged. However, before you can continue with the debugging process, you'll need to create a launch configuration.