Rebuild the BSP

Now, let’s try building the same BSP once again by typing the following commands:

Note: You'll likely repeat this next step several times throughout the process of updating the BSP.
# cd /root/bsps/sabrelite_650/
# make clean  (this command will remove all of the contents of the /install directory)
# make

As you can see from the results below, many of the initial errors are now fixed and the build is much further along in the process. The following output shows the console output where the next error in the process reveals an issue with a missing library:

/root/qnx660/host/linux/x86/usr/bin/qcc -Vgcc_ntoarmv7 -c -Os -Wc,-Wall -DNDEBUG   -I.
-I/root/bsps/sabrelite_650/src/hardware/devc/sermx1/arm/le.v7 
-I/root/bsps/sabrelite_650/src/hardware/devc/sermx1/arm 
-I/root/bsps/sabrelite_650/src/hardware/devc/sermx1 
-I/root/bsps/sabrelite_650/src/hardware/devc 
-I/root/bsps/sabrelite_650/src/hardware/devc/../../../install/usr/include/xilinx 
-I/root/bsps/sabrelite_650/src/hardware/devc/../../../install/usr/include 
-I/root/qnx660/target/qnx6/usr/include    -EL              
      -DVARIANT_le -DVARIANT_v7 -DVARIANT_sermx1 -DBUILDENV_qss  
      /root/bsps/sabrelite_650/src/hardware/devc/sermx1/tto.c 
            make[6]: *** No rule to make target `libpm.a', needed by 
                         `/root/bsps/sabrelite_650/src/hardware/devc/
                         sermx1/arm/le.v7/devc-sermx1'.  Stop.
            make[6]: Leaving directory `/root/bsps/sabrelite_650/src/hardware/devc/sermx1/arm/le.v7'
            make[5]: *** [install] Error 2
            make[5]: Leaving directory `/root/bsps/sabrelite_650/src/hardware/devc/sermx1/arm'
            make[4]: *** [install] Error 2
            make[4]: Leaving directory `/root/bsps/sabrelite_650/src/hardware/devc/sermx1'
            make[3]: *** [install] Error 2
            make[3]: Leaving directory `/root/bsps/sabrelite_650/src/hardware/devc'
            make[2]: *** [install] Error 2
            make[2]: Leaving directory `/root/bsps/sabrelite_650/src/hardware'
            make[1]: *** [install] Error 2
            make[1]: Leaving directory `/root/bsps/sabrelite_650/src'
            make: *** [install] Error 2

Missing library

The issue here is a missing library (libpm.a), which previously shipped with QNX Momentics 6.5.0, but no longer ships with QNX SDP 6.6. So, you'll need to modify the serial driver source code that attempts to use this library. Comparing the /devc source directory contained within the QNX 6.5 version of the BSP to the equivalent directory contained within the (already ported) QNX 6.6 version, we see the first diff:

diff -r -b /root/bsps/sabrelite_660/src/hardware/devc /root/bsps/sabrelite_650/src/hardware/devc
< LIBS+=io-char drvr
---
> LIBS+=io-char pm ps drvr

So, in the QNX 6.5.0 version of the BSP, the common.mk file for the serial driver source code is including this libpm.a. Notice that from the QNX SDP 6.6 version of the BSP, this library (and a corresponding libps.a) is no longer needed. Therefore, you'll need to edit the file common.mk to change the line with LIBS as shown above, to remove the references to pm and ps:

# LIBS+=io-char pm ps drvr
LIBS+=io-char drvr

Again, looking at the BSP root directory (/root/bsps/sabrelite_650), and performing a make clean; make operation, the BSP build is able to advance much further along in the build process.

Touch/input driver

The next issue encountered with the build process for the BSP occurs with the attempt to compile the touchscreen driver contained within the QNX 6.5.0 version of the BSP. The issue here is that the touch driver in the QNX QNX 6.5.0 BSP is based on the older devi input framework, which has not been carried forward to QNX SDP 6.6. Describing what needs to be done to migrate an input/touch driver to the new mtouch framework is beyond the scope of this document, but there are several QNX SDP 6.6 BSPs available that include mtouch touchscreen drivers, so these can be used as a reference for updating your own touch/input driver, if necessary. In this particular case, we will simply remove the /devi directory altogether:

#cd /root/bsps/sabrelite_650/src/hardware
# rm –Rf devi

Returning to the root of the BSP directory, and doing a make clean; make operation, we see that the next issue with our example BSP is that the network driver source that’s included with the BSP has many issues regarding re-declaration of enumerators, conflicting types, and so on:

