On a semi-related note: I've noticed that "Getting Started with GPIO" documentation is limited compared to Linux. Probably a good idea would be for someone (probably me, when I have time) to either port some Linux helper libraries and/or write some documentation on how to use the I2C IOCTL.
While yes, reading the man pages and source code will get a potential hacker the information required to succeed*, there are some who are new to (Net)BSD and may just want to play around before delving into the details. It DOES take a bit of time to get used to where to find good sources of info (including the proper man page sections). Just a thought- probably would fit well on the wiki.
Enclosed is a link to some sample code that programs Atmel EEPROMs using the NetBSD IOCTL (in this case, AT24HC04B): https://gist.github.com/cr1901/76af0b3db9e9001a8d5b I have verified it to work, and hopefully after this example, those who want to use more GPIO from the RPi can fill in the blanks. Of course, with minimal tweaks, this code should work on ANY platform that NetBSD supports that provides an I2C interface via GPIO :D.
*A FreeBSD GPIO/I2C RPi tutorial also exists, and is of course similar to NetBSD.
-----Original Message----- From: Jonathan A. Kollasch
Sent: Thursday, January 22, 2015 1:13 PM To: William D. Jones Cc: port-arm%NetBSD.org@localhost Subject: Re: Raspberry Pi I2C implementation still broken? On Mon, Jan 05, 2015 at 11:31:54AM -0500, William D. Jones wrote:
Hello all, According to the following bug report: http://gnats.netbsd.org/48855, and mailing list posts: https://mail-index.netbsd.org/port-arm/2013/01/17/msg001714.html https://mail-index.netbsd.org/netbsd-bugs/2014/06/21/msg037157.html Either the IOCTL or I2C driver the Raspberry Pi I2C implementation is broken. I believe I may have found another bug in the implementation by trying to read/write an I2C EEPROM using IOCTL, but I'm guessing it is related to the already existing IOCTL issues that cause writes to always succeed. It's also possible my sample code is wrong :P. So, before I file a problem report: Has there been any progress in fixing the above I2C write errors?
There has now; https://mail-index.netbsd.org/source-changes/2015/01/22/msg062568.html (The ioctl was broken in certain situations.) While port-arm/48855 and port-arm/48932 still remain, they should be easy to fix. Jonathan Kollasch -- William D. Jones Rowan University | ECE | 2012 Member IEEE Member Tau Beta Pi thor0505%comcast.net@localhostMessage sent using 'Windows Live Mail' client.