Black Spot Firmware
Figure 4.9 The firmware is designed to be cross-compiled for PC or the Blackfin processor. This is achieved by implementing hardware dependent code twice; once for the Blackfin and once for the PC. This allows development to begin before the hardware is complete and the firmware to be partially tested using a PC.
The firmware is written in ISO/IEC C99 . It was designed to be compiled either for a PC, using Microsoft Visual Studio, or the Blackfin camera module using GNU GCC and the open source Eclipse environment. This cross-compilation approach enables new algo- rithms to be developed and tested quickly using a PC. Development on a PC is preferred as it allows the full range of PC tools to be used as well as the use of resources that are not available on the embedded system. PC software can be easier to test for two reasons. First, testing can be easier to carry out due to the greater number of testing tools avail- able. Second, hardware dependent modules can be substituted for mock objects (Figure 4.9). These mock objects mimic the behavior of the hardware but provide more control because, for example, unusual timing scenarios can be simulated and tested. lso, using mock ob- jects allows testing to occur before the hardware platform is available . For example, a number of test videos were used to test algorithms by substituting the data from the image sensor with the test video data. This was carried out before the hardware was built using
the OpenCV computer vision library [69, 70].
Debugging is carried out using a PC wherever possible, however, the Black Spot hardware drivers must be debugged on the module. Debugging the firmware running on the Black Spot requires PC software and a special hardware debugging interface (Figure 4.10). The Eclipse IDE interfaces with a Blackfin specific version of the GNU Debugger (GDB) client running on the PC. This software allows Eclipse to control the execution of the firmware by setting breakpoints and stepping through the code line by line. The GDB client connects to a GDB proxy using a TCP/IP network connection. This allows the the firmware to be debugged from a remote machine if required. The GDB proxy software interprets the GDB debugging commands and translates them into commands that are sent to the debug mod- ule on the Blackfin using a IEEE 1149.1  compatible interface board. This is commonly known as a Joint Test ction Group (JT G) interface board. The GDB proxy communicates