September 25th, 2012 02:07am
Matt Massey
For no other reason that seeing if it was possible, I wanted to create a mobile development environment to allow me to (or anyone else) to code on “any” machine. Since I’m doing Beaglebone development on the side, I thought this would be a good chance to explore mobile environments. The goal was to create a full Linux development machine that could work directly from a USB flash drive, preferably within a virtual machine.
I was spending some time researching the concept of a mobile work machine/environment. With developments in cloud infrastructure and virtual machines, I figured that there is no real reason to work on a particular compurter, since all your information is now accessible from the web. Given this, it would still be nice to have your own setup, customizations, and files with you all the time, without needing to lug around a laptop. I was looking at the Imation solution for mobile secure computing called the Secure Workspace:
http://www.imation.com/en-US/Mobile-Security/Mobile-Security-Products/Secure-Mobile-Workspace/
This is basically a bootable USB drive with Windows 7 installed on it that provides a completely secure workspace (file encryption, cloud storage, secure communication/VPN channels) so that you could theoretically plug it into any machine and work. Pretty interesting stuff, especially when it comes to BYOD policies that are taking over the workplace.
To try this out, I tried a number of Linux OS’s installed a USB thumbdrive and realized quickly that it just won’t work. USB2 thumbdrives are just too slow, especially if the OS is configured for swap or paging (Windows). Although USB2 speeds are fine, the read/write speeds of the USB stick just won’t cut it trying to run a full OS from it. Researching different distros optimized for USB sticks, I came across Puppy Linux (http://puppylinux.org). It’s not the sexiest on the planet, but it has some very nice modifications that make it totally usable from a USB drive. The best parts are low memory footprint, runs from a Live CD ISO distro but still allows for saving of your environment through a clever mounting/saving scheme, and very extendable system through the use of SquashFS sfs files.
After a little tweaking, I now have a complete development environment running Puppy Linux 5.2, Eclipse Juno, and the Angstrom build tools on a little Corsair USB stick on my keychain. I run it completely within a VirtualBox (http://virtualbox.org) virtual machine with only 1GB of RAM (could be 512MB). This way, I can work on the local machine, but have the development environment working alongside in its own window, with little to no loss in performance on the host machine.
I’ve checked the project into a public Git repository if you want to recreate the setup. Check it out at: https://github.com/mlmassey/puppycfg
Those most interested might want to grab the Angstrom cross-tools SFS for building projects for the Beaglebone.
https://github.com/mlmassey/puppycfg/blob/master/angstrom_toolchain.sfs
July 10th, 2012 02:06am
Matt Massey
One basic thing I like to have running in any system is system level logging. This is very important when it comes to debugging problems, especially on embedded systems like the Beaglebone. The main objectives I had were:
1. Application level logging with multiple levels
2. Service/daemon based logging. This makes sure if the app crashes that we still get the last bits of log output
3. Non-volatile storage and log file rotation
In Linux systems, this is typically handled by the syslog function and syslogd. Looking into what was supported on the Beaglebone, I decided that syslog-ng or Busybox’s syslog functionality would work for my needs. The weird part that I noticed was that when I called syslog() from my application, there was no log file output. Very strange. Running ps -A showed that syslogd and klogd were not running. Going to the /etc/init.d and running ./syslog start would happily start the daemons and magically my log output would show up in /var/log/messages (Given that I was running the Busybox syslog daemon instead of syslog-ng). So, the question was, why was the system not starting syslog on initialization, and how do I start it?
After struggling with this for a couple of days, I check the Google groups for the Beagleboard and found only a few entries such as the following. In summary, system initialization is now handled by systemd. (you can find the man pages here) Don’t bother with trying to find your rc.local, adding entries to /etc/init.d, or editing the rc0-6.d files found under /etc. None of these options work. If you want to start services/daemons, you have to use systemd, since this is the only method supported by Angstrom.
Digging further, I found this little tidbit of knowledge. For Angstrom/Debian, you should note the following:
1. Syslog is now supported by the systemd journal
2. The journal is stored under /run/log/journal. The actual file is found under a crazy directory called something like 3dcac98d32a34633b2e9d755150dad4c, and is called system.journal. This file is binary, and cannot be read directly though.
3. To read the journal, you should use the following command: > journalctl. (man page for journalctl) This dumps all the contents of the journal in a human readable form. You can also issue the option -f (or –follow) to show the tail output (NOTE: In previous versions of Angstrom, the command was systemd-journalctl. This has been replaced in the latest v44-45 systemd)
4. You may have to modify the systemd configuration to set the log level. This can be found in /etc/systemd in the file system.conf. Uncomment the option LogLevel and set it to: LogLevel=debug
Using journalctl, I could confirm that my syslog() output was being logged correctly to the journal and I was slightly happier. It turns out that when you turn on syslog (Busybox), its actually hooking to the journal socket to get its output. So, there should be no reason to run syslog or syslog-ng given the systemd journal feature.
The journal is written to /run/log, which is volatile and will be lost on reboot. To persist the journal, you should create a directory called /var/log/journal (you will note it does not exist on stock Angstrom file systems). Once you create it, magically you will see a sub-directory created and the journal will be stored there. Running journalctl will show persistent (and historical) version of the journal (instead of just the /run/logs version) If you get an error like: ”Failed to iterate through journal: Cannot allocate memory“. , this is a bug in older versions of systemd. Upgrading your img or systemd should solve this issue.
To control the log file size, you can use the journald.conf file (found under /etc/system/systemd-journald.conf) and modify the SystemMaxUse options. From initial testing, it appears to be working well, but I will continue testing.
I’ve removed my last paragraph from the original post because it was hating on systemd. As the comments point out, the systemd documentation is quite good. I was mainly frustrated at lack of information on Angstrom and the incorrect information on system logging using syslog/syslog-ng.
April 26th, 2012 11:01pm
Matt Massey
I didn’t find too many good posts on how to enable OpenOCD JTAG debugging with the Beaglebone. The Readme with the BB is outdated and says OpenOCD support is still in the works. I’m glad to report that it appears to be working just fine. Here are the steps I took to get it running.
My setup is Ubuntu 11.10 running inside a Virtualbox VM, but this shouldn’t really matter. I took a few shortcuts (didn’t build the source, just downloaded, etc.). I’m running the A5 revision of the Beaglebone hardware.
There is a pretty nice page that runs through a lot of steps, but its slightly old and for the Beagleboard. You can reference it though if you like: http://elinux.org/BeagleBoardOpenOCD#Build_OpenOCD
1. Install the FTDI D2XX drivers in your host Linux system. You can grab the drivers from FTDI’s website. http://www.ftdichip.com/Drivers/D2XX.htm
Read the README next to the driver install for background information and how to install it. You may need to install libusb also:
sudo apt-get install libusb
Once you’ve installed the drivers, you can run lsusb to check that the FTDI interface is working on your connected Beaglebone.
matt@Ubuntu-VBox:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 002: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
You should note the PID/VID of the FTDI interface is actually 0403:6010. This caused problems later. I believe this is because it changed from previous board revisions (I’m using A5)
2. Install OpenOCD. Just issue
sudo apt-get install openocd
You can also just install it from the Ubuntu Software Center. The version from Ubuntu is 0.5.0-1, which looks like the latest you can get, even from Git.
3. Get the latest version from Git so that you can get the cfg scripts for the Beaglebone. Make sure Git is installed and issue:
git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd openocd
4. Copy the config scripts we need for the Beaglebone to your OpenOCD install directories. Thanks to all the dudes who contributed these scripts (whoever you are). In the instructions below, <Path to git clone openocd> should be replaced:
> sudo cp <path to git clone openocd>/tcl/board/ti_beaglebone.cfg /usr/share/openocd/scripts/board
> sudo cp <path to git clone openocd>/tcl/target/am335x.cfg /usr/share/openocd/scripts/target
5. You need to edit the ti_beaglebone.cfg file to correct the USB PID/VID, which is not correct. Look for the following line in the ti_beaglebone.cfg:
ft2232_vid_pid 0x0403 0xa6d0
You will need to replace this with the PID/VID from above when you issued lsusb:
ft2232_vid_pid 0x0403 0x6010
If you don’t do this, OpenOCD will complain that it can’t locate a suitable FTDI interface to connect to.
6. You are now ready to run OpenOCD. Make sure the Beaglebone is connected and the FTDI interface can be seen when you run lsusb. Just type:
> sudo openocd -f board/ti_beaglebone.cfg
You should see the following output:
Open On-Chip Debugger 0.5.0 (2011-08-26-10:27)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
16000 kHz
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
Info : max TCK change to: 30000 kHz
Info : clock speed 15000 kHz
Info : JTAG tap: am335x.jrc tap/device found: 0x0b94402f (mfg: 0x017, part: 0xb944, ver: 0x0)
Info : JTAG tap: am335x.dap enabled
Info : am335x.cpu: hardware has 6 breakpoints, 2 watchpoints
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x80000042, MEM_AP_TAR 0x80001140
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x80000042, MEM_AP_TAR 0x80001140
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x80000042, MEM_AP_TAR 0x80001140
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x80000042, MEM_AP_TAR 0x80001140
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x80000042, MEM_AP_TAR 0x80001150
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x80000042, MEM_AP_TAR 0x80001150
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x80000042, MEM_AP_TAR 0x800011c0
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x80000042, MEM_AP_TAR 0x800011c0
6. You can now telnet into the OpenOCD daemon and issue commands:
> telnet localhost 4444
If you want more information on commands, reference the OpenOCD homepage at http://openocd.sourceforge.net/
April 1st, 2012 12:09am
Matt Massey
Another nightmare upgrading WordPress to the latest 3.3.1. I wouldn’t do it, except that I’m afraid of leaving a backdoor since this site was hacked due to an older version of WordPress.
After the upgrade, I could no longer access the Admin screen. When I logged in, I just saw a blank white screen. This is known in the WordPress world as the ‘blank screen of death’.
My solution ended up being to disable all plugins. Many sites suggested to check the wp_config file to remove whitespaces. Yes, this sounds strange, but apparently its been a long standing problem in WordPress. This was not my problem.
http://www.colinmcnulty.com/blog/2008/07/08/solution-to-wordpress-blank-screen-of-death/
To disable plug-ins, you will need to follow the information in this link:
http://perishablepress.com/quickly-disable-or-enable-all-wordpress-plugins-via-the-database/
You need phpMyAdmin access to your MySQL database tables and run the following line of SQL:
UPDATE wp_options SET option_value = ‘a:0:{}’ WHERE option_name = ‘active_plugins’;
This solved the problem. The whole thing left a bad taste in my mouth for WordPress… again.
November 30th, 2008 06:35pm
Matt Massey
Product development follows a very well defined procedure that is the same for any type of product being built:
- Define
- Develop
- Test
- Release
When defining a product, typically marketing and engineering define a product specification and go through the a long, drawn out process of locking down the definition before development actually starts. There are a number of problems in this process though in modern product development:
- Marketing typically has a very high level product requirement, but lacks much of the finer details that actually are required to get a product built and that defines a majority of the actual work being done
- Engineering does not want to spend the time documenting requirements and technical plans/documents
- Engineering will start to work prior to requirements being finalized due to both rapid development schedules and to pipeline the process while marketing requirements are still being defined
- Test and QA are typically an afterthought. It also is typically “reactionary” or based on previous failures found, instead of predicting where failures will occur
What is QA (quality assurance) and test really though? Yes, it defines a set of tests that ensure a product meets a defined quality level, but what is the quality level definition? Aren’t these procedures and quality definitions actually defining the product? If so, why do we even bother with the process of writing requirements documents? Why don’t we just specify a series of tests that define the requirement and guarantee it actually meets it?
I bring this up because of two examples I’ve seen in working on product development:
1) I’ve defined a high level requirement such as “product must play an mp3 song”, to later find out that what was delivered was a product that did play an mp3, except that it could not play many of the different bitrates or had no volume control. You could argue this was due to lack of “requirements”, but the funny part is that it might pass through a QA process that was also defined based on “product must play an mp3 song” and did not factor in corner cases based on bitrates because the QA team had no idea on what bitrates were possible.
2) Certifications are a painful process that everyone hates, yet I’ve realized their value is establishing a base level functionality and guaranteeing the product meets it. If there is no certification process, the only way to ensure a product actually performs the way it should is to have some sort of test process. Either way, the test or certification now defines how the product should work. To build the product, someone must take in to account all tests and ensure that they build something that will pass all of them.
This may seem very obvious, but I believe many companies still don’t actually understand what this truly means. If you did, product definition should be altered to the following:
- Requirements should not be written in a document form. Requirements should actually be a series of tests that all result in either a pass or a failure. The product should then be developed to ensure all tests pass.
- To ensure the product meets marketing requirements, it means that marketing should own the definition and development of these tests. A QA manager or QA plan definer should then be tightly linked to the product definer or should be the same person.
- This also means no work can start unless test plans are in place
The main problem with this is that product definitions or requirements serve two purposes: to define the product as well as communicate the definition. If someone is asked to review a requirements doc that is actually a very long list of tests, they will not understand what the original purpose of the product is. Unfortunately, if you break the requirements documentation from the test definition, they will become out of synch. I believe this “readability” aspect of the product definition is a small price to pay for the efficiency gain of changing the development process as I described.
August 18th, 2006 09:25am
Matt Massey
This website was setup to house my resume and a few projects that I am working on or have previously worked on. Please take a look at the Resume section and the Project section for more information. You can also contact me through email at matt@mattlmassey.com.
April 29th, 2006 09:52am
Matt Massey
So far, I’m impressed by the simplicity of WordPress. For such a powerful and well-known tool, they have definitely kept it quite simple to edit and modify. My hats off to the WordPress team and their excellent job. Of course, I’m not complete with my editing, but it goes well so far.
April 22nd, 2006 09:02pm
Matt Massey
So I finally have the site up and running. I’m not sure what I’m going to blog about our why I have a blog, but I do need a website for posting of my work and thoughts, so I figured a WordPress blog is a good place to start. Most blogs I have ever read that ramble on about different subjects are quite dull, so my goal is to pick a theme to go with and focus completely on that. The only problem is, I am starting my life a-fresh right now, so my goals change daily as I try to choose that one thing that I want to focus on.
Two reoccuring themes seem to pound on my brain though: social and software. I am totally fascinated by user contributed systems. It is a thing of beauty to watch how groups of people can join together in these online systems and the astonishing amount of creativity that can emerge from the many intelligent people out there. The key thing is what I consider to be the universal human constant: everyone things they are more intelligent and more unique than everyone else. Due to social pressure and the need to be accepted though, humans will always choose “whatever everyone else thinks”. The Internet allows us to shed this weakness by leveling the playing field. There is no “looks” to conform to on the Internet. There is simply freedom of expression and beliefs with no worries of reprocussions and rejection. This allows humans to truly express what they are thinking without fear of alienating themselves. The second part is that social networking systems allow users to link up with other “like-minded” individuals that express this non-standard norm of thinking, thereby creating social exceptance where there could never could have possibly been one. This goes for the artist who is stuck in a desk job, to the closet S&M who is looking for a midget dominatrix. The Web2.0 people call this the long-tail of the Internet, but it is my hope and belief that this can turn the standard business and marketing general acceptance of the norm on its head, and allow for true expression of individuality in both personal life and business.
Pretty long for my first post.