I../../../../../io-pkt/lib/socket/public -I/root/bsps/sabrelite_650/src/hardware/devnp/mx6x/../../../../
    install/usr/include 
-I/root/qnx660/target/qnx6/usr/include       -EL      -shared     
    -DVARIANT_dll -DVARIANT_le -DVARIANT_v7 -DBUILDENV_qss  
    /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c 
            In file included from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/mx6q.h:48:0,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c:22:
            /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/../../../../
                install/usr/include/io-pkt/drvr/mdi.h:290:16: 
                error: redeclaration of enumerator 'WaitBusy'
            In file included from /root/qnx660/target/qnx6/usr/include/io-pkt/iopkt_driver.h:59:0,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/mx6q.h:27,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c:22:
            /root/qnx660/target/qnx6/usr/include/netdrvr/mdi.h:290:16: note: previous definition 
                 of 'WaitBusy' was here
            In file included from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/mx6q.h:48:0,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c:22:
            /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/../../../../install/usr/include/
                 io-pkt/drvr/mdi.h:290:30: 
                 error: redeclaration of enumerator 'NoWait'
            In file included from /root/qnx660/target/qnx6/usr/include/io-pkt/iopkt_driver.h:59:0,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/mx6q.h:27,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c:22:
            /root/qnx660/target/qnx6/usr/include/netdrvr/mdi.h:290:30: note: previous definition of 
                 'NoWait' was here
            In file included from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/mx6q.h:48:0,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c:22:
            /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/../../../../install/usr/include/io-pkt/
                 drvr/mdi.h:290:38: 
                 error: redeclaration of enumerator 'IrqNoWait'
            In file included from /root/qnx660/target/qnx6/usr/include/io-pkt/iopkt_driver.h:59:0,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/mx6q.h:27,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c:22:
            /root/qnx660/target/qnx6/usr/include/netdrvr/mdi.h:290:38: note: previous definition of 
                 'IrqNoWait' was here
            In file included from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/mx6q.h:48:0,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c:22:
            /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/../../../../install/usr/include/io-pkt/
                 drvr/mdi.h:290:50: 
                 error: conflicting types for 'MDIWaitType'
            In file included from /root/qnx660/target/qnx6/usr/include/io-pkt/iopkt_driver.h:59:0,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/mx6q.h:27,
            from /root/bsps/sabrelite_650/src/hardware/devnp/mx6x/bsd_media.c:22:
            /root/qnx660/target/qnx6/usr/include/netdrvr/mdi.h:290:50: note: previous declaration of 
                 'MDIWaitType' was here
            
            
            ...
            ...
            ...

Network updates

The reason for these errors is that since QNX 6.5.0 was released, there have been significant updates to the network driver library routines. In order for the current driver source to compile correctly, various (updated) network driver-related header files needed to be included in the BSP. One of the changes was to separate out the network-specific library functions from the generic driver functions, so that network-related functions that were previously found in libdrvr.a are now found in libnetdrvr.a. With the advent of QNX SDP 6.6, additional updates were made to these routines, and the latest version of libnetdrvr.a (as well as its corresponding header files) is included with QNX SDP 6.6. As a result, to get the network driver source building, you'll need to do the following steps:

  1. Delete all io-pkt related headers, and the prebuilt libdrvrS.a, from the BSP:
    # cd root/bsp/sabrelite_650/prebuilt/usr/include/ 
    # rm –Rf io-pkt 
    # cd root/bsp_sabrelite_650/prebuilt/armle-v7/usr/lib 
    # rm libdrvrS.a
  2. Modify the common.mk file for the mx6x network driver to include libnetdrvr:
    # cd root/bsp/sabrelite_650/src/hardware/devnp/mx6x/ 
    # vim common.mk (edit as shown below)
    
    before: 
            LIBS = drvrS cacheS 
    after: 
            LIBS = netdrvrS drvrS cacheS
  3. Edit the mx6q.h file, which includes several header files previously associated with libdrvr, but are now instead associated with libnetdrvr:
    Before: 
                    #include <drvr/mdi.h> 
                    #include <drvr/eth.h> 
                    #include <drvr/nicsupport.h> 
                    #include <drvr/common.h> 
                    
    After: 
                    #include <netdrvr/mdi.h> 
                    #include <netdrvr/eth.h> 
                    #include <netdrvr/nicsupport.h> 
                    #include <netdrvr/common.h>

After completing these steps, return to the BSP root, and do the make clean; make again; at this point, we see that the network driver builds without errors. We also see that the BSP now builds to completion (although there are still warnings, which we’ll discuss later).