<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>BEC Systems</title>
	
	<link>http://bec-systems.com/site</link>
	<description>Embedded Linux consulting.</description>
	<lastBuildDate>Mon, 16 Apr 2012 12:11:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/bec-systems" /><feedburner:info uri="bec-systems" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
		<title>A Linux Kernel Tracing Tutorial</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/DNN6MRKhftE/linux-tracing-tutorial</link>
		<comments>http://bec-systems.com/site/865/linux-tracing-tutorial#comments</comments>
		<pubDate>Tue, 31 Jan 2012 13:12:46 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=865</guid>
		<description><![CDATA[The Linux kernel has a fairly extensive tracing infrastructure that is quite useful for debugging.  There are a number of things you can do with tracing, but the focus of this article will be the traditional printk type debugging we often end up doing to trace initialization issues with a driver.  The following links provide [...]]]></description>
			<content:encoded><![CDATA[<p>The Linux kernel has a fairly extensive tracing infrastructure that is quite useful for debugging.  There are a number of things you can do with tracing, but the focus of this article will be the traditional printk type debugging we often end up doing to trace initialization issues with a driver.  The following links provide additional information on the linux kernel tracing infrastructure:</p>
<ul>
<li><a href="﻿http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=tree;f=Documentation/trace">﻿</a><a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=tree;f=Documentation/trace">http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=tree;f=Documentation/trace</a></li>
<li>Debugging the kernel using Ftrace &#8211; part 1: <a href="http://lwn.net/Articles/365835/">http://lwn.net/Articles/365835/</a></li>
<li>Debugging the kernel using Ftrace &#8211; part 2: <a href="http://lwn.net/Articles/366796/">http://lwn.net/Articles/366796/</a></li>
<li>Secrets of the Ftrace function tracer: <a href="http://lwn.net/Articles/370423/">http://lwn.net/Articles/370423/</a></li>
<li><a href="http://elinux.org/Kernel_Trace_Systems">http://elinux.org/Kernel_Trace_Systems</a></li>
</ul>
<p>In this example, I am working on a new audio driver.  The typical experience with a new driver is that you install it and nothing happens because something is not registered correctly with the Linux driver model.  So, the first thing I do is start with with the platform_device_add() function in my drivers init function.  To observe the kernel activity around the kernel platform code, I can do the following:</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; white-space: pre;">﻿﻿cd /sys/kernel/debug/tracing/<br />
echo 0 &gt; tracing_on﻿ (keep trace from filling up until we set filter)<br />
echo function_graph &gt; current_tracer<br />
echo platform* &gt; set_ftrace_filter<br />
echo 1 &gt; tracing_on<br />
cat trace_pipe (leave running in a different shell)<br />
&lt;insmod my driver&gt;</span></p>
<p>After executing the above, we see the following.  For this example, trace_pipe is preferred because the trace is then emptied and only new information is shown.</p>
<div id="_mcePaste">
<pre>0) + 30.518 us   |  platform_device_alloc();
0)               |  platform_device_add() {
0)   0.000 us    |    platform_uevent();
0) + 30.518 us   |  platform_uevent();
0)   0.000 us    |  platform_uevent();
0) + 30.518 us   |    platform_match();
0) + 30.518 us   |    platform_match();
0)   0.000 us    |    platform_match();
0)   0.000 us    |    platform_match();

...

0) + 30.518 us   |    platform_match();
0)   0.000 us    |    platform_match();
0)   0.000 us    |    platform_match();
0)   0.000 us    |    platform_match();
0)   0.000 us    |    platform_match();
0) ! 3936.767 us |  }
0) + 30.518 us   |  platform_uevent();
0) + 30.518 us   |  platform_device_alloc();</pre>
</div>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal;">From the above, I can conclude that the platform_match() is not succeeding, because I would expect some more activity.  At this point I chose to add a printk:</span><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal;"> </span></p>
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 7a24895..f9ce0c7 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -662,6 +662,8 @@ static int platform_match(struct device *dev, struct device_driver *drv)
        struct platform_device *pdev = to_platform_device(dev);
        struct platform_driver *pdrv = to_platform_driver(drv);

+       trace_printk("pdev-&gt;name = %s, drv-&gt;name = %s", pdev-&gt;name, drv-&gt;name);
+
        /* Attempt an OF style match first */
        if (of_driver_match_device(dev, drv))
                return 1;</pre>
