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 be debugged by the Macraigor Usb2Demon 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 at:

    http://community.qnx.com/sf/wiki/do/viewPage/projects.bsp/wiki/BSPAndDrivers.

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

  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. 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. Also, make note of the Image Address value, as you'll need it later.
  9. Open the Project Explorer view.
  10. Right-click on the project whose name ends with _libstartup, and select Properties.
  11. From the menu on the left, select QNX C/C++ Project, and then click the Compiler tab.
  12. 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. 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.
  13. Return to the System Builder Projects view and rebuild the image by right-clicking on the project and selecting Build Project.
  14. In the Console view, you will observe some output. Scroll up to locate a line that looks similar to this, for example:
    400280 d188 403960 --- startup-bios.sym

    Or:

    200280 10188 202244 --- startup-mpc8349e-qs.sym
    Note: The exact numerical values and filename will differ, but it will be the only 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, expand the Images directory; it should contain an .elf file and a .sym file. This is the 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.