From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22712 invoked by alias); 28 Feb 2007 14:43:42 -0000 Received: (qmail 22701 invoked by uid 22791); 28 Feb 2007 14:43:41 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 28 Feb 2007 14:43:31 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1HMQ1X-0003BS-00; Wed, 28 Feb 2007 15:43:19 +0100 Date: Wed, 28 Feb 2007 14:43:00 -0000 To: Julien St?phane Cc: ecos-discuss@ecos.sourceware.org, nicolas.brouard@silicomp.ca, Etique Philippe Message-ID: <20070228144319.GC24209@lunn.ch> Mail-Followup-To: Julien St?phane , ecos-discuss@ecos.sourceware.org, nicolas.brouard@silicomp.ca, Etique Philippe References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Does AT91 SPI driver support external SPI devices? X-SW-Source: 2007-02/txt/msg00261.txt.bz2 On Wed, Feb 28, 2007 at 03:04:10PM +0100, Julien St?phane wrote: > Hi, > > I still have problems to make SPI work on my AT91 evaluation > board. I hava nothing to the SPI output of my AT91EB55 board > (sniffing with scope). I've studied the datasheet of my processor > and have seen the block diagram attached to this mail. Apparently, > there are switches default openned to activate SPI signals. > I didn't found in code where these switches are closed, so I have > tried to write directly to the memory with HAL_WRITE_UINT32 to close > them but no chages appears. Furthermore, I've studied the at91 SPI > driver code and I have readed this comment in the function > spi_at91_transaction_begin() : > > /* As we are using this driver only in master mode with NPCS0 > configured as GPIO instead of a peripheral pin, it is neccessary > for the Mode Failure detection to be switched off as this will > cause havoc with the driver */ This is to work around a hardware bug. When the SPI peripheral drives the NPCS lines, it gets it wrong for all but NPCS0. This is documented in the errata somewhere. To work around this, the NPCS lines are set as GPIO lines and controlled that way. > My question is the next one : Does the driver support sending datas > through SPI to external devices or not? Well a number of people have reported it working, John Eigelaar, Sebastian Block, Savin Zlobec. > If the answer is "yes", can I get help please? I think I initialize > the SPI bus and device correctly and I'm sure that I call the > correct functions because I print debug messages in the driver. If > it can help, I attached my source code. O.K. Lets start with a silly question. Are you sure you are looking at the correct pins. The pins used for NPCS are configurable by CDL. On most AT91 devices, the peripheral devices can select between multiple pins on the chip. Which pins do you have you logic analyze connected to? Which pins is the SPI device driver using? Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss