<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7610580425212672356</id><updated>2024-09-24T15:05:06.727-07:00</updated><category term="Olimex"/><category term="Arm Cortex-M4"/><category term="Ubuntu"/><category term="embedded systems"/><category term="stm32 E407"/><category term="E407"/><category term="STM32"/><category term="code"/><category term="programming"/><category term="3d printer"/><category term="DIY"/><category term="Eclipse"/><category term="GAE"/><category term="GCC"/><category term="GWT"/><category term="Google App Engine"/><category term="Hp 3210"/><category term="JAX-RS"/><category term="JSON"/><category term="Java"/><category term="Jersey"/><category term="Keil"/><category term="Lean prototyping"/><category term="Make Magazine"/><category term="Maxim 232"/><category term="Python"/><category term="REST"/><category term="Schema"/><category term="Temp"/><category term="UART"/><category term="USART1"/><category term="UTF-8"/><category term="Windows7"/><category term="XML"/><category term="XSD"/><category term="Xsane"/><category term="arm-usb-tiny-h"/><category term="asm jar"/><category term="clock configuration"/><category term="comment"/><category term="electronic design"/><category term="encoding"/><category term="frequency"/><category term="html"/><category term="jarjar"/><category term="javascript"/><category term="jtag"/><category term="linux"/><category term="linux mint"/><category term="max232"/><category term="minimum viable product"/><category term="open source engineering"/><category term="openocd"/><category term="proto shield"/><category term="rapid electronics prototyping"/><category term="rs232"/><category term="scanner"/><category term="ssh-add"/><category term="ssh-agent"/><category term="uVision5"/><category term="xmlHttpRequest"/><title type='text'>Tech Talk</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-6132375130110717536</id><published>2017-11-07T03:16:00.001-08:00</published><updated>2017-11-07T03:17:22.752-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="encoding"/><category scheme="http://www.blogger.com/atom/ns#" term="JSON"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="Schema"/><category scheme="http://www.blogger.com/atom/ns#" term="UTF-8"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><category scheme="http://www.blogger.com/atom/ns#" term="XSD"/><title type='text'>UTF-8 in Python</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I have been working a lot with python lately. Especially building tools that convert from Excel to JSON and XML. The data have been translations and similar, so encoding has been a real issue. Generally, it works well in python, but when working in a Windows environment, it is easy to go wrong among the different encoding standards such as &quot;UTF-8&quot; and CP1252 and so on. I won&#39;t pretend to be an expert on this at all. I have just tried to get the stuff working without having to understand too much of it. So if you have any useful background information about the snippets below, please go ahead and share a comment.&lt;br /&gt;
&lt;br /&gt;
Today this stole a couple of hours from me again, so I write this down as a memory annotation... once and for all!&lt;br /&gt;
&lt;br /&gt;
When using openpyxl, all strings are converted to &quot;UTF-8&quot; when reading the data from the workbook, so there is no need to do any conversion there or try to find any obscure encoding settings in Excel. This far all strings, Chinese, Swedish or Hungarian, have arrived correct.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
To Terminal&lt;/h3&gt;
Getting it correct when writing them to the terminal was a bit of a trick though. The trick seems to be to always write the text as bytes. To do this to stdout I had to this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;sys.stdout.buffer.write(message.encode(&#39;utf-8&#39;))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
To JSON&lt;/h3&gt;
When generating JSON-files it is important to make sure the json generator generates the right content by setting &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;ensure_ascii=False&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Then write the file as a binary file. Whatever I do, things seem to go wrong if I decode the string before writing it.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;with open(fileName, mode=&quot;wb&quot;) as jsonFile:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;jsonFile.write(bytes(json.dumps(dict_to_write, ensure_ascii=False), &#39;utf-8&#39;))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
To XML&lt;/h3&gt;
&lt;div&gt;
Again, create a binary file and write an encoded byte array rather than decoding to a string. I have used pybx to create bindings from the XSD files. Pybx builds on the minidom libraries... I think.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;from pyxb.namespace.builtin import XMLSchema_instance as xsi&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;bds = pyxb.utils.domutils.BindingDOMSupport()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;bds.declareNamespace(xsi)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;dom = self._root.toDOM(bds)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;bds.addAttribute(dom.documentElement, xsi.createExpandedName(&#39;schemaLocation&#39;), &quot;http://my_target_ns/ns1 ../xsd/my_schema.xsd&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;bds.addXMLNSDeclaration(dom.documentElement, xsi)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;if self._root is None:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; raise Exception(&quot;There is no root element to write to file.&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;if self._fileName is None:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; self._fileName = os.path.join(os.getcwd(), &#39;xml/&#39; + self._root.name + &#39;.xml&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;with open(self._fileName, &#39;wb&#39;) as xmlfile:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; xmlfile.write(dom.toprettyxml(indent=&#39;&amp;nbsp; &#39;, encoding=&#39;utf-8&#39;))
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Good Luck!&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/6132375130110717536/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2017/11/utf-8-in-python.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/6132375130110717536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/6132375130110717536'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2017/11/utf-8-in-python.html' title='UTF-8 in Python'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-7658337348038603200</id><published>2015-08-10T23:11:00.002-07:00</published><updated>2015-08-10T23:11:12.358-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arm Cortex-M4"/><category scheme="http://www.blogger.com/atom/ns#" term="clock configuration"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="E407"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded systems"/><category scheme="http://www.blogger.com/atom/ns#" term="frequency"/><category scheme="http://www.blogger.com/atom/ns#" term="Keil"/><category scheme="http://www.blogger.com/atom/ns#" term="Olimex"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="STM32"/><category scheme="http://www.blogger.com/atom/ns#" term="stm32 E407"/><category scheme="http://www.blogger.com/atom/ns#" term="uVision5"/><title type='text'>Clock setup for Olimex E407 using STM32CubeMX</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Recently I got a reason to dig up my old Olimex E407 board and the RS232 shield I made for it (see earlier posts on this blog). This time though, I&#39;m using Keil in Windows together with a ST Link V2. Getting the clocks and pll&#39;s right isn&#39;t an easy task, and certainly not a fun one, so I decided to give CubeMX and ST&#39;s HAL libraries a try.&lt;br /&gt;
&lt;br /&gt;
The STM32CubeMX program (download it from ST.com) is a fairly new invention, and the libraries leave a lot to whish for still, so you should be careful with it. The libraries are still ful of bugs, but they are also getting a lot better rapidly.&lt;br /&gt;
&lt;br /&gt;
Ok, first of course, download and install STM32CubeMX. If you want to launch it from Keil uVision, add the path to CubeMX to the system path environment variable. The start uVision5 and create a project for an STM407ZG.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1E1UzjnTMrnSZdHSZGpRQYUuERXR-EmEv9TqIMSk05CA1E0n-rE8oT6lHMiQLuTQLvGc1JUIUzo6kSq9SvHdvPhaM5vQ1E2_t8wK65dEzHTZDS0P14s-wrH1ODbO8hyYgJG4FG9wKdxiP/s1600/Target_runtime_settings.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;491&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1E1UzjnTMrnSZdHSZGpRQYUuERXR-EmEv9TqIMSk05CA1E0n-rE8oT6lHMiQLuTQLvGc1JUIUzo6kSq9SvHdvPhaM5vQ1E2_t8wK65dEzHTZDS0P14s-wrH1ODbO8hyYgJG4FG9wKdxiP/s640/Target_runtime_settings.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Start CubeMX by clicking the &quot;play&quot; button right of the STM32Cube Framework (API).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Now, the Olimex E407 board is equipped with a 12 MHz external crystal clock and a 32.768 kHz external RTC crystal, so we have to enable those pins first.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiomVyI8LV92sKsEH33rhNYcQsYfGQSP1Zs-S4JIXBcKSxQNDE3j0sRRUOZ2Qt9tkOFZYkybl2lq-lgsujek9aRrSsBBhWSWCBGKV6aRT7U6laukBxST9yUNxbOQtHgl3Cr4ooHuDny5xnr/s1600/Basic_CubeMX_clock.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiomVyI8LV92sKsEH33rhNYcQsYfGQSP1Zs-S4JIXBcKSxQNDE3j0sRRUOZ2Qt9tkOFZYkybl2lq-lgsujek9aRrSsBBhWSWCBGKV6aRT7U6laukBxST9yUNxbOQtHgl3Cr4ooHuDny5xnr/s640/Basic_CubeMX_clock.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Switch to the &quot;Clock Configuration&quot; tab and input 12 MHz as HSE input frequency and then make the following selections:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Select HSE as PLL Soure Mux&lt;/li&gt;
&lt;li&gt;Set the /M divider to /7&lt;/li&gt;
&lt;li&gt;Set the *N multiplier to x196&lt;/li&gt;
&lt;li&gt;Set the /P divider to /2&lt;/li&gt;
&lt;li&gt;Select PLLSLK as System Clock Mux&lt;/li&gt;
&lt;li&gt;Set APB1 Prescaler to /4&lt;/li&gt;
&lt;li&gt;Set APB2 Prescaler to /2&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGT8ThCgMc_kx_KITKjZJIDePUT-2DCTCf6ht-Mydmn2s54wGEuVm29oYpfrEG_uyCRLzWQff106gVHz9cZ7D6bilFx0QWjh0Drsb4UldXQU2DvXTLF8EbEkqUz9KyepK6aTqJe6mASKVJ/s1600/Basic_PLL_168MHz.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGT8ThCgMc_kx_KITKjZJIDePUT-2DCTCf6ht-Mydmn2s54wGEuVm29oYpfrEG_uyCRLzWQff106gVHz9cZ7D6bilFx0QWjh0Drsb4UldXQU2DvXTLF8EbEkqUz9KyepK6aTqJe6mASKVJ/s640/Basic_PLL_168MHz.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Save it and select &quot;Generate Code&quot; from the Project menu.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
When done, choose to close the CubeMX project and update the settings in uVision5.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A main.c file is generated for you that uses these new settings , ready to be filled in with your applicaiton source.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Good Luck&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/7658337348038603200/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2015/08/clock-setup-for-olimex-e407-using.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/7658337348038603200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/7658337348038603200'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2015/08/clock-setup-for-olimex-e407-using.html' title='Clock setup for Olimex E407 using STM32CubeMX'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1E1UzjnTMrnSZdHSZGpRQYUuERXR-EmEv9TqIMSk05CA1E0n-rE8oT6lHMiQLuTQLvGc1JUIUzo6kSq9SvHdvPhaM5vQ1E2_t8wK65dEzHTZDS0P14s-wrH1ODbO8hyYgJG4FG9wKdxiP/s72-c/Target_runtime_settings.PNG" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Stockholm, Sweden</georss:featurename><georss:point>59.329323499999987 18.068580800000063</georss:point><georss:box>59.07010549999999 17.423133800000063 59.588541499999984 18.714027800000064</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-6229565722554320928</id><published>2015-04-24T01:22:00.000-07:00</published><updated>2015-04-24T01:22:15.019-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="comment"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded systems"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>A Comment on Comments</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
During recent years I have worked with many very tech savvy people worthy of a lot of respect for their insight in embedded development. However, the discussion regarding comments seems to never die. The more tech oriented the developers, the less they seem to like comments in source and the more they seem to believe self commenting code exist. It doesn&#39;t. What exist is self commenting thoughts in your head. I have no chance whatsoever to get a good grasp of your ideas without reading them, or asking you.&lt;br /&gt;
&lt;br /&gt;
I have always taken a more customer focused approach, hoping that I won&#39;t have to explain myself too many times when I hand over the result of my efforts. Here are some things I would like to point out to all of you that doubt the usefulness code comments:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Code in itself can only describe what it does. Everything else are left out. All the experience you gained through experiments, fixing bugs and working with the environment is lost if you don&#39;t document it.&lt;/li&gt;
&lt;li&gt;Code can&#39;t explain what it doesn&#39;t do. All the alternatives to the approach you have taken. All the quirkyness of the libraries you are using. That takes a long time to get your head around as a new employee or contractor.&lt;/li&gt;
&lt;li&gt;Code doesn&#39;t explain its purpose. In best case, you can read out something from the function name or similar, but most of the time names like&amp;nbsp;&lt;i&gt;openAuxChannel &lt;/i&gt;leave you wandering WHY you would like to open an auxiliary channel.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
There are lots of other reasons to write and maintain the comments in the source. But there is also the question of the cost for commenting code. If you comment your code you spend time that not feel very productive. In one sense that&#39;s correct, you don&#39;t write code, so you&#39;re not moving towards the goal of the project. But quality has to be considered too, and maintainability and tracability are such parameters. Without them, the quality of your code is poor. It eventually boils down to the cost of developing a feature vs. the cost of owning it. Over time, the cost of owning poor code is MUCH higher than the gain of developing poor code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So, in the trade-off of commenting source and writing new features, I would like to promote some techniques that I practice:&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Use &lt;a href=&quot;http://www.doxygen.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;doxygen&lt;/a&gt;! You might not like browse the source in rendered HTML or PDF documents, but it gives others a great overview and a starting point that lets them get get up to speed with the source quickly.&lt;/li&gt;
&lt;li&gt;Write commenting scripts that puts skeletons of comments in your files, classes, members and functions. The cost of developing such a script is a lot less than the effort it saves. It takes away a lot of boring work as well! Often the IDE has some functionality for this, but I often get more fields into my doxygen comments with a script.&lt;/li&gt;
&lt;li&gt;Don&#39;t comment getters and setters. Programmers are not stupid, they will understand anyway. Though, if you have a script putting doxygen comment on them, they will become browsable when the documentation is rendered, and that&#39;s very convenient.&lt;/li&gt;
&lt;li&gt;Make sure you add comments to algorithmic code in the functions. These sections of comments are the most valuable. The not only explain your algorithm, it will affect your design too. If you notice that you have to explain flags and states set in objects or structures in other modules etc. it shows that your approach to the problem is probably not coherent enought, or easy enough. If you can&#39;t explain what you have done, you should refactor it.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/6229565722554320928/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2015/04/a-comment-on-comments.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/6229565722554320928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/6229565722554320928'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2015/04/a-comment-on-comments.html' title='A Comment on Comments'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Stockholm, Sweden</georss:featurename><georss:point>59.330387551573857 18.072509765625</georss:point><georss:box>59.072386051573858 17.427062765625 59.588389051573856 18.717956765625</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-3494161384207350079</id><published>2012-10-18T12:30:00.001-07:00</published><updated>2012-10-18T12:31:52.950-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asm jar"/><category scheme="http://www.blogger.com/atom/ns#" term="GAE"/><category scheme="http://www.blogger.com/atom/ns#" term="Google App Engine"/><category scheme="http://www.blogger.com/atom/ns#" term="jarjar"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JAX-RS"/><category scheme="http://www.blogger.com/atom/ns#" term="Jersey"/><category scheme="http://www.blogger.com/atom/ns#" term="REST"/><title type='text'>Making Jersey work with Google App Engine</title><content type='html'>I was looking for a way to get Jersey work in a Google App Engine application that I am working with. Things seems to work just fine with the local test server, but deployed in the production environment it fails&amp;nbsp;miserably.&lt;br /&gt;
&lt;br /&gt;
The answer to the problem wasn&#39;t easy to find at all, but after plenty of googling i found a&lt;a href=&quot;http://blog.harrywye.com/post/30160964741/running-java-jersey-with-jdo-3-0-on-google-app-engine&quot; target=&quot;_blank&quot;&gt; this post&lt;/a&gt; that the answer I was looking for.&lt;br /&gt;
&lt;br /&gt;
I will here summarize the steps in a bit shorter post and hope that it will make this solution a little bit easier to find for others.&lt;br /&gt;
&lt;br /&gt;
The problem boils down to the dependency of the asm jar file. The new versions of the GAE libraries use asm-4.0.jar but Jersey still depends on asm-3.1.jar. There are some posts out there that suggest that you can remove the asm-4.0.jar and change the data nucleus version to v1. &lt;b&gt;WARNING!!!&lt;/b&gt; Doing this messed my eclipse up totally. I never got it to work properly again and had to reinstall it and all the plug-ins!&lt;br /&gt;
&lt;br /&gt;
What Harry Wye suggests on his blog is to repackage the jar files depending on asm-3.1 using &lt;a href=&quot;http://code.google.com/p/jarjar/&quot; target=&quot;_blank&quot;&gt;Jarjar Links&lt;/a&gt;. This worked fine for me using version 1.3. 1.4 gave me a manifest attribute error. I am not terribly experienced in Java, so I don&#39;t know why this happend or what to do about it (if you know... please share it in a comment on this page), but trying 1.3 did the work for me.&lt;br /&gt;
&lt;br /&gt;
To repackage the jersey server jar (which is the only one depending on asm), you first have to create a file (rule.txt) with this content:&lt;br /&gt;
&lt;span style=&quot;background-color: white; line-height: 18px; outline: none;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;rule org.objectweb.asm.** &amp;nbsp;org.objectweb.asm3.@1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; line-height: 18px; outline: none;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px; outline: none;&quot;&gt;Then run jarjar:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px; outline: none;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;outline: none;&quot;&gt;java -jar jarjar-1.3.jar process testrules.txt asm-3.1.jar asm-3.1r.jar&lt;/span&gt;&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;outline: none;&quot;&gt;java -jar jarjar-1.3.jar process testrules.txt jersey-server-1.14.jar jersey-server-1.14r.jar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Now you can deploy Jersey with the modified jars along with asm-4.0.jar in your GAE application.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;outline: none;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Good Luck&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/3494161384207350079/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2012/10/making-jersey-work-with-google-app.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/3494161384207350079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/3494161384207350079'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2012/10/making-jersey-work-with-google-app.html' title='Making Jersey work with Google App Engine'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-5213615533889178308</id><published>2012-10-01T02:49:00.000-07:00</published><updated>2012-10-01T02:49:43.054-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="E407"/><category scheme="http://www.blogger.com/atom/ns#" term="max232"/><category scheme="http://www.blogger.com/atom/ns#" term="Maxim 232"/><category scheme="http://www.blogger.com/atom/ns#" term="Olimex"/><category scheme="http://www.blogger.com/atom/ns#" term="proto shield"/><category scheme="http://www.blogger.com/atom/ns#" term="rs232"/><category scheme="http://www.blogger.com/atom/ns#" term="STM32"/><category scheme="http://www.blogger.com/atom/ns#" term="UART"/><category scheme="http://www.blogger.com/atom/ns#" term="USART1"/><title type='text'>DIY RS232 shield for the Olimex E407</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt0VOytNYdztNpDeaLX8S1m-0kREJijhiHYmfIG3s6WReBq5sUBJVYlhQAuafpA0f1cjyBeHT_XdFa_MoB6RqcMAngo70KoR7dhKsO51Yk2z9y1WglqP0ddsGl1M7yQyEKvGr6Vel_l3n7/s1600/20121001_112913.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt0VOytNYdztNpDeaLX8S1m-0kREJijhiHYmfIG3s6WReBq5sUBJVYlhQAuafpA0f1cjyBeHT_XdFa_MoB6RqcMAngo70KoR7dhKsO51Yk2z9y1WglqP0ddsGl1M7yQyEKvGr6Vel_l3n7/s320/20121001_112913.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
My first hardware project with the E407 was to create an RS232 shield (they can be bought if you don&#39;t want to build it yourself). I used olimed own arduino proto shield. I happened to have a Maxim 232 driver circuit in my drawer, and also the five 1uF electrolytic capacitors needed to create this board.&lt;br /&gt;
&lt;br /&gt;
First of all I discovered that the Olimex proto shield doesn&#39;t fit the board very well. I had to grind off one of the corners to make it fit with the power supply capacitors on the E407 board. A regular proto shield won&#39;t fit better... it seems like the capacitors aren&#39;t too well placed on the E407 board :-/&lt;br /&gt;
&lt;br /&gt;
Since I am not very experienced in programming the STM32 processor I had to verify the construction with an AVR I had laying around and it seemed to work fine. I couldn&#39;t make it work with the E407 though.&lt;br /&gt;
&lt;br /&gt;
I found out that the source I had downloaded from ST&#39;s site is designed for the Discovery board which has an 8 MHz external clock source. The E407 has a 12MHz clock. I had to generate a new system file with ST&#39;s excel tool. The patch can be found &lt;a href=&quot;http://pastebin.com/Yg6hQHSc&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I then compiled the example from &lt;a href=&quot;http://eliaselectronics.com/2012/07/18/stm32f4-usart-example-with-interrupt/&quot; target=&quot;_blank&quot;&gt;Elias electronics blog&lt;/a&gt;, which seemed to work fine.&lt;br /&gt;
&lt;br /&gt;
Good luck!</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/5213615533889178308/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2012/10/diy-rs232-shield-for-olimex-e407.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/5213615533889178308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/5213615533889178308'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2012/10/diy-rs232-shield-for-olimex-e407.html' title='DIY RS232 shield for the Olimex E407'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt0VOytNYdztNpDeaLX8S1m-0kREJijhiHYmfIG3s6WReBq5sUBJVYlhQAuafpA0f1cjyBeHT_XdFa_MoB6RqcMAngo70KoR7dhKsO51Yk2z9y1WglqP0ddsGl1M7yQyEKvGr6Vel_l3n7/s72-c/20121001_112913.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-700055300598667213</id><published>2012-09-18T00:51:00.000-07:00</published><updated>2012-09-18T00:51:16.845-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3d printer"/><category scheme="http://www.blogger.com/atom/ns#" term="DIY"/><category scheme="http://www.blogger.com/atom/ns#" term="electronic design"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded systems"/><category scheme="http://www.blogger.com/atom/ns#" term="Lean prototyping"/><category scheme="http://www.blogger.com/atom/ns#" term="Make Magazine"/><category scheme="http://www.blogger.com/atom/ns#" term="minimum viable product"/><category scheme="http://www.blogger.com/atom/ns#" term="open source engineering"/><category scheme="http://www.blogger.com/atom/ns#" term="rapid electronics prototyping"/><title type='text'>Lean electronic prototyping: Prove your assumptions</title><content type='html'>Conventionally, when developing electronic devices, companies tend to focus on developing a prototype hardware as the first stage. This is a complicated and expensive strategy that consumes large quantities of energy and money in a &lt;i&gt;design up-front&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7AwuAlTlClGf7dZllv0rb9en14WYYHpRHFXFGBIUlfBLasPBwFPYrT2t5HU2cDM_kRLwUtcbtossNVFa2U5gxI0ysGhjjRkVKoZcxLmpPi0dR8aijiihbDpn_C4b2OfBtaT5aOL9zsJpK/s1600/20120918_094145.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7AwuAlTlClGf7dZllv0rb9en14WYYHpRHFXFGBIUlfBLasPBwFPYrT2t5HU2cDM_kRLwUtcbtossNVFa2U5gxI0ysGhjjRkVKoZcxLmpPi0dR8aijiihbDpn_C4b2OfBtaT5aOL9zsJpK/s320/20120918_094145.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A complete electronics development studio, open source only!&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
There are alternatives however. Today there are many open source circuit boards to choose from off the shelf, that suits almost any need for an embedded system. These boards are extremely cheap, and the tools for them are almost always open source, and thus, also free.&lt;br /&gt;
&lt;br /&gt;
The &lt;a href=&quot;http://makezine.com/&quot;&gt;maker movement&lt;/a&gt; and DIY (Do It Yourself) trend has brought embedded development to be a serious hobby alternative for anyone... even kids. And there isn&#39;t just toy&amp;nbsp;functionality&amp;nbsp;offered on these cheap hobbyist boards, it is real computer power and connectivity there, such as USB, Bluetooth,&amp;nbsp;internet working, motor&amp;nbsp;control. There are even circuit boards meant to be sewn into your clothes with conducting thread! All from the price of 20$ USD or so. In combination with mobile phones, cloud services and integration with other systems, these systems form a very powerful tool for innovation.&lt;br /&gt;
&lt;br /&gt;
One of the most eye catching applications is off course the home &lt;a href=&quot;http://printrbot.com/&quot;&gt;3D printers&lt;/a&gt; that has started to pop up in the market. For about 600$ USD, you get your own mechanical factory! The CAD-tools used for these are also often free and/or open source. With the 3D printers you can manufacture mechanical parts for your invention with very small means. This becomes a very important missing&amp;nbsp;piece&amp;nbsp;in the prototyping process that often tends to become the most expensive step when developing the prototype.&lt;br /&gt;
&lt;br /&gt;
With the right prototyping strategy, a company can focus on developing quite advanced &lt;i&gt;Minimum Viable Products&lt;/i&gt;&amp;nbsp;that they actually can test in the hands of a real customer. This will give a much more trust worthy feedback, and will help the company to eliminate waste in the development process.&lt;br /&gt;
&lt;br /&gt;
The sad truth is that the most important properties of a system are the least costly to develop. Many electronic devices are completely depending on a good the user experience, which in most cases are implemented in software. I&#39;m not saying that the industrial design of a device is unimportant, on the contrary, but in the development of a minimum viable product, or prototype, you should focus on proving your assumptions regarding the customers needs/desires. To do this, the shortest and cheapest way is often to realize the solution in software. With the use of a lean prototyping strategy, the trade off between software functionality and industrial design can become less dramatic.&lt;br /&gt;
&lt;br /&gt;
So what&#39;s the catch? ...&lt;br /&gt;
&lt;br /&gt;
Well, there are off course down sides of these methods. To face the truth, the quality of the open source tools often leave a lot to wish for. Setting up a development environment based on open source CAN be done, but it takes it&#39;s fair amount of googling and experimenting to get it running. The documentation is often in a poor state, or none existing. This puts a big burden on the developers involved and the project becomes a lot more dependent on a high level of skills of the team members.&lt;br /&gt;
&lt;br /&gt;
I would like to point out though, that during my time as a devloper and project manager in embedded systems projects, I cannot recall one single occasion when I have received any useful support from a company we have bought &quot;closed source&quot; tools from. So the increase in risk, is probably&amp;nbsp;leveled out by the probability that you would actually get what you pay for, when using proprietary closed source software.&lt;br /&gt;
&lt;br /&gt;
So keep it lean; focus on the customer, eliminate waste, keep the iterations short.</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/700055300598667213/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2012/09/lean-electronic-prototyping-prove-your.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/700055300598667213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/700055300598667213'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2012/09/lean-electronic-prototyping-prove-your.html' title='Lean electronic prototyping: Prove your assumptions'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7AwuAlTlClGf7dZllv0rb9en14WYYHpRHFXFGBIUlfBLasPBwFPYrT2t5HU2cDM_kRLwUtcbtossNVFa2U5gxI0ysGhjjRkVKoZcxLmpPi0dR8aijiihbDpn_C4b2OfBtaT5aOL9zsJpK/s72-c/20120918_094145.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-4118611066834641165</id><published>2012-09-15T04:21:00.000-07:00</published><updated>2012-09-17T02:00:30.508-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arm Cortex-M4"/><category scheme="http://www.blogger.com/atom/ns#" term="GCC"/><category scheme="http://www.blogger.com/atom/ns#" term="Olimex"/><category scheme="http://www.blogger.com/atom/ns#" term="stm32 E407"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Building the GCC tool chain for the STM32F4</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWqCDiFkvG_aw2QWbKq4Cq1o6IMOnbjLZtZsiJYgBp-vPyBaJSahw3Xw-EMNg5XsYVbq_4DssfClcppo-jctAAoQvRJv2GiI_-KuecmlkcCkBJHUw68TQ-Law9z9iC3H0gjo3e1-TTfAAA/s1600/20120915_130230.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWqCDiFkvG_aw2QWbKq4Cq1o6IMOnbjLZtZsiJYgBp-vPyBaJSahw3Xw-EMNg5XsYVbq_4DssfClcppo-jctAAoQvRJv2GiI_-KuecmlkcCkBJHUw68TQ-Law9z9iC3H0gjo3e1-TTfAAA/s320/20120915_130230.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;b id=&quot;internal-source-marker_0.14676643488928676&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;So... I have to develop some applications on bare metal arm processors and need to practice a bit on a development board before I get started with the customer. The applications will be written in C, but I also want to investigate how C++ fits a project like this. The program is an audio application which eventually will use some filtering and asynchrounous USB transfer.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;I have chosen an Olimex Board (STM32-E407) since it conforms to the Arduino form factor and has a processor close to the model used by my custormer. A JTAG was and a couple of development shields were ordered as well.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Before I can get started I need a toolchain to compile my applications. I could download a prebuilt toolchain from Mentor Graphics (Code Sourcery), but I wanted to see how if I could build one myself.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;I have a 32 bit Ubuntu 12.04 host, and I tried to follow two other howto’s but none of them worked, so I had to mix the instructions from both. (&lt;/span&gt;&lt;a href=&quot;http://www.triplespark.net/elec/pdev/arm/stm32.html&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #1155cc; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://www.triplespark.net/elec/pdev/arm/stm32.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, &lt;/span&gt;&lt;a href=&quot;http://jeremyherbert.net/get/stm32f4_getting_started&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #1155cc; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://jeremyherbert.net/get/stm32f4_getting_started&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;First install the tools needed for building the toolchain:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$sudo apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo build-essential libftdi-dev libzip-dev&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now clone the source repository:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Note&lt;span style=&quot;font-weight: normal;&quot;&gt;: See the update below for instructions for GDB XML support!&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;$git clone git://github.com/esden/summon-arm-toolchain&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;$cd summon-arm-toolchain&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Since noone else will use my toolchain I will install the toolchain in my home directory: &lt;/span&gt;&lt;span style=&quot;background-color: white; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;~/tools/arm/arm-linaro-eabi-4.6.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Build the tool chain:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$./summon-arm-toolchain PREFIX=~/tools/arm/arm-linaro-eabi-4.6/ OOCD_EN=1 TARGET=arm-none-eabi LIBSTM32_EN=1 USE_LINARO=1 CPUS=2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;When done, check the result:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$&lt;install path=&quot;path&quot;&gt;/bin/arm-none-eabi-gcc --version &lt;/install&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;It should say something like this:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Courier New, Courier, monospace; font-size: x-small; font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;arm-none-eabi-gcc (Linaro GCC 4.6-2011.10) 4.6.2 20111004 (prerelease)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Copyright (C) 2011 Free Software Foundation, Inc.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;This is free software; see the source for copying conditions. &amp;nbsp;There is NO&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To be able to work efficiently on the command line I create an environment setup script. With this script I can have several different toolchains for different platforms, and different automation scripts, that doesn&#39;t pollute my systems PATH environment variables and  bash setup.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open up a text editor and create the file env.sh, looking like this:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;echo &quot;Olimex STM32-E407 Development Environment&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;#Sub shell &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;#Export the variables to use in the development environment&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;export PATH=~/tools/arm/arm-linaro-eabi-4.6/bin:$PATH&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;export PS1=&quot;[Olimex E407] \u@\h:\w\$ &quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;#Start a new shell with the exported variables&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Change the mode of the file:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$chmod +x env.sh&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Enter your environment:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$./env.sh&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To exit the environment shell, just type exit and you’ll be back to your normal prompt.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;From here I followed the last sections in &lt;/span&gt;&lt;a href=&quot;http://jeremyherbert.net/get/stm32f4_getting_started&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #1155cc; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://jeremyherbert.net/get/stm32f4_getting_started&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; to build the first test software.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Good luck!&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Update Sept. 17 2012&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To be able to debug the target I hade to rebuild the toolchain with XML support enabled in the GDB target.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;To do this you first need to install expat:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;$sudo apt-get install libexpat1 libexpat1-dev&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;Then find the GDB build target in the automated build script named &lt;i&gt;summon-arm-toolchain&lt;/i&gt; and add the parameter &quot;--with-expat \&quot; before the GDBFLAGS parameter (or add it to the GDBFLAGS variable).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;Now build the tool chain according to the instructions above.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/4118611066834641165/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2012/09/building-gcc-tool-chain-for-stm32f4.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/4118611066834641165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/4118611066834641165'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2012/09/building-gcc-tool-chain-for-stm32f4.html' title='Building the GCC tool chain for the STM32F4'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWqCDiFkvG_aw2QWbKq4Cq1o6IMOnbjLZtZsiJYgBp-vPyBaJSahw3Xw-EMNg5XsYVbq_4DssfClcppo-jctAAoQvRJv2GiI_-KuecmlkcCkBJHUw68TQ-Law9z9iC3H0gjo3e1-TTfAAA/s72-c/20120915_130230.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-7051321439628283139</id><published>2012-09-14T15:31:00.000-07:00</published><updated>2012-09-17T02:25:43.135-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arm Cortex-M4"/><category scheme="http://www.blogger.com/atom/ns#" term="arm-usb-tiny-h"/><category scheme="http://www.blogger.com/atom/ns#" term="jtag"/><category scheme="http://www.blogger.com/atom/ns#" term="Olimex"/><category scheme="http://www.blogger.com/atom/ns#" term="openocd"/><category scheme="http://www.blogger.com/atom/ns#" term="stm32 E407"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Setting up Olimex arm-usb-tiny-h with Ubuntu 12.04</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS9oxQtlwMKLCvR5WJm7tQx2e3mL877OPi9Z6RWiMFkUzv4OescYwS4cqv9386Cf07rEeBp8Ex0kkGWJf13xnmBiOZPyFMSSIPkBxYtCazcK48S-wjsIZypQY72prVzEiBy26bEfA54WQY/s1600/20120915_130305.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS9oxQtlwMKLCvR5WJm7tQx2e3mL877OPi9Z6RWiMFkUzv4OescYwS4cqv9386Cf07rEeBp8Ex0kkGWJf13xnmBiOZPyFMSSIPkBxYtCazcK48S-wjsIZypQY72prVzEiBy26bEfA54WQY/s320/20120915_130305.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;b id=&quot;internal-source-marker_0.17732692509889603&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Along with the Olimex E407 board, I also ordered an Olimex arm usb tiny h JTAG to be able to program the board. I am more convenient with working in Linux than other operating systems so I really wanted this to work with my Ubuntu 12.04 (32bit x86) installation.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;This was a bit tricky, and it has taken some time to Google for all the bits and pieces that finally made it work.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;First I downloaded libftdi 0.20 from here: &lt;/span&gt;&lt;a href=&quot;http://www.intra2net.com/en/developer/libftdi/download.php&quot;&gt;&lt;span style=&quot;color: #1155cc; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://www.intra2net.com/en/developer/libftdi/download.php&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Build it with the normal series of auto tools commands:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;$./configure&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;$make&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;$sudo make install&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;I am not sure if both are needed, but to be on the safe side I downloaded the ftd2xx driver and installed it as well. You can get it here: &lt;/span&gt;&lt;/b&gt;&lt;a href=&quot;http://www.ftdichip.com/Drivers/D2XX.htm&quot;&gt;http://www.ftdichip.com/Drivers/D2XX.htm&lt;/a&gt;. Copy the libftd2xx.so.1.1.12 and libftd2xx.a to /usr/local/lib and make symlinks with the names libftd2xx.so and libftd2xx.so.1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;I downloaded and compiled openOCD 0.6.0 from here &lt;/span&gt;&lt;a href=&quot;http://openocd.sourceforge.net/&quot;&gt;&lt;span style=&quot;color: #1155cc; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://openocd.sourceforge.net/&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and build it with:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 15px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Note:&lt;span style=&quot;font-weight: normal;&quot;&gt; See updated instruction regarding patch below!&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$./configure --enable-ftdi --enable-ft2232_ftd2xx&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$make&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$make install &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;When plugging in the arm-usb-tiny-h, you will not be granted access by default. To handle this you have to create a rule for udev:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$cd /etc/udev/rules.d&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As root, create a file named 99-olimex-arm-usb-tiny-h.rule with this content:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;SUBSYSTEMS==&quot;usb&quot;, ATTRS{idVendor}==&quot;15ba&quot;, ATTRS{idProduct}==&quot;002a&quot;, MODE=&quot;0666&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I also removed the brltty package which might interfere with some of the ftdi drivers, but this was only a precaution. You could try running without removing it.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$sudo apt-get remove brltty&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now I run openOCD with the following command (paths relative from where I built openOCD):&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$openOCD -f tcl/interfaces/ftdi/olimex-arm-usb-tiny-h.cfg -f stm32f4x.cfg&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You can download the stm32f4x.cfg from Olimex web site.&lt;br /&gt;
&lt;br /&gt;
Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Update Sept 17 2012&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Apply the patch provided by this site:&amp;nbsp;&lt;a href=&quot;http://pastebin.com/rdFF2eZd&quot;&gt;http://pastebin.com/rdFF2eZd&lt;/a&gt;&amp;nbsp;before configuring and buildng openOCD&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/7051321439628283139/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2012/09/setting-up-olimex-arm-usb-tiny-h-with.html#comment-form' title='2 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/7051321439628283139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/7051321439628283139'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2012/09/setting-up-olimex-arm-usb-tiny-h-with.html' title='Setting up Olimex arm-usb-tiny-h with Ubuntu 12.04'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS9oxQtlwMKLCvR5WJm7tQx2e3mL877OPi9Z6RWiMFkUzv4OescYwS4cqv9386Cf07rEeBp8Ex0kkGWJf13xnmBiOZPyFMSSIPkBxYtCazcK48S-wjsIZypQY72prVzEiBy26bEfA54WQY/s72-c/20120915_130305.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-2630064813687789540</id><published>2012-04-02T00:04:00.000-07:00</published><updated>2012-04-02T00:04:29.921-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="linux mint"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh-add"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh-agent"/><title type='text'>Ssh-agent on Linux Mint 12</title><content type='html'>I have had som struggle setting up ssh agent to work with my Linux Mint machines. Both are running Linux Mint 12 and are fairly recently installed. What I want to do is to be able to log in from one host (called vader) on the other (called leia) without having to enter password every time and I don&#39;t want to generate keys with empty passwords.&lt;br /&gt;
&lt;br /&gt;
First of all, I discovered that on Linux Mint 12, the firewall is turned on by default which prevented me from loging on to &#39;leia&#39; with ssh. So, make sure your firewall is letting traffic through on port 22.&lt;br /&gt;
&lt;br /&gt;
Now, generate keys as usual on your local host and enter a password for them:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;vader$&amp;gt; ssh-keygen -t rsa&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Install the public key on the host you want to connect to:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;ssh-copy-id -i &lt;your_public_key_file&gt; &lt;you&gt;@&lt;the_host_to_connect_to&gt;&lt;/the_host_to_connect_to&gt;&lt;/you&gt;&lt;/your_public_key_file&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;In my case, it looks like this:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;vader$&amp;gt; ssh-copy-id -i ~/.ssh/id_rsa.pub peter@leia&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now, it is time to load your key into memory. This is done with the program ssh-add, but first you have to start an instance of ssh-agent.&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;vader$&amp;gt; ssh-agent bash&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;vader$&amp;gt; ssh-add&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The ssh-add command will automatically load ~/.ssh/id_rsa into the agent and ask you for the password you&#39;ve set. From now on I don&#39;t have to enter a password when logging in to leia, as long as I stay in the ssh-agent shell.&lt;br /&gt;
&lt;br /&gt;
Good luck!</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/2630064813687789540/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2012/04/ssh-agent-on-linux-mint-12.html#comment-form' title='1 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/2630064813687789540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/2630064813687789540'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2012/04/ssh-agent-on-linux-mint-12.html' title='Ssh-agent on Linux Mint 12'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-366391036311515203</id><published>2012-03-23T01:24:00.001-07:00</published><updated>2012-03-26T02:36:52.330-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="GWT"/><category scheme="http://www.blogger.com/atom/ns#" term="Temp"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows7"/><title type='text'>Windows Temp folder prevents Eclipse from starting</title><content type='html'>Since a couple of months I have had the pleasure of working on a Google Web Toolkit (GWT) project. Google have produced a range of quite well integrated tools for it an it is quite a smooth experience, even on an embedded platform such as the one I am working with.&lt;br /&gt;
&lt;br /&gt;
Unfortunatelly, it seems that the Google Plugin for Eclipse (GPE) relies heavily on the users local Temp folder in windows, and generates quite a lot of files to it. After a couple of months, first eclipse, then MinGW, simply wouldn&#39;t start. Or sometimes i took hours to get it working. It turns out that you can&#39;t have too many files and folders in a folder, and there is no mechanism in Windows (that I know of) to automatically clean out the Temp folder or even give a warning when it becomes full. If the Temp folder gets full, it prevents some programs from operating correctly.&lt;br /&gt;
&lt;br /&gt;
Solution: Delete the content of the Temp folder (&quot;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;C:\Users\&#39;your user name&#39;\Appdata\Local\Temp&lt;/span&gt;&quot; in Windows 7). It&#39;s as simple as that.... and it worked like a charm for me.&lt;br /&gt;
&lt;br /&gt;
Good Luck</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/366391036311515203/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2012/03/windows-temp-folder-prevents-eclipse.html#comment-form' title='1 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/366391036311515203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/366391036311515203'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2012/03/windows-temp-folder-prevents-eclipse.html' title='Windows Temp folder prevents Eclipse from starting'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-672487366910604944</id><published>2011-03-25T00:05:00.000-07:00</published><updated>2011-03-25T00:05:54.880-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hp 3210"/><category scheme="http://www.blogger.com/atom/ns#" term="scanner"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Xsane"/><title type='text'>Hp 3210 URL for scanning</title><content type='html'>I have a Hp 3210 printer/scanner/copier. It works perfect with Ubuntu, but everytime I have to set it up for scanning i run into problems finding out what parameters I need to start xsane. Here&#39;s how to find the url:&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Use the program hp-makeuri to generate the uri&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ hp-makeuri 192.168.1.20&lt;/span&gt;&lt;/div&gt;&lt;div&gt;the result is in my case:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SANE URI: hpaio:/net/Photosmart_3200_series?ip=192.168.1.20&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now xsane can be started with the uri as parameter:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;xsane hpaio:/net/Photosmart_3200_series?ip=192.168.1.20&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/672487366910604944/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2011/03/hp-3210-url-for-scanning.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/672487366910604944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/672487366910604944'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2011/03/hp-3210-url-for-scanning.html' title='Hp 3210 URL for scanning'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-800827635984576441</id><published>2011-03-24T03:42:00.000-07:00</published><updated>2011-03-24T03:42:31.310-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="xmlHttpRequest"/><title type='text'>xmlHttpRequest.status=0</title><content type='html'>Hi everyone!&lt;br /&gt;
This will be a short one, but I just came across some problems during the process of learning javascript again. It&#39;s a long time since I worked with client side web technology, so it&#39;s fun to discover how far things have come during recent years.&lt;br /&gt;
&lt;br /&gt;
Anyway, in my effort of building a GMail Contextual gadget i have to send some data to a http server using xmlHttpRequest. The gadget runs in an iFrame which will stop you from using xmlHttpRequest. It&#39;s called &lt;i&gt;cross domain blocking&lt;/i&gt;&amp;nbsp;or something. So the first you&#39;ll have to do is to short circuit the cross domain blocking by adding the header &lt;i&gt;&quot;Access-Control-Allow-Origin: *&quot;&lt;/i&gt;&amp;nbsp;to the response.&lt;br /&gt;
&lt;br /&gt;
In php:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;header(&#39;Content-type: text/html&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;header(&#39;Access-Control-Allow-Origin: *&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#39;t do this you will inevitably get redystate=4 and status=0 (or &#39;unknown&#39; or something) for the xmlHttpRequest object.&lt;br /&gt;
&lt;br /&gt;
The second mistake i made was the trigger button for the request. Using a &lt;i&gt;submit&lt;/i&gt;&amp;nbsp;input and the &lt;i&gt;onClick&lt;/i&gt;&amp;nbsp;event will generate two callbacks. One to the forms action, and one to the actual function you specified in the onClick. This messes things up and you&#39;re back with status=0 problem again.&lt;br /&gt;
&lt;br /&gt;
Solution: Use input type=&quot;button&quot;. This input will not trigger the forms actionl.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;form name=&quot;fakeform&quot; action=&quot;return false;&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;input type=&quot;button&quot; value=&quot;Go&quot; onClick=&quot;doRequest();&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a good example of how to write the doRequest function:&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/247483/http-get-request-in-javascript&quot;&gt;http://stackoverflow.com/questions/247483/http-get-request-in-javascript&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Good luck!</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/800827635984576441/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2011/03/xmlhttprequeststatus0.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/800827635984576441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/800827635984576441'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2011/03/xmlhttprequeststatus0.html' title='xmlHttpRequest.status=0'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-8086613370812454884</id><published>2009-07-09T00:41:00.000-07:00</published><updated>2009-07-09T01:10:34.507-07:00</updated><title type='text'>Google Sites</title><content type='html'>I mina försök att tränga djupare i Googles tekniker och produkter har turen kommit till &lt;span style=&quot;font-style: italic;&quot;&gt;Google Sites&lt;/span&gt;, en onlinetjänst för att skapa egna websidor. Inte så dumt faktiskt... MEN... Inte så färdigt och integrerat med andra googleprodukter som man kunde hoppats.&lt;br /&gt;&lt;br /&gt;Google sites är enkelt att använda och man kommer snabbt in i hur man lägger till s.k. gadgets i sidan. Det är precis samma gadgets som används på iGoogle. Så långt allt bra. Vad jag skulle vilja se mer av är bättre integration av Google Groups, Blogger och liknande produkter. Det skulle ge en bättre möjlighet att skapa riktiga &quot;portaler&quot; för sina egna projekt och liknande.&lt;br /&gt;&lt;br /&gt;När man granskar videos kring Sites verkar det helt klart vara möjligt att skapa den sortens innehåll, och det kan ju vara jag som missat nåt, men då kan man väl konstatera att det är för svårt att göra innehållet riktigt bra.</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/8086613370812454884/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2009/07/google-sites.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/8086613370812454884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/8086613370812454884'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2009/07/google-sites.html' title='Google Sites'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7610580425212672356.post-7105841648993038839</id><published>2009-07-06T05:46:00.000-07:00</published><updated>2009-07-06T05:56:15.654-07:00</updated><title type='text'>RSS</title><content type='html'>Igentligen är det här inget annat än ett försök att upptäcka nya tekniker. Det kommer ju mycket nu kan man säga. I mitt yrke som utvecklare inom &quot;embedded systems&quot; blir man lätt lite insnöad på elektroniken, och då är det lätt att hetare tekniker drar ifrån.&lt;br /&gt;&lt;br /&gt;Det hela började med att jag experimenterade en del med RSS-feeds. Feeds är ju som sagt inte något nytt, men jag har inte riktigt intresserat mig för deras existens mer än att jag lagt till en eller annan i min browser för att följa nyheter där. Det är väl gott och väl. Men så provade jag att lägga till feeds i outlook, och se vilken skillnad det blev!!!&lt;br /&gt;&lt;br /&gt;Helt seriöst... jag trodde nog inte att rss-läsarens utformning skulle ha så stor inverkan på informationsflödet. Effektivitetsskillnaden i att kunna se vilka feeds man läst och inte är enorm. Jag tänkte genast att det här kanske är en bra metod att använda i utvecklingsgruppen på jobbet, så jag slängde upp en RSS-kanal på samma webserver som vi har vår wiki och länkar nu alla feeds till sidor på wikin. Det funkar huur bra som helst!&lt;br /&gt;&lt;br /&gt;Nu slipper medlemmarna i min grupp aktivt gå in och kolla om det finns uppdateringar de borde ta del av på wikin, det kommer de se i outlook! Tyvärr saknar jag något bra linuxbaserat verktyg för att publicera rss-kanalen. Gör det manuellt än så länge.</content><link rel='replies' type='application/atom+xml' href='http://nyatekniken.blogspot.com/feeds/7105841648993038839/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://nyatekniken.blogspot.com/2009/07/rss.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/7105841648993038839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7610580425212672356/posts/default/7105841648993038839'/><link rel='alternate' type='text/html' href='http://nyatekniken.blogspot.com/2009/07/rss.html' title='RSS'/><author><name>Peter</name><uri>http://www.blogger.com/profile/06377336479146418764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>