Saturday, 2 January 2016
MINIXCon 2016 Announcement
Just a quick note to let you know that I will be giving a talk titled Device Driver Development Demystified at MINIXCon 2016.
Tuesday, 16 September 2014
Minix 3.3.0 Released
Today, Minix 3.3.0 was released. The Google Summer of Code work I did, developing i2c related drivers for the Beagle hardware, made it into that release. Check out the release information here.
Saturday, 18 January 2014
Mentor giving 'MINIX3 on ARM' talk at FOSDEM
Just a quick post to let you know that my primary Google Summer of Code mentor from 2013, Kees Jongenburger, will be giving a talk at FOSDEM 2014 titled "MINIX3 on ARM". If you're going to be at FOSDEM, I highly recommend checking it out.
Sunday, 22 September 2013
Final Report
This will be my last report as Google Summer of Code is officially wrapping up at noon tomorrow. The report will give a rundown of everything I've done during the summer and list my future plans.
Code merged into mainline Minix:
Code merged into mainline Minix:
- Drivers for AM335X Peripherals: i2c, rtc, gpio, padconf.
- Power Management Drivers: TPS65217, TPS65950.
- Environmental Sensor Drivers: SHT21, BMP085, TSL2550.
- Miscellaneous Drivers: CAT24C256, TDA19988.
- Features: rebooting, power-off, EDID reading.
- Userland: /dev/i2c and i2cscan (from NetBSD), eepromread.
- Expansion Boards: Weather Cape.
- Cool Demo: weatherstation web app.
- Netbooting Minix on ARM
- The I2C protocol
- I2C Subsystem Internals
- I2C Device Driver Programming
- EDID Reading Internals
- The RTC protocol
- Supporting BeagleBone Capes
- BeagleBone Weather Cape
- Unofficial Minix/arm Test Plan
- Project Videos: Final Summary, Intro Video.
- Demos: PMIC Power-Off, RTC, weatherstation, gpio.
- Misc: gource visualization of commits.
- Reports: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.
- Minix/arm Tutorials: BeagleBone Black (1,2,3), BeagleBoard-xM, Linaro QEMU, netbooting, file transfer with zmodem, debugging with openocd.
- Misc Tutorials: i2c-tools on Angstrom, FreeBSD on BeagleBone Black.
- Finish porting the frame buffer driver to AM335X.
- Support for the 4D 4.3 LCD CAPE.
- Support for HDMI output.
- pkgsrc for Minix/arm.
- Helping test release candidates.
Thursday, 19 September 2013
Project Results Video Posted
I just uploaded a YouTube video summarizing the results of my project. The video is embedded below and also viewable at the following URL: http://youtu.be/dxjaFsWYkAM
Wednesday, 18 September 2013
Soft Pencils Down
This past Monday marked the "Soft Pencils Down" date for Google Summer of Code. This week is "a week to scrub code, write tests, improve documentation, etc.", so that's what I've been doing.
Today I committed 4 patches to mainline Minix: tda19988: add missing blockdriver_announce() call, bmp085: remove duplicate code, libi2cdriver: add functions for IC register access, i2c: increase read/write timeout. They're mostly clean-up and refactoring. The net result is 390 fewer lines of code and improved reliability.
This week I wrote and executed a test plan for everything I've developed this summer (and more!). It can be found here, on the Minix wiki. Later today I'll be reviewing all of the other documentation I wrote this summer to ensure that it's complete, accurate, and up to date. Following that, I'll be working on a final summary video and a final report.
Today I committed 4 patches to mainline Minix: tda19988: add missing blockdriver_announce() call, bmp085: remove duplicate code, libi2cdriver: add functions for IC register access, i2c: increase read/write timeout. They're mostly clean-up and refactoring. The net result is 390 fewer lines of code and improved reliability.
This week I wrote and executed a test plan for everything I've developed this summer (and more!). It can be found here, on the Minix wiki. Later today I'll be reviewing all of the other documentation I wrote this summer to ensure that it's complete, accurate, and up to date. Following that, I'll be working on a final summary video and a final report.
Sunday, 15 September 2013
Report 13 (September 9 - September 15)
This is Report #13. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.
Completed this week:
Completed this week:
- Rebased against mainline Minix
- Continued working on porting the frame buffer driver to the AM335X. It can turn on the display and back-light and do the initialization steps, but currently it's only displaying 1 non-black pixel. More debugging work remains.
- The frame buffer driver is more challenging than I first thought. Additionally, the test program which draws raccoons on the frame buffer doesn't support 24-bit color which is needed for the LCD I'm testing with. Since there is only 1 week left and it's supposed to be for clean-up/documentation, I'm deferring the rest of the work on the frame buffer driver until after the clean-up / documentation is done.
- Code clean-up. Think about what can be improved and do it.
- libi2cdriver: Add common reg_read()/reg_write() functions for accessing registers on ICs.
- TDA19988: Add a call to blockdriver_announce().
- Review and test all code. Make sure everything still works as expected.
- Go over documentation. Make sure it's up to date, accurate, and complete.
- Create a final summary video for the project.
- Revisit the frame buffer driver.
Tuesday, 10 September 2013
Building a custom FreeBSD SD card image for the BeagleBone
In an effort to figure out the clocking for the LCD controller on the AM335X, I built a custom FreeBSD SD card image for the BeagleBone. I thought I'd share the steps I used to build the image as it isn't totally trivial. Though, the crochet-freebsd scripts really do help a lot.
The best host for cross building a FreeBSD image is FreeBSD. Since my main box runs Gentoo Linux, I decided to setup a FreeBSD virtual machine under QEMU with the latest version of FreeBSD. Here are the steps to fetch the ISO, create a disk image for the virtual machine, and run the installer:
wget -O freebsd.iso ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.2/FreeBSD-9.2-RC3-i386-disc1.iso
qemu-img create freebsd.img 32G
qemu-kvm -localtime -net user -net nic -m 2048 -cdrom freebsd.iso \
-hda freebsd.img -boot d
There isn't a whole lot to configure during the installation. The defaults should be fine. I chose the sshd option as it allowed me to easily transfer the image off of the VM later on. Once the installation of FreeBSD is complete, you can start QEMU with this command:
qemu-kvm -rtc base=utc -net user,hostfwd=tcp::2222-:22 \
-net nic -m 2048 -hda freebsd.img
Log in to the virtual machine and install the dependencies (subversion, git, bash, gmake, and gsed). Then use subversion to checkout the latest sources. Finally build an ARM cross compiler:
pkg_add -r subversion git bash gmake gsed
rm -rf /usr/src && svn co http://svn.freebsd.org/base/head /usr/src
cd /usr/src && make XDEV=arm XDEV_ARCH=armv6 xdev
The next step is to get a copy of crochet-freebsd and u-boot.
cd ~ && git clone git://github.com/kientzle/crochet-freebsd.git
cd crochet-freebsd && ftp ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2
tar xf u-boot-2013.04.tar.bz2
Finally, run the crochet.sh script to build the image.
sh crochet.sh -b BeagleBone
The build will take a while, especially in a VM. When it's done, there will be an SD card image under the work directory. Insert an SD card and be sure to unmount any partitions that were auto-mounted. On my Linux host, I ran these two commands to fetch the image off of the VM and write it to the SD card.
scp -P 2222 root@localhost:/root/crochet-freebsd/work/*.img .
dd if=FreeBSD-armv6-BEAGLEBONE.img of=/dev/sdb bs=1M oflag=direct
That's it. Just put the card into the BeagleBone and apply power. It should boot up to a login prompt. At the prompt you can log in as root (no password).
The best host for cross building a FreeBSD image is FreeBSD. Since my main box runs Gentoo Linux, I decided to setup a FreeBSD virtual machine under QEMU with the latest version of FreeBSD. Here are the steps to fetch the ISO, create a disk image for the virtual machine, and run the installer:
wget -O freebsd.iso ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.2/FreeBSD-9.2-RC3-i386-disc1.iso
qemu-img create freebsd.img 32G
qemu-kvm -localtime -net user -net nic -m 2048 -cdrom freebsd.iso \
-hda freebsd.img -boot d
There isn't a whole lot to configure during the installation. The defaults should be fine. I chose the sshd option as it allowed me to easily transfer the image off of the VM later on. Once the installation of FreeBSD is complete, you can start QEMU with this command:
qemu-kvm -rtc base=utc -net user,hostfwd=tcp::2222-:22 \
-net nic -m 2048 -hda freebsd.img
Log in to the virtual machine and install the dependencies (subversion, git, bash, gmake, and gsed). Then use subversion to checkout the latest sources. Finally build an ARM cross compiler:
pkg_add -r subversion git bash gmake gsed
rm -rf /usr/src && svn co http://svn.freebsd.org/base/head /usr/src
cd /usr/src && make XDEV=arm XDEV_ARCH=armv6 xdev
The next step is to get a copy of crochet-freebsd and u-boot.
cd ~ && git clone git://github.com/kientzle/crochet-freebsd.git
cd crochet-freebsd && ftp ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2
tar xf u-boot-2013.04.tar.bz2
Finally, run the crochet.sh script to build the image.
sh crochet.sh -b BeagleBone
The build will take a while, especially in a VM. When it's done, there will be an SD card image under the work directory. Insert an SD card and be sure to unmount any partitions that were auto-mounted. On my Linux host, I ran these two commands to fetch the image off of the VM and write it to the SD card.
scp -P 2222 root@localhost:/root/crochet-freebsd/work/*.img .
dd if=FreeBSD-armv6-BEAGLEBONE.img of=/dev/sdb bs=1M oflag=direct
That's it. Just put the card into the BeagleBone and apply power. It should boot up to a login prompt. At the prompt you can log in as root (no password).
Sunday, 8 September 2013
Report 12 (September 2 - September 8)
This is Report #12. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.
Completed this week:
Completed this week:
- Rebased against mainline Minix.
- Finished porting the GPIO driver to the AM335X (demo video).
- Code merged into mainline Minix this week:
- Continued working on porting the fb driver to the AM335X.
- Figuring out all of the clocking for the AM335X LCDC peripheral has been very challenging, especially determining the relationship between the functional clock, module clock, Display PLL, and pixel clock and their respective divisors and multipliers. There is a BSD licensed LCDC driver in FreeBSD that I may either re-use or add some debugging output to which would enable me to see all of the various clock values and multipliers/divisors in a working configuration.
- Get the Minix fb driver working with the 4D 4.3 LCD CAPE
Wednesday, 4 September 2013
Support for AM335X GPIO merged in mainline Minix
The changes to Minix's GPIO library that I've been working on were merged today (commit). The changes enable the use of GPIO on the BeagleBone and BeagleBone Black through the gpio file system which is sort of similar to the gpio-sysfs interface on Linux. I posted a demo video of the code in action earlier this week.
Monday, 2 September 2013
BeagleBone Black GPIO Demo Video Posted
I just uploaded a YouTube video showing off the Minix GPIO driver I ported to the AM335X. The video is embedded below and also viewable at the following URL: http://youtu.be/Me5AUs-uMbM
Sunday, 1 September 2013
Report 11 (August 26 - September 1)
This is Report #11. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.
Completed this week:
Completed this week:
- Rebased against mainline Minix
- Finished the weatherstation. Posted a demo video to YouTube.
- Added a kernel call for padconf on the AM335X.
- Began porting the Minix frame buffer driver to the BeagleBone. I'm about 10% done.
- Began porting the Minix gpio driver to the BeagleBone as it will be needed to turn on the LCD cape I'm working with. I'm in the testing phase now. Output works, still need to test input.
- Code merged into mainline Minix this week:
- weatherstation: BeagleBone Weather Cape demo app.
- kernel: add padconf kernel call
- kernel: move do_padconf and add a test case
- Documentation written this week:
- With the gpio driver, I'm running into the limit of allowed interrupts per driver. Specifying the 6 dm37xx interrupt numbers and 8 am335x interrupt numbers in the system configuration file puts it over the limit of 8. The likely fix is to increase the per driver interrupt limit, but I'm still exploring other possible solutions.
- Finish testing the gpio driver, resolve interrupt limit mentioned above, and submit to mainline Minix.
- Continue working on the frame buffer driver.
Saturday, 31 August 2013
padconf code merged
Earlier this week, the padconf changes I was working on were merged into mainline Minix (commit). The change adds a kernel call to allow userspace drivers to dynamically change the padconf at runtime. A kernel call was needed because on the AM335X, writes to the padconf registers must be done in privileged mode.
Tuesday, 27 August 2013
New Documentation Posted and Plans for the rest of GSoC
I spent part of my day today writing documentation for the Minix wiki. The new stuff includes a user guide for the BeagleBone Weather Cape, a developer guide with instructions for supporting new capes, and a developer guide for the I2C /dev interface.
If you remember my preliminary timeline, you know that I'm a bit ahead of where I planned to be at this time. There are still a few more weeks left in Google Summer of Code; the firm pencils down date isn't until September 23. Before it's over, I plan to accomplish a few more tasks...
If you remember my preliminary timeline, you know that I'm a bit ahead of where I planned to be at this time. There are still a few more weeks left in Google Summer of Code; the firm pencils down date isn't until September 23. Before it's over, I plan to accomplish a few more tasks...
- libpadconf support for am335x - when developing the i2c bus driver, I found out the hard way that access to the padconf (i.e. pinmux) registers on the am335x has to be done privileged mode. As a work-around I did the configuration in the kernel at boot. I will be cleaning that up by adding a kernel call to allow the pins to be configured by user space drivers at runtime.
- frame buffer support for BeagleBone Black - the frame buffer driver currently only supports the BealgeBoard-xM. Since I developed the Minix TDA19988 HDMI Transmitter driver and worked on part of the frame buffer driver previously, it shouldn't be too hard for me to add support for the BeagleBone Black.
- final week tasks - in the last week I plan to read through all of the code I developed this summer, see if anything can be improved, test everything, review the documentation to make sure it's up to date and accurate, and produce a final report and summary video.
weatherstation code merged
As part of adding support for using the BeagleBone Weather Cape in Minix, I ported the weatherstation application. The task mostly involved removing the node.js and socket.io code and replacing it with a JSON interface. I also added a loading spinner using spin.js and changed the units of pressure from mbar to hPa. Lastly, I updated to the latest versions of jQuery and Processing.js.
Since Minix doesn't have a web server in the base system, I developed a tiny web server in Lua that implements just enough to serve the static content and generate JSON. I'm elated that this project affords me the opportunity to work at all layers of the software stack, from device drivers to web servers to HTML5 and javascript.
Yesterday, I recorded a video demo of the application in action. The code was also merged into the Minix base system yesterday. Here's the commit. To use the weatherstation app, you just have to plug the board into a network (doesn't have to be Internet connected), configure the NIC with `netconf`, attach the cape, and boot the system. The cape will be automatically detected, the right drivers will be loaded, and the web server will be started. In the coming days I will be writing more formal setup instructions on the Minix wiki.
Since Minix doesn't have a web server in the base system, I developed a tiny web server in Lua that implements just enough to serve the static content and generate JSON. I'm elated that this project affords me the opportunity to work at all layers of the software stack, from device drivers to web servers to HTML5 and javascript.
Yesterday, I recorded a video demo of the application in action. The code was also merged into the Minix base system yesterday. Here's the commit. To use the weatherstation app, you just have to plug the board into a network (doesn't have to be Internet connected), configure the NIC with `netconf`, attach the cape, and boot the system. The cape will be automatically detected, the right drivers will be loaded, and the web server will be started. In the coming days I will be writing more formal setup instructions on the Minix wiki.
Monday, 26 August 2013
BeagleBone Weather Cape Demo Video Posted
I just uploaded a YouTube video showing off the Weather Cape drivers I developed along with the weatherstation application I ported from bonescript. The video is embedded below and also viewable at the following URL: http://youtu.be/QJEtuusBPak
Sunday, 25 August 2013
Report 10 (August 19 - August 25)
This is Report #10. I plan to post these every Sunday. They will give a
rundown of what I've done during the week, list any problems I had, and
what I plan to do the following week. I'll be posting the reports both
to the beagle-gsoc Google Group and to my blog.
Completed this week:
Completed this week:
- Rebased against mainline Minix
- Tested the TSL2550 (ambient light sensor) driver.
- Finished the SHT21 (relative humidity and temperature sensor) driver.
- Developed a BMP085 (pressure and temperature sensor) driver.
- Code merged into mainline Minix this week:
- tsl2550: driver for the TSL2550 light sensor
- sht21: driver for the SHT21 humidity & temp sensor
- bmp085: driver for the BMP085 temp&pressure sensor
- eepromread: add board info for BeagleBone Capes
- rc: start drivers for attached BeagleBone Capes
- Modified the bonescript weatherstation demo to use JSON instead of node.js / socket.io and display pressure in hPa. Here's a screenshot using a static JSON file.
- None this week :)
- Develop a script to read from the sensors and output JSON.
- Integrate the weather station demo and make it trivial to setup and use.
- Write more documentation.
- How to use the Minix I2C /dev interface.
- How to develop support for additional capes.
- How to use the BeagleBone Weather Cape in Minix.
Friday, 23 August 2013
BeagleBone Weather Cape Drivers Merged into Mainline Minix
I received a BeagleBone Weather Cape earlier this week. A cape is an expansion board for the BeagleBone and BeagleBone Black. The weather cape provides sensors for temperature, ambient light, humidity, and pressure. Combined with a BeagleBone, it allows anyone to create an Internet connected weather station.
I've been working hard on drivers to support the devices on the cape in Minix. I developed drivers for the SHT21, BMP085, and TSL2550. The other active device on the board, a CAT24C256 EEPROM, was already supported from my prior work. I also updated Minix's eepromread utility. It works sort of like Linux's i2cdump, but it is also aware of a few EEPROM formats. It has a mode where it can parse and display data fields as label:value pairs. Using the updated eepromread utility, I enhanced the rc script to detect attached capes and run cape specific start-up scripts at boot which load the proper drivers.
Here are the commits:
# cat /dev/sht21b3s40
TEMPERATURE : 29.126
HUMIDITY : 45.818
# cat /dev/bmp085b3s77
TEMPERATURE : 28.5
PRESSURE : 100432
# cat /dev/tsl2550b3s39
ILLUMINANCE : 830
#
Temperature is in Celsius (C), relative humidity is a percentage (%), pressure is in pascals (Pa), and ambient light is in lux (lx). There is a small difference in temperature between the two temperature sensors. I hypothesize the difference is due to some slight heating by the BeagleBone. I got the same results when I tried the board under Linux.
My next steps will be to get a demo application working and properly integrated. I'm hoping to modify the bonescript Weather Station demo (src) to work under Minix. I plan to make a small CGI application / script to expose the sensor values via JSON. Then, I will modify the web interface to make use of the data.
I've been working hard on drivers to support the devices on the cape in Minix. I developed drivers for the SHT21, BMP085, and TSL2550. The other active device on the board, a CAT24C256 EEPROM, was already supported from my prior work. I also updated Minix's eepromread utility. It works sort of like Linux's i2cdump, but it is also aware of a few EEPROM formats. It has a mode where it can parse and display data fields as label:value pairs. Using the updated eepromread utility, I enhanced the rc script to detect attached capes and run cape specific start-up scripts at boot which load the proper drivers.
Here are the commits:
- tsl2550: driver for the TSL2550 light sensor
- sht21: driver for the SHT21 humidity & temp sensor
- bmp085: driver for the BMP085 temp&pressure sensor
- eepromread: add board info for BeagleBone Capes
- rc: start drivers for attached BeagleBone Capes
# cat /dev/sht21b3s40
TEMPERATURE : 29.126
HUMIDITY : 45.818
# cat /dev/bmp085b3s77
TEMPERATURE : 28.5
PRESSURE : 100432
# cat /dev/tsl2550b3s39
ILLUMINANCE : 830
#
Temperature is in Celsius (C), relative humidity is a percentage (%), pressure is in pascals (Pa), and ambient light is in lux (lx). There is a small difference in temperature between the two temperature sensors. I hypothesize the difference is due to some slight heating by the BeagleBone. I got the same results when I tried the board under Linux.
My next steps will be to get a demo application working and properly integrated. I'm hoping to modify the bonescript Weather Station demo (src) to work under Minix. I plan to make a small CGI application / script to expose the sensor values via JSON. Then, I will modify the web interface to make use of the data.
Sunday, 18 August 2013
Report 9 (August 12 - August 18)
This is Report #9. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.
Completed this week:
Issues / Concerns / Challenges:
Plan for next week:
Completed this week:
- Rebased against mainline Minix
- Cleaned up the I2C bus driver based on comments from one of my mentors, Kees. The changes have been merged (commit).
- Documented EDID Reading and the RTC device protocol on the Minix wiki (here and here).
- Developed a driver for the TSL2550 Ambient Light Sensor that comes on the WeatherCape. The code is written, and I will test it when I pick up the hardware (either tomorrow or the following day).
- Began developing a driver for the SHT21 Humidity and Temperature Sensor IC for the WeatherCape.
Issues / Concerns / Challenges:
- None this week :)
Plan for next week:
- Test the TSL2550 driver.
- Finish the SHT21 driver.
- Develop a BMP085 driver.
Sunday, 11 August 2013
Report 8 (August 5 - August 11)
This is Report #8. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.
Completed this week:
Issues / Concerns / Challenges:
Plan for next week:
Completed this week:
- Rebased against mainline Minix
- Developed a driver for the power management chip on the BeagleBoard-xM (TPS65950) with support for the real-time clock peripheral.
- Code merged into mainline Minix this week:
- readclock: add support for am335x RTC
- libminc: add reboot()
- tps65217: driver for the TPS65217 PMIC
- kernel: add support for am335x PMIC-based power-off
- pm: notify readclock of reboot(RBT_POWEROFF)
- kernel: implement reboot for am335x/dm37xx
- tps65950: driver for the TPS65950 PMIC
- readclock: code clean-up, add -q, manpage updates
- readclock.drv: add support for the TPS65950 RTC
- Produced a video demo of the real-time clock driver I developed for the BeagleBone Black. Link: http://youtu.be/rBakaxAGRS0
- Got a positive test report for frame buffer auto-configuration using EDID. I submitted the changes for inclusion in mainline Minix.
- Developed a design for adding support for the WeatherCape.
Issues / Concerns / Challenges:
- None this week :)
Plan for next week:
- Write documentation for the Minix wiki about how EDID reading and the real time clock work.
- Begin developing drivers for the devices on the WeatherCape: TSL2550, SHT21, and BMP085.
Subscribe to:
Posts (Atom)