Hi, I think I could ask here. I have a hardware that uses a USB connector over that I can communicate with the device. It is a Avent Spartan 3 Eval board. The software that does not work is ASTriAEKiPro. The author doesn't have a Mac, so I will investigate some of the debugging tasks.
I think the serial communication is not properly set up. Below is the function that is used to set up the communication. Could anyone see some mistake or missing stuff? The code will work on Mac OS X using Debian Etch. So it is no hardware problem but maybe some defaults are different. When I use minicom with 115200 8N1 and Hardware flow control, I can communicate with the board. Any hints? My system is a Mac OS X 10.5.8. ASTriAEKiPro is from http://sourceforge.net/projects/fpgalibre/ Thanks Lothar / **[txh ]******************************************************************** Copyright (c) 2009 Salvador E. Tropea <salvador at inti gob ar> Copyright (c) 2009 Instituto Nacional de TecnologÌa Industrial This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Title: ASTriAEKiPro Description: Avnet Spartan 3A Eval Kit programmer. This program can send an FPGA configuration to the Spartan 3A, the serial SPI flash or the parallel flash. Acknowledgements: * I took some ideas from Jason Milldrum avs3a tool. * Bryan Fletcher (from Avnet) provided the information needed to use the BPI server. * The bpi_server_v036.h file is the bitstream for Avnet's BPI server version 036. Coded by Bryan Fletcher and Ron Wright. * Most of the programming information comes from the following documents provided by Avnet: Spartan3A_Eval_Programming_Algorithms_v1_0.pdf Spartan3A_Eval_PSoC_SoftwareUserGuide_v1_0.pdf avt_s25fl128p_64kb.sfh ***************************************************************************/ void ComSerie::Initialize() throw(ExOpen,std::bad_alloc) { struct termios newtio; struct sigaction saio; /* definition of signal action */ sigset_t block_mask; if (initialized) ShutDown(); bytesEsperados=-1; if (ttyName) fd=open(ttyName,O_RDWR | O_NOCTTY | O_NONBLOCK); else { char dev[32]; sprintf(dev,"/dev/ttyS%d",port<100 && port>=0 ? port : 0); /* open the device to be non-blocking (read will return immediatly) */ fd=open(dev,O_RDWR | O_NOCTTY | O_NONBLOCK); } if (fd<0) throw ExOpen(); //printf("Nuevo file descriptor de la comunicaciÛn: %d\n",fd); // Este sigset es para bloquear las signals durante la copia del buffer if (!blockMaskInitialized) { blockMaskInitialized=1; if (CPPFIO_ComSerie_USE_THREAD) pthread_mutex_init(&mutex,NULL); else sigaddset(&blockMask,SIGIO); } if (!SHSignalOn) { SHSignalOn=1; // install the signal handler before making the device asynchronous saio.sa_handler=SignalHandlerIO; // Block other terminal-generated signals while handler runs. sigemptyset(&block_mask); sigaddset(&block_mask,SIGINT); sigaddset(&block_mask,SIGQUIT); saio.sa_mask=block_mask; saio.sa_flags=0; if (!CPPFIO_ComSerie_USE_THREAD) {// No SIGIO support in Cygwin #ifndef __CYGWIN__ // Modified: Lothar Behrens // Also not on Mac OS X //saio.sa_restorer=NULL; #endif sigaction(SIGIO,&saio,NULL); } } if (CPPFIO_ComSerie_USE_THREAD) {// Cygwin approach: a new thread pthread_create(&pollThread,NULL,PollInput,this); } else {// allow the process to receive SIGIO fcntl(fd,F_SETOWN,getpid()); // Make the file descriptor asynchronous (the manual page says only // O_APPEND and O_NONBLOCK, will work with F_SETFL...) fcntl(fd,F_SETFL,FASYNC); } tcgetattr(fd,&oldtio); /* save current port settings */ bzero(&newtio,sizeof(newtio)); /* clear struct for new port settings */ /* set new port settings for canonical input processing */ newtio.c_cflag=br | CS8 | CREAD | /*CSTOPB |*/ CLOCAL; newtio.c_iflag=IGNPAR; newtio.c_oflag=0; newtio.c_lflag=0;//ICANON; No funca para streams de bytes newtio.c_cc[VMIN]=0; /* blocking read until 1 character arrives */ newtio.c_cc[VSTART]=_POSIX_VDISABLE; newtio.c_cc[VSTOP]=_POSIX_VDISABLE; newtio.c_cc[VINTR]=_POSIX_VDISABLE; newtio.c_cc[VQUIT]=_POSIX_VDISABLE; newtio.c_cc[VSUSP]=_POSIX_VDISABLE; //newtio.c_cc[VDSUSP]=_POSIX_VDISABLE; tcflush(fd,TCIFLUSH); tcsetattr(fd,TCSANOW,&newtio); buffer=new char[tamBuffer+1]; initialized=true; } -- | Rapid Prototyping | XSLT Codegeneration | http://www.lollisoft.de Lothar Behrens Heinrich-Scheufelen-Platz 2 73252 Lenningen ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Fink-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fink-users
