Software Documentation with Doxygen

This is a good practice to always have up-to-date software documentation. However, there can be discrepancy between the source code and the documentation over time and maintenance may be an issue. This is where Doxygen,  a “Source code documentation generator tool”, may be handy as it will automatically generate documentation based on the comments in the source code. In order for Doxygen to work, all developers will have to follow the same source code format in all source files,which is in itself also a plus since it will make the code and especially comments in this case more consistent. We’ll just show to quickly generate html and pdf documentation using a sample program we’ll call cnxapp. So here’s the code for this “application”   #include <stdio.h> /** Function1 description @param iArg1 First param description @param iArg2 Second param description @return 0 – Success -1 – Failure */ int function1(int iArg1, […]

Sigma Designs SMP863X Resources

SMP8634 / SMP8635 “Secure Media Processors” from Sigma Designs are used in our set-top-box and digital signage applications. In order to develop for that platform, an SDK must be purchased directly from Sigma Designs. There are different version of the SDK, once is mainly compatible with EM862X MRUA SDK and the newer one DCCHD is not, but offer a few more features. However, as for EM8620 series, the Linux kernel is open source so companies need to release the source if they modified it in their products. For example, you could download the GPL source released by Netgem – http://www.netgem.com/en/supportLinux.php for both Linux and utilities used in their NetBox HD. This is only the GPL source for your reference, after that there are also sigma linux drivers (not released by sigma) and not GPL, and the MRUA/DCCHD package that needs to be purchased from Sigma Designs. Contrary to EM8620 series […]

Setting up a time server (RFC 868)

This blog entry explains how to configure a time server as defined in RFC 868. not to be confused with NTP which is a newer protocol. This type of server is to be used with rdate as you’ll see below. Edit/ etc/xinetd.d/time and set disable = no. Make sure the lines below are present and uncommented in /etc/services time            37/tcp          timserver time            37/udp          timserver restart xinetd: /etc/rc.d/init.d/xinetd restart The time server will be started automatically each time the PC boots up. To test the time server, in your device use rdate (part of busybox): To set the date: rdate -s IP_ADRESS_OF_TIME_SERVER To print the date in the console: rdate -p IP_ADRESS_OF_TIME_SERVER Check the date by typing date Jean-Luc Aufranc (CNXSoft)Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in […]

Software profiling in embedded systems with O-profile

What is o-profile? See the description below extracted from http://oprofile.sourceforge.net/, o-profile official website OProfile is a system-wide profiler for Linux systems, capable of profiling all running code at low overhead. OProfile is released under the GNU GPL. It consists of a kernel driver and a daemon for collecting sample data, and several post-profiling tools for turning data into information. OProfile leverages the hardware performance counters of the CPU to enable profiling of a wide variety of interesting statistics, which can also be used for basic time-spent profiling. All code is profiled: hardware and software interrupt handlers, kernel modules, the kernel, shared libraries, and applications. OProfile is currently in alpha status; however it has proven stable over a large number of differing configurations; it is being used on machines ranging from laptops to 16-way NUMA-Q boxes. As always, there is no warranty. Why don’t we use gprof? For embedded system , […]

Resources for Cirrus Logic EP93XX – EP9301, EP9302, EP9307, EP9312 & EP9315

A few years ago, we used EP9307 in combination with a MPEG Video Decoder chip (ES6425 – now phased out) for the development of a Karaoke system for the Chinese Market. The advantage with Cirrus Logic (and many American companies) is that documentation and support can very easily be found online including datasheets, software development kit and support forum. This was so good that we really had to get the involvement of the FAE once or twice. That’s a sharp contrast with some other companies where is there a dearth of support and FAE are seldom able to help you resolve issues you may have with their products, especially if you work for a smaller company. Basically to develop for EP9307 and other EP93xx platform most of the software and hardware resources are available at http://arm.cirrus.com/ including: Linux 2.6 Documentation & Linux 2.6 Source for EP93xx Linux 2.4 Documentation & […]

Optimizing hard disk and compact flash performance in Linux Embedded Systems

Compact flash are often used in Digital Signage applications and hard-disks used in both signage application and IP set-top-box to play high definition videos. However, sometimes the performance of those devices and the performance limitations of embedded systems may make the task difficult especially for higher bit-rate videos. Choosing the right file system Once of the easiest way to improve performance is to select an appropriate file system. The best performance is achieved by ext-2, followed by ext-3, fat 32 and ntfs on the embedded system I worked with at least (e.g. Sigma Designs EM8620 and  SMP8630 series).  Basically, if your CF card/HDD is not supposed to be taken out of your device, then ext-2 is the obvious choice. However, if your user for whatever reasons need to take the devie out and connect it to a Windows PC FAT 32 or NTFS might be a better choice, although it […]

NTFS for Embedded Linux Systems

NTFS benchmarchs for embedded systems Tuxera vs NTFS-3G vs ext-3

Since now more and more HD videos are larger than 4GB they can not be stored into FAT32 file system, and require the use of other file systems, the most popular being ext2/ext3 or NTFS. However, since many users may want to access the mass storage devices (IDE / SATA harddisk, USB Harddisk, USB Thumbdrives…) in Windows as well as in their embedded systems (IP STV, Digital Signage..) NTFS seems to the best choice to share data between Windows systems and embedded systems using Linux. NTFS is available in the Linux kernel. However only read-only is fully supported and the performance is about 25% less than ext-2 or ext-3 for the platforms we tested (EM8623L and SMP8635), but this is still acceptable to play most of HD Videos. However, if the device also needs to download videos from a server or other P2P clients, having a read-only file system will […]

Finding and fixing memoy leaks in your software

Memory leak

Memory leaks will cause your device to crash after a period of time once it runs out of memory. A quick way to find out if your application has a memory leak(s) is to monitor it with top:

If you see the %MEM increase over time for no particular reason, then you’ve got a memory leak. However, it might be tricky to isolate where the issue occurs exactly. The first thing to do is the review your source code for the following: Malloced memory is always freed fopen is always followed by fclose, and open by close scandir calls are properly freed Threads are properly terminated with pthread_cancel & pthread_join or pthread_detach, etc… If after a code review you cannot find the reason for the memory leak, use the following piece of code:

  The memory usage is displayed in numbers of pages. Usually, one page is 4096 […]

UP 7000 x86 SBC