The source code provided by the empeg developers to write new data to the empeg's flash (download.c) works only under Linux and Win32. This is a hindrance to those of us who don't run Linux or Win32. As it turns out, the major problem is that it relies upon the glibc extension function cfmakeraw() to place the serial port in a raw state. Replacing this function fixed most of the problems under non-Linux Unices.
I did, however, tidy some of the code and change the command line option structure to be more Unix-standard.
This code has been tested to work under Solaris 8, OpenBSD 2.6, and Linux 2.4.20 (glibc 2.3.2). Currently it produces warnings under Linux, but the flash write performs correctly anyway.
Please download the source code here: empeg-download.c
empeg-download Usage:
empeg-download -a <address> -p <serial port> [-dir] [-s <time>] filename
Options:
-d : assume empeg is already in program mode
-i : don't attempt an initial reboot
-r : don't attempt a final reboot
-s