<p>Now, if I re-run the trace, I see the following:</p>
<pre> 0)               |      /* pdev-&gt;name = soc_audio, drv-&gt;name = davinci_emac */
 0)   0.000 us    |    }
 0)               |    platform_match() {
 0)               |      /* pdev-&gt;name = soc_audio, drv-&gt;name = snd-soc-dummy */
 0)   0.000 us    |    }
 0)               |    platform_match() {
 0)               |      /* pdev-&gt;name = soc_audio, drv-&gt;name = soc-audio */
 0)   0.000 us    |    }
 0)               |    platform_match() {
 0)               |      /* pdev-&gt;name = soc_audio, drv-&gt;name = omap-pcm-audio */
 0)   0.000 us    |    }
 0) ! 4241.943 us |  } /* platform_device_add */</pre>
<p>From the above, it looks like we have a simple mismatch between &#8220;soc_audio&#8221; and &#8220;soc-audio.&#8221;  Fixing this problem, and re-installing the module, we now have:</p>
<pre> 0)               |    platform_match() {
 0)               |      /* pdev-&gt;name = soc-audio, drv-&gt;name = snd-soc-dummy */
 0)   0.000 us    |    }
 0)               |    platform_match() {
 0)               |      /* pdev-&gt;name = soc-audio, drv-&gt;name = soc-audio */
 0)   0.000 us    |    }
 0) + 91.553 us   |    platform_drv_probe();
 0) ! 4241.943 us |  } /* platform_device_add */</pre>
<p>Now we can see that the names match, and the probe function is now being called.  At this point, we may want to turn on tracing of some additional functions to try to determine what is happening next.</p>
<pre>echo "platform* snd* mydriver*" &gt; set_ftrace_filter</pre>
<p>And the result:</p>
<pre> 0)               |      /* pdev-&gt;name = soc-audio, drv-&gt;name = snd-soc-dummy */
 0)   0.000 us    |    }
 0)               |    platform_match() {
 0)               |      /* pdev-&gt;name = soc-audio, drv-&gt;name = soc-audio */
 0) + 30.517 us   |    }
 0)               |    platform_drv_probe() {
 0)               |      snd_soc_register_card() {
 0) + 30.518 us   |        snd_soc_instantiate_cards();
 0) ! 17852.78 us |      }
 0) ! 17883.30 us |    }
 0) ! 22125.24 us |  } /* platform_device_add */</pre>
