[<<][ecos][>>][..]
Mon Sep 12 13:33:38 EDT 2011

Synthetic target serial port

The simplest way to get data in/out is to use a serial port.  To
connect a synthetic target serial port to a linux pty, use the
following approach.

1. Make sure that ecosynth is compiled.  Call the following from an
   empty build dir: 

   $ECOS/packages/hal/synth/arch/v3_0_9/host/configure && make
   
2. The synth binary needs to find ecosynth.  It will traverse the PATH
   environment variable and look for:
   
#define MAKESTRING1(a) #a
#define MAKESTRING2(a) MAKESTRING1(a)
#define AUXILIARY       "../libexec/ecos/hal/synth/arch/" MAKESTRING2(CYGPKG_HAL_SYNTH) "/ecosynth"

   WTF.. It would be simpler to have a direct plug:

--- a/src/ecos/ecos-3.0.9/packages/hal/synth/arch/v3_0_9/src/synth_intr.c
+++ b/src/ecos/ecos-3.0.9/packages/hal/synth/arch/v3_0_9/src/synth_intr.c
@@ -763,6 +763,27 @@ synth_start_auxiliary(void)
     }
 
     found = 0;
+
+    // Find the auxilary using an explicit location.
+    for (i = 0; (0 == found) && (0 != cyg_hal_sys_environ[i]); i++) {
+        const char *var = cyg_hal_sys_environ[i];
+        if (('E' == var[0]) && 
+            ('C' == var[1]) && 
+            ('O' == var[2]) && 
+            ('S' == var[3]) && 
+            ('Y' == var[4]) && 
+            ('N' == var[5]) && 
+            ('T' == var[6]) && 
+            ('H' == var[7]) && 
+            ('=' == var[8])) {
+            char *src = var + 9;
+            char *dst = filename;
+            while(*src) { *dst++ = *src++; }
+            found = 1;
+        }
+    }
+    
+    
     while (!found && ('\0' != *path)) {         // for every entry in the path
         char *tmp = AUXILIARY;


   Anyways.. This workaround seems to be ok:

     cd $SYNTH_HOST_TOOLS
     mkdir -p libexec/ecos/hal/synth/arch/v3_0_9 && \
	ln -s ../../../../../../ecosynth libexec/ecos/hal/synth/arch/v3_0_9

   Then use this to run the app:

     PATH=$SYNTH_HOST_TOOLS/libexec ./app --io

3. Make sure that ecosynth finds the .tcl script.  It looks in
   LIBEXECDIR/ecos/PKG_INSTALL/ecosynth.tcl as seen from ecosynth.c:

    // The various core Tcl scripts are installed in the same
    // directory as ecosynth. The Tcl script itself will check whether
    // there is a newer version of itself in the source tree and
    // switch to that instead.
    assert((strlen(LIBEXECDIR) + strlen(PKG_INSTALL) + 20) < _POSIX_PATH_MAX);
    strcpy(ecosynth_tcl_path, LIBEXECDIR);
    strcat(ecosynth_tcl_path, "/ecos/");
    strcat(ecosynth_tcl_path, PKG_INSTALL);
    strcat(ecosynth_tcl_path, "/ecosynth.tcl");

   Where are these symbols defined?  A grep leads to:

$ grep -re LIBEXECDIR *
src/host_tools/synth/Makefile: -DLIBEXECDIR=\"$(libexecdir)\" \
src/synth_host_tools/Makefile: -DLIBEXECDIR=\"$(libexecdir)\" \
src/ecos/ecos-3.0.9/packages/hal/synth/arch/v3_0_9/host/ecosynth.c:    assert((strlen(LIBEXECDIR) + strlen(PKG_INSTALL) + 20) < _POSIX_PATH_MAX);
src/ecos/ecos-3.0.9/packages/hal/synth/arch/v3_0_9/host/ecosynth.c:    strcpy(ecosynth_tcl_path, LIBEXECDIR);
src/ecos/ecos-3.0.9/packages/hal/synth/arch/v3_0_9/host/ecosynth.c:    Tcl_SetVar(interp, "synth::_ecosynth_libexecdir", LIBEXECDIR, TCL_GLOBAL_ONLY);
src/ecos/ecos-3.0.9/packages/hal/synth/arch/v3_0_9/host/Makefile.am: -DLIBEXECDIR=\"$(libexecdir)\" \
src/ecos/ecos-3.0.9/packages/hal/synth/arch/v3_0_9/host/Makefile.in: -DLIBEXECDIR=\"$(libexecdir)\" \
src/ecos/ecos-3.0.9/packages/devs/eth/synth/ecosynth/v3_0_9/host/Makefile.am: -DLIBEXECDIR=\"$(libexecdir)\" \
src/ecos/ecos-3.0.9/packages/devs/eth/synth/ecosynth/v3_0_9/host/Makefile.in: -DLIBEXECDIR=\"$(libexecdir)\" \
src/ecos/ecos-3.0.9/packages/devs/framebuf/synth/v3_0_9/host/Makefile.am: -DLIBEXECDIR=\"$(libexecdir)\" \
src/ecos/ecos-3.0.9/packages/devs/framebuf/synth/v3_0_9/host/Makefile.in: -DLIBEXECDIR=\"$(libexecdir)\" \
[synth_fixes] tom@ubit:~/ecos_trailer$    



  It looks like this is in the configuration of the host tools:
  libexecdir = $(exec_prefix)/libexec

  Solution: set configure option --exec_prefix=....

4. serial.tcl is not there.  Is it no longer supported?

Starting from 
http://www.cygwin.com/ml/ecos-discuss/2005-12/msg00012.html

I googled for ecos-discuss/2005-12/msg00012.html and got to

http://www.mail-archive.com/ecos-discuss@ecos.sourceware.org/msg06420.html

which points to:

http://www.xylanta.com/WordPress/?page_id=21
http://www.xylanta.com/Content/Downloads/eCos/synthserial-030826.tgz


Link is fixed now.



[Reply][About]
[<<][ecos][>>][..]