From owner-freebsd-arm@FreeBSD.ORG Thu Mar 20 20:10:47 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8495CB5C for ; Thu, 20 Mar 2014 20:10:47 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D01FBF4 for ; Thu, 20 Mar 2014 20:10:46 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id d1so6663309wiv.1 for ; Thu, 20 Mar 2014 13:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=99Dred2I2Anp6fCvVD79UmxkOeS7miKVrAmq7QyPV+M=; b=Q3L9wqr2omlU1vVU71zqX+YvPOLCI/zxeI7/Oi79rGEiV3P5Ks/h1i03AWOrE9sDKT SKDJtRswnjZf2amEd/r51bvoVvN6bai5Yb3kuVOzX3v2tLFQIHFiJF1hXKWniMGiLAqu p7eGAM2PbuGLlR3Cm2IQDr+w2PpsGA3xQrVvXp53JZJ+76JViK0zn9EVUCD7A+49AVsK wUE3KgDetgqTuk0pNeC4lIZH3bhFaqqVAbJGXiNQ2UIL016MVr/Hi7Iz0uvrWFWmyG1m Uf27HXeQ2bmXFzkBnsbT+5luz8o5MGnqiwN3T8oMLaxgwe25E2P43x0ofl+BCzE7r0cs Ephw== MIME-Version: 1.0 X-Received: by 10.180.100.72 with SMTP id ew8mr5057404wib.16.1395346245489; Thu, 20 Mar 2014 13:10:45 -0700 (PDT) Received: by 10.216.40.72 with HTTP; Thu, 20 Mar 2014 13:10:45 -0700 (PDT) In-Reply-To: <1395280002.1367.5.camel@fbsd-laptop> References: <1394852976.1369.3.camel@fbsd-laptop> <1395280002.1367.5.camel@fbsd-laptop> Date: Thu, 20 Mar 2014 17:10:45 -0300 Message-ID: Subject: Re: Beaglebone black: are the AIN pins available with gpioctl From: Luiz Otavio O Souza To: Brian McGovern Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-arm@freebsd.org" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 20:10:47 -0000 On 19 March 2014 22:46, Brian J. McGovern wrote: > > On Sat, 2014-03-15 at 02:23 -0300, Luiz Otavio O Souza wrote: >> On 15 March 2014 00:09, Brian J. McGovern wrote: >> > I'm trying to read through all the details in the Beaglebone Black >> > System Reference manual, but I don't think I've seen this particular >> > piece yet... Are the AIN pins available via gpioctl or another interface >> > in 10.0-RELEASE? >> >> No, there is no support for the ADC on 10.0-RELEASE. >> >> I've just tested a driver for the BBB ADC, now i need to write a man >> page and publish the code (on this ML). >> >> If everything is fine, it will be available on -head and on 10-stable soon. >> >> Luiz >> > > Luiz, > I grabbed your patches that you posted on 17 March, and patched them > in to FreeBSD 10. Overall, the driver seems to work fine. The only issue > that I'm having is that after some period of time (it has varied from a > few minutes to over a half hour), the analog input freezes up, > continuing to provide the last reading, despite changes on the analog > input - verified via a voltage meter. The only way I've been able to > recover is to reboot. > > Obviously, I need to do some more testing and try to figure out why > its locking up, but I thought you'd like to know. Yes, i have seen it here too (and a few other issues). The code wasn't too clever and it was upsetting the ADC in various situations. It was running in continuos mode which was overflowing the FIFO counter, generating spurious interrupts. If you set the prescaler clockdiv to a low value a few other problems show up (the FIFO wasn't being drained at ADC shutdown, etc.). I think i have fixed all the issues and now i can push it to almost 100% of CPU in the interrupt handler without upsetting it. I'll run a 24 hour test and if everything is fine i'll post the updated code. Thanks for the report. Luiz