<p>With the above additional information, we can continue to learn more about the flow through the kernel.</p>
<p>While all of the above could have been done with printk&#8217;s, it would have been more time consuming.  The kernel function tracing capabilities allow us to quickly get a high level view of the flow through the kernel without manually adding a bunch of printk statements.  The kernel tracing features are completely contained in the kernel without requiring additional user space utilities which makes it very convenient to use in embedded systems.  The low overhead is also important in resource constrained embedded systems.</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/DNN6MRKhftE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/865/linux-tracing-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/865/linux-tracing-tutorial</feedburner:origLink></item>
		<item>
		<title>The easy way to get serial terminal in Linux</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/suB2LZsxW9M/the-easy-way-to-get-serial-terminal-in-linux</link>
		<comments>http://bec-systems.com/site/859/the-easy-way-to-get-serial-terminal-in-linux#comments</comments>
		<pubDate>Thu, 26 Jan 2012 19:24:56 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=859</guid>
		<description><![CDATA[When doing embedded Linux development, most of us spend out time tethered to a target system with a serial cable, which is used for a serial console.  Minicom is the defacto serial terminal software for Linux.  However, Minicom is a little fussy in that you typically have to set it up for each port you [...]]]></description>
			<content:encoded><![CDATA[<p>When doing embedded Linux development, most of us spend out time tethered to a target system with a serial cable, which is used for a serial console.  Minicom is the defacto serial terminal software for Linux.  However, Minicom is a little fussy in that you typically have to set it up for each port you want to use.  This is no big deal, but is generally difficult for new users to understand, and yet another hurdle.  And with 8-port USB-&gt;serial adapters, I have a lot of ports to set up.</p>
<p>Just recently, I discovered that screen can be used as a serial terminal program:</p>
<pre>screen /dev/ttyUSB0 115200</pre>
<p>A few notes on using:</p>
<ul>
<li>to exit screen: Ctrl-a k</li>
<li>to write a hardcopy of the screen image: Ctrl-a h</li>
<li>to get help: Ctrl-?</li>
</ul>
<p>All the neat features of screen are two numerous to list here, but one more that I&#8217;ll point out is the scrollback/copy feature (activated by Ctrl-a [ ).  This allows you to scroll back and the navigation works much like VI &#8212; what could be nicer?</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/suB2LZsxW9M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/859/the-easy-way-to-get-serial-terminal-in-linux/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/859/the-easy-way-to-get-serial-terminal-in-linux</feedburner:origLink></item>
		<item>
		<title>Verizon UML290 and Sprint U600 USB Modems in Embedded Systems</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/PIZwUKaUbNw/verizon-uml290-and-sprint-u600-usb-modems-in-embedded-systems</link>
		<comments>http://bec-systems.com/site/842/verizon-uml290-and-sprint-u600-usb-modems-in-embedded-systems#comments</comments>
		<pubDate>Thu, 31 Mar 2011 17:08:22 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cellular]]></category>
		<category><![CDATA[Embedded Linux]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=842</guid>
		<description><![CDATA[Recently I tested support for the Verizon UML290 and Sprint U600 USB Cellular modems in an embedded Linux system.  Both modems support 3G and 4G networks, but only the 3G modes were tested due to lack of 4G coverage at the testing location. Fortunately, both modems function very similar to previous modems, so with the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I tested support for the Verizon UML290 and Sprint U600 USB Cellular modems in an embedded Linux system.  Both modems support 3G and 4G networks, but only the 3G modes were tested due to lack of 4G coverage at the testing location.</p>
<p><a rel="attachment wp-att-843" href="http://bec-systems.com/site/842/verizon-uml290-and-sprint-u600-usb-modems-in-embedded-systems/20110331_001"><img class="aligncenter size-large wp-image-843" title="20110331_001" src="http://bec-systems.com/site/wp-content/uploads/2011/03/20110331_001-600x450.jpg" alt="" width="600" height="450" /></a></p>
<p>Fortunately, both modems function very similar to previous modems, so with the drivers available in the Linux kernel, and standard <a href="http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/ppp">pppd support in OpenEmbedded</a>, they worked fine.</p>
<p>The Verizon UML290 modem provides a challenge in that it must be manually switched between 4G and 3G modes.  Typically this is done automatically by the vzaccess program Verizon supplies with the modem that runs on Windows.  The solution for this system was to manually set the modem to 3G mode as detailed on the following page:</p>
<p>﻿<a href="http://www.evdoinfo.com/content/view/3492/64/">http://www.evdoinfo.com/content/view/3492/64/</a></p>
<p>It appears that some embedded systems such as the Cradlepoint routers have implemented automatic 3G/4G switching support for the UML290, so this is no doubt possible with a little effort.</p>
<p>The Sprint U600 modem appears to default to 3G, or automatically switch inside the modem.</p>
<p>The same pppd scripts can be used with both modems:</p>
<pre># /etc/ppp/peers/verizon_um290
user a
password v
connect "/usr/sbin/chat -v -f /etc/ppp/peers/verizon_um290_chat"
defaultroute
usepeerdns
ttyACM0
921600
local
usepeerdns
debug
-detach
</pre>
<pre># /etc/ppp/peers/verizon_um290_chat
'' 'ATZ'
'OK' 'ATDT#777'
'CONNECT' ''
</pre>
<p>To initiate a connection:</p>
<pre>pppd call verizon_um290
</pre>
<p>With Verizon cellular modems, it appears that port 22 is often blocked, so if you need to access a remote device via ssh, you may need to run ssh on a higher port number.  With 4G networks, it appears that the networking setup may be different in that a public IP address may not be assigned.  From the above evdoinfo.com page, we find the following text:</p>
<p style="padding-left: 30px;">﻿﻿<em>This fix will also work for users looking to use their device for remote based applications because it assigns a public facing IP address (3G ONLY). With eHRPD you&#8217;re assigned a private IP in either 3G or 4G mode, which has prevents UML290 users from accessing remote applications.</em></p>
<p>Perhaps the Rev A HDR Service mode will also work in 4G mode, but its seems as cellular networks become more complicated, there will be more issues to deal with in using USB Cellular modems for remote access in embedded systems.</p>
<p>Past articles on USB Cellular modems:</p>
<ul>
<li><a href="http://bec-systems.com/site/353/sprint-598u-usb-broadband-modem-in-embedded-systems">http://bec-systems.com/site/353/sprint-598u-usb-broadband-modem-in-embedded-systems</a></li>
<li><a href="http://bec-systems.com/site/203/using-a-verizon-usb720-modem-in-an-embedded-linux-system">http://bec-systems.com/site/203/using-a-verizon-usb720-modem-in-an-embedded-linux-system</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/PIZwUKaUbNw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/842/verizon-uml290-and-sprint-u600-usb-modems-in-embedded-systems/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/842/verizon-uml290-and-sprint-u600-usb-modems-in-embedded-systems</feedburner:origLink></item>
		<item>
		<title>Git and Distributed Development</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/m-pkhKZ1o4g/git-and-distributed-development</link>
		<comments>http://bec-systems.com/site/832/git-and-distributed-development#comments</comments>
		<pubDate>Tue, 29 Mar 2011 12:10:42 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=832</guid>
		<description><![CDATA[This is part of an ongoing series of articles on the Git version control system. The &#8220;many repository&#8221; paradigm has been partly driven by the distributed development paradigm.  Git solves the problem of multiple developers working in multiple repositories very well.  Because we want to use and customize projects like the Linux kernel, U-boot, and [...]]]></description>
			<content:encoded><![CDATA[<p>This is part of an ongoing <a href="../tag/git">series of articles</a> on the Git version control system.</p>
<p>The &#8220;<a href="http://bec-systems.com/site/780/git-and-multiple-repositories">many repository</a>&#8221; paradigm has been partly driven by the  distributed development paradigm.  Git solves the problem of multiple  developers working in multiple repositories very well.  Because we want  to use and customize projects like the Linux kernel, U-boot, and  OpenEmbedded in our projects, then we naturally find ourself in the  situation where we need to manage multiple repositories.  Yes, you can  check the Linux kernel into your company Subversion repository, but you  are much better off long term if you bite the bullet and implement your  own Git infrastructure.</p>
<p>As we consider the product development process, we need to consider  the life cycle of a product.  Most products live for at least several  years, and will go through several software iterations.  If we can  update the software components we use, then we can add value to the  product in the form of new or updated drivers to support new  peripherals, new libraries, performance improvements, etc.  But, we are  dealing with millions of lines of source code, so we must have an  efficient way to deal with software projects of this size.  The below  Figure 2 illustrates how you might organize a typical project.  Notice  we can pull updates from the U-boot and Kernel source trees at any time  in the development process, and merge the changes with our own modifications.  We might have an outside team working an  application, and we then easily synchronize the repositories when it  makes sense.</p>
<p><a rel="attachment wp-att-740" href="http://bec-systems.com/site/?attachment_id=740"><img class="aligncenter size-full wp-image-740" title="git-distributed_600" src="http://bec-systems.com/site/wp-content/uploads/2010/10/git-distributed_600.png" alt="" width="600" height="358" /></a></p>
<p>There are many other design flows possible.  Once you have the  ability to support multiple branches and repositories easily, it becomes  trivial to implement a staging/testing repository for a QA processes,  maintenance repositories for supporting old releases, etc.</p>
<p>Even at a personal developer level, Git&#8217;s distributed capabilities offers many advantages.  Each Git workspace is actually a full Git repository.  This means you can check changes in locally, re-organize your changes, be able to track changes when off-line, etc.  For this reason, many developers are now using <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git-svn</a> when they need to work with Subversion repositories.  With git-svn, you have all the benefits of using git locally, and yet you can easily synchronize with Subversion repositories.  And this leads us to our next topic: cheap branches (coming soon).</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/m-pkhKZ1o4g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/832/git-and-distributed-development/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/832/git-and-distributed-development</feedburner:origLink></item>
		<item>
		<title>How do modern USB chargers work</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/MjVQMJ59vok/how-do-modern-usb-chargers-work</link>
		<comments>http://bec-systems.com/site/800/how-do-modern-usb-chargers-work#comments</comments>
		<pubDate>Sat, 19 Mar 2011 14:03:21 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[power management]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=800</guid>
		<description><![CDATA[As we help customers design products, we often try to leverage the latest cell phone practices and technologies.  One of these is USB charging.  There has been a push in recent years to standardize on USB chargers for cell-phones.  There are a number of organizations involved including the USB-IF and OMTP.  Two of the specification [...]]]></description>
			<content:encoded><![CDATA[<p>As we help customers design products, we often try to leverage the latest cell phone practices and technologies.  One of these is USB charging.  There has been a push in recent years to standardize on USB chargers for cell-phones.  There are a number of organizations involved including the <a href="http://www.usb.org">USB-IF</a> and <a href="http://www.omtp.org/">OMTP</a>.  Two of the specification available include:</p>
<ul>
<li>﻿﻿﻿<a href="http://internal.omtp.org/Lists/ReqPublications/Attachments/59/OMTP CCLDC V1.1 Final.pdf">http://internal.omtp.org/Lists/ReqPublications/Attachments/59/OMTP CCLDC V1.1 Final.pdf</a></li>
<li><a href="http://www.usb.org/developers/devclass_docs/Battery_Charging_V1_2.zip">http://www.usb.org/developers/devclass_docs/Battery_Charging_V1_2.zip</a></li>
</ul>
<p>There is also a Chinese standard titled the “<span style="text-decoration: underline;">Telecommunications Industry Standard of the PRC</span>&#8221; that has been instrumental in influencing these standards.</p>
<p>The fundamental problem is a battery powered device needs to know if it is plugged into a computer USB port, or a dedicated charger.  A standard USB port on a computer is only specified to provide 500mA.  Typically a dedicated charger that plugs into a wall outlet provides more current than 500mA so that the battery can be charged quicker.  To differentiate between a computer USB port, and a dedicated charger, the dedicated charger shorts the D+ and D- USB signals together with a resistance of less than 200 ohms (specified by USB-IF).</p>
<p>One of the goals of these standards is that any charger can be used with any battery powered device.  The next question is how do we handle the case where every USB charger has a different rated current?  How can a device that charges its battery at 1.7A be compatible with a charger that only outputs 0.7A?  One theoretical solution would be for the device to query the current capacity of the charger and then only use that much current.  It turns out a much simpler approach is used.  The USB-IF provides the following chart in the above specification:</p>
<div id="attachment_801" class="wp-caption aligncenter" style="width: 610px"><a rel="attachment wp-att-801" href="http://bec-systems.com/site/800/how-do-modern-usb-chargers-work/selection_009"><img class="size-large wp-image-801" title="USB-IF charger operating range" src="http://bec-systems.com/site/wp-content/uploads/2011/03/Selection_009-600x487.png" alt="" width="600" height="487" /></a><p class="wp-caption-text">taken from http://www.usb.org/developers/devclass_docs/Battery_Charging_V1_2.zip</p></div>
<p>As long as the charger outputs power in the Required Operating Range, the battery powered device must be able to use whatever power is available to charge its battery.  If the device uses more current than the charger can supply, the charger simply goes into a constant current mode and the battery charges slower than it would with a higher capacity charger.  Thus we have a very simple scheme where we can theoretically use any charger with any device.</p>
<p>As a simple test, I charged a Nokia N900 phone (which came with a  1.2A charger) with a smaller LG charger that is rated for 0.7A.  I  monitored the LG charger a couple times during charging to make sure it  was not getting hot.  It seemed to charge the N900 battery just fine.</p>
<p>When  purchasing after-market USB chargers, it is sometimes difficult to  determine if they have the USB D+ and D- lines shorted together.  In  once case I purchased a car USB charger that did not work with my  phones, but was able to &#8220;fix&#8221; it by disassembling it, and putting a  solder blob between the D+ and D- signals on the USB connector.</p>
<p><a rel="attachment wp-att-812" href="http://bec-systems.com/site/800/how-do-modern-usb-chargers-work/20110319_001"><img class="aligncenter size-medium wp-image-812" title="20110319_001" src="http://bec-systems.com/site/wp-content/uploads/2011/03/20110319_001-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a rel="attachment wp-att-815" href="http://bec-systems.com/site/800/how-do-modern-usb-chargers-work/20110319_002"><img class="aligncenter size-medium wp-image-815" title="20110319_002" src="http://bec-systems.com/site/wp-content/uploads/2011/03/20110319_002-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a rel="attachment wp-att-812" href="http://bec-systems.com/site/800/how-do-modern-usb-chargers-work/20110319_001"></a><a rel="attachment wp-att-813" href="http://bec-systems.com/site/800/how-do-modern-usb-chargers-work/20110319_003"><img class="aligncenter size-medium wp-image-813" title="20110319_003" src="http://bec-systems.com/site/wp-content/uploads/2011/03/20110319_003-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>While shorting the D+ and D- pins usually makes a charger work, it is nice to know if the charger is compliant with the USB-IF specification and is designed to work in the constant current mode without shutting down, catching fire, etc.</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/MjVQMJ59vok" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/800/how-do-modern-usb-chargers-work/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/800/how-do-modern-usb-chargers-work</feedburner:origLink></item>
		<item>
		<title>Git and Why Multiple Repositories</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/4dTJLjVQRPc/git-and-multiple-repositories</link>
		<comments>http://bec-systems.com/site/780/git-and-multiple-repositories#comments</comments>
		<pubDate>Thu, 17 Mar 2011 19:54:42 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=780</guid>
		<description><![CDATA[This is part of an ongoing series of articles on the Git version control system. This article discusses the trend in software configuration management toward multiple repositories, rather than one large repository.  In the past when many companies used Subversion or comparable systems, there was typically one huge company repository (I&#8217;ve seen them in the [...]]]></description>
			<content:encoded><![CDATA[<p>This is part of an ongoing <a href="http://bec-systems.com/site/tag/git">series of articles</a> on the Git version control system.</p>
<p style="text-align: justify;">This article discusses the trend in software configuration management toward multiple repositories, rather than one large repository.  In the past when many companies used Subversion or comparable systems, there was typically one huge  company repository (I&#8217;ve seen them in the 10&#8242;s of GB in size) that held a  hierarchical tree of all the company source code.  This worked fairly  well, and is comfortable in that the organization is very similar to a file system  directory structure.  However, this model is not very flexible in that  it does not have a consistent way to re-use components between different  projects.  Some people simply copy source code.  Some have a &#8220;common&#8221;  project that is included in all their other projects.  Subversion  externals can be used.  With Git, typically a separate repository is  created for each software component.  There are perhaps several reasons  for this, but one reason is that Git simply does not scale to huge  multi-GByte repositories.  However, this turns out to be a blessing in  disguise as I think it is a better model in many cases.  What we end up  with is more of a catalog of software components rather than a rigid hierarchy.</p>
<p><a rel="attachment wp-att-742" href="http://bec-systems.com/site/?attachment_id=742"><img class="aligncenter size-full wp-image-742" title="svn-vs-git_600" src="http://bec-systems.com/site/wp-content/uploads/2010/10/svn-vs-git_600.png" alt="" width="600" height="478" /></a></p>
<p style="text-align: justify;">There  is much emphasis these days on modular, re-usable software  components (Object Oriented Programming, plugins, etc.).  Why not keep  things modular at the repository level?  Another example of this type of  organization is the Internet itself.  It is not a hierarchy of  information, but rather a flat system that is organized by hyperlinks.</p>
<p style="text-align: justify;">One  of the benefits of organizing your source code this way is that it  encourages clean boundaries between software components.  Each software  component needs to stand on its own without being propped up  by header files located in an unrelated source tree 3 levels up in the directory hierarchy.  This type of organization forces us to make better use of standard build system practices.</p>
<p style="text-align: justify;">How do you implement this type of repository infrastructure?  Build systems such as OpenEmbedded, Gentoo, and the Android build system manage this fairly well.  However, Git also includes a feature named &#8220;submodules&#8221; that provides a mechanism for one repository to reference source code from another.  What you end up using really depends on your needs, and what you are trying to accomplish.</p>
<p>A <a href="http://bec-systems.com/site/778/git-overview-screencast">screencast</a> is also available that covers this topic.</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/4dTJLjVQRPc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/780/git-and-multiple-repositories/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/780/git-and-multiple-repositories</feedburner:origLink></item>
	</channel>
</rss>

