HomeThe Bluewater Blog

In preparation for manufacturing a large number of Snapper CL15 modules, we have been developing an automated test system for quickly and accurately finding assembly faults in Snapper CL15 modules.  The test system will be sent to the manufacturer so that the modules can be tested and, if necessary, repaired at the point of assembly. In the past we have used our Autotester software, combined with a Rig 200 baseboard for testing Snapper modules.  While this approach works reasonably well, it has a number of limitations which make in unsuitable for this task:

  • It is too interactive.  Many of the tests require user interaction or confirmation. For example, the audio test requires the user to confirm that a sound was played correctly, and the USB tests require the user to insert and remove a USB device.  For large builds this interaction becomes both tedious and error prone.
  • It cannot accurately find faults.  A failed test in the Autotester only tells the user which sub-system is faulty, but not where the specific problem is. For example, the video sub-system of the Snapper CL15 comprises of more than 20 pins, but a failed video test in the Autotester does not give any information about which of these may be faulty.
  • The Rig 200 baseboard does not expose all of the features of the Snapper CL15 in an easy to test way.  While the major features of the Snapper CL15 are accessible on the Rig 200 baseboard, many of them require some additional hardware to actually test the functionality.
To solve these problems, we have developed the Snapper CL15 test jig.  The test jig is a standard Snapper CL15 baseboard which has been designed to fully automate the testing of all of the Snapper CL15 features. In the event of a failure, very specific information about the nature of the fault, often referencing a single pin, is given. The problem of requiring external hardware for testing some peripherals is solved by having an FPGA which can monitor and drive pins on the Snapper CL15. The FPGA enables tests which previously required user interaction, such as video test, to be fully automated. For the video testing, the Snapper CL15 runs an application which configures a video mode and displays a test pattern.  The FPGA has registers which contain information such as the number of clocks per line and the sum of the pixel data in the frame. The software running on the Snapper CL15 can verify that this information is correct. Many of the test procedures use loop-backs so that no user interaction is required. For example, the audio tests, which in the Autotester setup required a user confirmation that sound played correctly, loop the line-out to the line-in via an analogue switch. After initially testing that the left and right capture channels are working correctly by feeding a 1kHz (generated by the baseboard) to them, the line-out and high-power out are tested by looping them back to the line-in and comparing the captured audio with what was played. The test jig system will be able to fully test a Snapper CL15 module in around 2-3 minutes, with no user interaction other than insterting the Snapper CL15 module and checking the result of the test. Because the information about failures is highly specific, it enables the manufacturer to quickly find and correct any assembly faults with the modules.

As you know, Bluewater recently participated in Sky Challenge, having contributed by developing the heads-up display system which the pilot used for flying the course , and co-development of a microwave communication link which sends the positional data for the aircraft to the ground. Here are a few more links that we like that show you what Sky Challenge is all about. http://news.bbc.co.uk/1/hi/technology/7633110.stm http://news.bbc.co.uk/2/hi/technology/7651327.stm http://www.astrofiammante.net/blog/sky-challenge-better-than-the-nintendo-wii-post279/

Bluewater is hosting our first ARM Tools Seminar in Christchurch on Thursday 27th November 2008 and we'd like for you to join us! The seminar will cover topics such as the sales of ARM Development Tools, the benefits and any new features of those tools, as well as new features that have been added to the existing line of available ARM chips. As part of the afternoon's discussions, Simon will be presenting information on the current state of ARM technology. If you would like to attend our Christchurch seminar, please RSVP your full name, as well as the names of all staff members who would like to attend, and your company name by the 14th November 2008. Date: Thursday 27th November 2008 Time: 9:00am - 2:00pm, lunch and refreshments will be provided Venue: To be determined (details will follow on location information) RSVP: Friday 14th November 2008 Contact: Amanda Gardner on x202 or This e-mail address is being protected from spambots. You need JavaScript enabled to view it In addition, further ARM Tools seminars will be held in Auckland and Wellington, dates to be determined. If you would like any additional information, please do not hesitate to contact me on the details provided above.  Also, please reach out and register your interest if you would like to attend a seminar that is to be held in Auckland or Wellington.

A few fun things you can do with C structures: 1. Bitfields

struct {
    uint32_t    year        : 7,
                    month    : 4,
                    day        : 5,
                            : 5,
                    hour    : 5,
                    min        : 6;
} compact_date;
Notes: 1. Turns out that C99 defines fixes-size integer types: no more need to define them yourself. 2. The order in which bits are placed into a bitfield (MSB or LSB first) is not standardised - which is ok if you're only on a single platform, but may get messy otherwise. 3. To leave reserved blank spaces, just leave them blank. 4. If you need fewer bits, just use fewer. This structure can store a date (up to 127 years) using only 4 bytes (as opposed to the naive implementation which would require 5 or more). Not a massive win, but convenient when alignment is a concern. 2. Unions
union {
    uint16_t    isDate        : 1,
                    month    : 4,
                    day        : 5;
    uint16_t                : 1,
                    hour    : 5,
                    min        : 6;
} datetime;
This little beauty allows overlapping bitfield definitions: depending on the value of isDate, you can access either month/day or hour:min inside the same compact storage area. 3. Head and trailer structures
struct {
    uint16_t    type;
    uint16_t    len;
    uint8_t        data[1];
} tlv;
This is a fairly common construct but still rather useful. Because C doesn't check array bounds, you can readily access additional data[] elements - the only trick becomes handling sizeof() operations cleanly. To get the size of the header (only):
&((tlv*)0)->data)
To get the size of the complete structure:
sizeof(tlv) + sizeof(tlv.data[0]) * (data_count - 1)
4. And finally, just for fun:
#define STDIO "stdio.h"
#define STRING 
#include STDIO
#include STRING

int main (int argc, char** argv) {
  printf("Don't let me catch you doing this!\n");
}

For our Big-Eye project (a 3.1 Megapixel network camera for security and remote monitoring applications), we needed an efficient software algorithm for converting the Bayer-format data used by the image sensor to RGB data suitable for sending across the network / JPEG compression. A simple C algorithm was coded which did the job. However, it was very slow - about 1.7 seconds to convert a single frame. This was using GCC 4.1.1. The code was fairly well written, using word operations to move through the three lines of the image, two pixels at a time. It was not looking good. After spending a bit of time trying a few basic optimisation techniques, we decided to try the RealView compiler. This now supports most of the GNU options and it is fairly easy to build software using it. The result was pretty astounding. With no code changes, RealView produced an execution time of around 0.3 seconds! A bit of additional fiddling suggested that further improvements might be possible. The main difference seems to be that RealView makes much better use of registers, and thus needs a lot less load/store on the stack. This is probably a common feature of many image processing algorithms. If written with efficiency in mind, they will push the register set quite hard. Much assembler optimisation relies on using the register set more efficiently. But if the compiler can do it for you, so much the better. We could easily have spent a few days working on this part of the code, and with RealView it was just a re-compile. In the end we have moved all the code over to RealView and this is now the standard build environment.