Skip to main content

Posts

Showing posts from 2013

Online education and the disruption of the traditional education system

Online learning has started to move into the mainstream. Stamford, MIT and others have been offering online classes for years but  in the past few years the idea really stated to take off.  While it may seem obvious that the Internet might provide a great conduit to educate, it has taken dozens of years for the approach to gain traction. As online education improves there are clear signs of disruption in the traditional education system. Udacity CS344 - Introduction to parallel programming The model for online courses is a powerful one. A single set of materials can be created once and distributed at almost zero incremental cost. Some courses are self paced and fully automated. Others are supported by a teacher and staff that grade submissions, provides help on forums and may hold group chats. Some colleges/courses are experimenting with a hybrid model  that leverages the Internet to deliver the portions of the course best suited to it, such as lecture notes or pre-recorded le

Tesla's disruption in the car industry

As a follower of technology companies and products I've been watching Tesla Motors  for years. With the Model S , Tesla has produced a luxury car that has raised the bar in terms of usability, features, performance, and safety and scored a near perfect score in Consumer Reports review. Tesla appears to be putting significant pressure on luxury car brands. The Model S  outsold, in the first half of 2013, Porsche, Jaguar and Land Rover  in California and in the first quarter of 2013  some models of Audi, BMW and Lexus . At this point, demand for the Model S appears to be outpacing production capacity. The current delivery wait on the Model S is two months or more, as indicated on the Tesla website. Today, at ~$70k USD, the Model S is in a different market segment and significantly more expensive than the the biggest selling EVs on the market. The  Toyota Plug-in-prius  (US$32,000),  Nissan Leaf  (US$29,650), and  Chevy Volt  (US$34,995 in the 2014 model year) cost less than half

Moving to c++11

c++11 has been officially released since August 2011. I'm not sure if other compilers are planning or have added c++11 support but I primarily use gcc. Even though gcc   still classifies c++11 support as experimental  their support appears nearly complete. At my day job we've been doing some prototyping and early development of a next generation platform and have started to try out c++11. So far I've been happy with the improvements in c++11 over c++98 . After a handful of months of using c++11 here are the things that have stood out. auto The ' auto ' keyword mirrors one of my favorite language features in c#, the 'var' keyword. auto  indicates that the compiler should perform type-inference. With auto I'm not going to miss having to type dozen of letters twice to declare and create a verbosely named template. Two pitfalls of auto are the lack of a specific type that might require a programmer to look at the function prototype to determine the typ

Fedora 19 (GNOME) vs. Kubuntu 13.04 (KDE)

I've been a long time Linux user after first being introduced to it in 1997 when I arrived at college. At that time Linux was pretty primitive. Users usually had to setup their own X windows modelines  or they would be greeted with low resolution video. Some of the big distributions at the time were RedHat , SuSE, Caldera , Stampede , Slackware , and  Debian . Every couple of months I ended up messing something up and breaking the bootloader, kernel or some important libraries. I was mostly using the computer to learn and experiment with so I would re-install with a new distribution each time. I must have tried a more than a half dozen distributions over a few year period. KDE on Debian/Ubuntu Around 2004 or so I made the switch to Linux, with a virtual machine for Windows. Over the years since the switch I ended up running Debian for several years and most recently Ubuntu for four or five years now. Throughout this time I've preferred and used KDE , the K Desktop Environ

Raised bed gardening

This year we decided to build a raised bed garden and grow some of our own vegetables. It's a nice idea to be able to grow your own food. You can choose to grown things organically as we are doing, you know where the food came from, and its fresh. This is a picture of the beds after we built them and filled them with soil. You can see the rows at the end of one of the beds where we planted the first seeds for Brussels sprouts and peas. After building the beds After the garden started coming up we put up a short wire fence to keep small animals like rabbits out of the garden. Garden starting August, 2013 zucchini So far we've gotten several zucchini out of the garden, along with a few handfuls of peas. We've made a couple of batches of zucchini muffins so far. There are some tomatoes growing and turning from green to red and a few peppers. The carrots and beets are growing well. Early in the year some Japanese and Flea beetles were eating a lo

Ideas for KiCAD library crowdsourcing

As part of an on-going discussion on the KiCAD devleopers mailing list about library crowdsourcing, I wanted to put together more detail about the issue. I've been using KiCAD for a handful of months and was unaware of some of the organizations, such as CircuitHub  and KiCadCloud , that have been working to improve the situation until this discussion. Background PCB development flow A typical circuit board development process in KiCAD looks something like: Schematic (eeschema) Design a circuit Locate components (or create the component symbols ) Add components to the schematic Connect components on a schematic using the component symbol Map component to footprint (cvpcb) Choose the specific footprint for each component in the schematic (or create the necessary footprints ) Layout (pcbnew) Place components Route the signals on the board The problem During schematic step #2 and the component mapping process, the highlighted steps above, any component tha

The BeagleBone Black could use a VPU (video processing unit)

Top side of a BeagleBone Black I've been working a bit with the BeagleBone Black (BBB) , a $45USD single board computer, for the last couple of months. It's capabilities, relative to its cost, are impressive. Several sites have compared the specs of the BBB and the popular  Raspberry Pi (RPi) , another powerful and low cost single board computer. You can check out some analysis of the two  here . One important difference between the BBB and the RPi is that the BBB lacks a video processing unit (VPU) to accelerate video playback . A video processing unit helps improve video decoding and/or encoding rates by performing some or all of the specialized operations involved in video processing. Without a VPU or other specialized hardware, a system would have to perform the video processing using the system's core processor , likely a general purpose processor, and at a far slower rate.  This RPi and BBB comparison  picks up on the video decoding capabilities as a key diffe

Thoughts on Coding Standards

Having been involved in coding standards discussions at several jobs I've usually found the process to be an arbitrary exercise in codifying personal opinion. The conversation inevitably turns to pedantic things such as where to put curly braces or how to indent. I've started to think about how to try to focus teams on higher value areas of software engineering, and how to design coding standards to focus teams in these areas. This post is the product of those thoughts, written as a coding standards document. Coding standards Preface The purpose of this document is to describe some software development practices. The topics are ordered according to their relative importance to our organization. Where critical, firm rules are specified; elsewhere the standards are intentionally relaxed so you have the freedom to express your personal preference. This document is intended to be a helpful tool that improves the quality of the engineering of our organization. It is not inte

A new hobby evse

Earlier this year I purchased a Toyota Plug-in-Prius . The car comes with a slow charger module that is powered through a standard 120v 15amp outlet. This kind of outlet can deliver something around 1kw of energy. For the 4.4kw battery pack in the PiP , it takes about 3 hours to charge the pack from its empty state. Empty for the PiP isn't actually a zero charge level, the battery is kept within a 15% to 85% State-of-charge(SOC) to prolong its life. Frequently I was finding that I didn't have enough time to charge the pack before leaving on another trip. One option was the $1500 or so to purchase a 240v charger and have someone install it. A quick search on the web turned up the OpenEVSE project , a project to build a evse charger. I started to read about the evse project and got interested in building one. I did want to have some kind of network support so I could control and monitor charging, schedule it better than the car could and otherwise expand upon what the proj

An open letter to Neato Robotics

I recently purchased a Neato Robotics Neato XV Signature Pro . We went with the Neato over the iRobot Roomba because the Neato actively maps the room. I've been impressed with how well the Neato works. Originally I thought it might be marginally useful, would pick up some dust and dirt but we would have to vacuum by hand every so often. This doesn't appear to the case. Its room mapping and edge following work pretty well, it can climb up onto rugs without trouble and generally the floors (all hard floors on the first floor, except for a few rugs) are the cleanest they've ever been, and consistently so. We schedule the Neato to run almost every day, usually when we are home in case we need to pull a dog toy out of its brush or get it out from under the dining room table where it got in between all of the pushed in chairs but then couldn't find its way out. Which brings me to the topic of this post. Dear Neato Robotics, You should consider leveraging the in

Odd git SourceForge problems

A user emailed me today asking if I could push out some changes to a network packet analysis and creation library that I created and maintain, Packet.Net . These changes were included in the last release packages I pushed our a few months ago but apparently weren't in the git repository on SourceForge. This didn't make a lot of sense because I use some scripts that build binary and source release zip files by doing a git export of a specified tag from the remote repository on SourceForge. Plus I'm usually pretty careful to push everything out in case something happens to my laptop. Went to the SourceForge code browser web page where you can browse the repository from a web browser and sure enough there were tags and commits were missing, when compared to my local development repository/directory. I ran git status from my development directory and it showed up to date. Ran a push but it said the same. Even tried a force push but git didn't take any action. I suspecte

Review of "The Winds of War" and "War and Remembrance" by Herman Wouk(unabridged audio book version)

After signing up up for a trial account to Audible , we, myself and my fiancee, downloaded a few sample books, including "The Winds of War" and "War and Remembrance" by Herman Wouk . She actually picked those two books based on their high ratings. This is a review of the unabridged audio versions of these two books. "The Winds of War" and "War and Remembrance" are works of historical fiction, starting in the 1930s and ending in the 1940s. Covering the period that led up to and including WWII, the books explore a time of conflict that was to decide who would rule much of the world. I had apprehensions about historical fiction when starting this book. Some historical fiction can deviate from history or generalize events and I was concerned about learning historically inaccurate information. I consider misinformation to be almost worse than not knowing the history at all. Wouk has taken great care to be historically accurate. In his

Plug in Prius

2013 Toyota Plug-in-prius I recently upgraded from a 2001 Acura Integra to a 2013 Toyota Prius plug in. The Integra was getting older, mpg wasn't great and the dealer was offering a pretty good trade-in, a big discount on Plug-in-prius (PiP) and  0% financing. The good Mpg is excellent. Even without the plug in battery the car gets about 60 mpg if you stay in the 65-70 mph range. This basically matches the regular Prius even though the larger Li battery pack adds a hundred or more pounds. With the ev battery fully charged I get about 80 mpg on my 35 mile 40 minute trip. Oh, and the pip displays helpful trip summary after being powered off: Plug-in-prius trip summary Side decal The touch screen on the in car system works relatively well. It appears to be a resistive touch screen though. Resistive touch screens are being replaced by by surface and projected capacitance technologies. Resistive only detects single touches, requires harder touches, and takes more

FreeRTOS + newlib (gcc toolchain) on the STM32F103 (Cortex-M3)

Here are some of the steps to get FreeRTOS and newlib (gcc) to work correctly on the STM32F10x, a Cortex-M3 ARM processor. Configure the priority bits Per  the FreeRTOS page about the Cortex M3 and M4 , the priority bits should be assigned to be preempt priority by calling NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );  If you or any start up related code you are using isn't doing this you may end up with odd behavior or bus faults. Map FreeRTOS tasking functions to CMSIS vector handlers Per this post  you'll want to map the FreeRTOS handlers for vPortSVCHandler, xPortPendSVHandler and xPortSysTickHandler to the CMSIS handlers. A readelf of the elf file of my example application was showing the default interrupt handler was being used for those interrupts, which meant FreeRTOS wasn't handling the interrupts it needed to function correctly. The CMSIS default handlers are weakly bound so having other definitions with the same names will override these, causing the

Debugging an imprecise bus access fault on a Cortex-M3

This information may apply to other cortex series processors but is written from practical experience with the Cortex-M3. Imprecise bus access faults are ambiguous, as noted by the term "imprecise". Compared to precise bus errors, imprecise errors are much trickier to debug and especially so without a deep understanding of arm processors and assembly language. Imprecise and precise flags are found in the BusFault status register, a byte in the CFSR (Configurable Fault Status Register). BusFault status register bits The definition for imprecise and precise bits is: [2] IMPRECISERR Imprecise data bus error: 0 = no imprecise data bus error 1 = a data bus error has occurred, but the return address in the stack frame is not related to the instruction that caused the error. When the processor sets this bit to 1, it does not write a fault address to the BFAR. This is an asynchronous fault. Therefore, if it is detected when the priority of the current pr

Version control and outside contributors

The version control system your project uses can have a big impact on how easy it is for outside contributors to help out. Svn (and cvs) make it difficult to contribute Most projects restrict new or minor contributors to read only permission on their code repositories. This is common both for security and for organizational purposes, project maintainers often like to review changes before they go into mainline code. Read only access has its downside for contributors. If someone like myself wanted to contribute to a project that used svn the flow wold look something like: - svn checkout - Edit files in my editor - Test - svn diff > changes.patch - Email/post changes to maintainer - Wait until the changes are approved or rejected and checked in to svn - Repeat starting at 'Edit files in my editor' The bottleneck here is waiting for changes to be checked into svn. What if there were several changes in series? How would I be able to continue working on the next chang

STMicro STM32F10x CMSIS-SVD files appear to be missing lots of important registers

CMSIS-SVD is "Cortex Microcontroller Software Interface Standard" "System View Description". This is an ARM standard format for describing the registers and their bitfields for the Cortex-M series of ARM processors. If you have an account on the Arm website you can visit the STMicro cmsis page  where you can download the svd files for various STMicro processors. The STM32F10x svd files however appear to be missing important things like the system control block . This is an issue because I've been using the Eclipse plugin EmbSysRegView  to browse cpu registers during debug. The system control block is important because it contains various status registers that report fault status. These registers can help to locate issues in code or configuration. I posted a support question with ST and on their forums to see why their CMSIS-SVD doesn't appear to include all of the processors registers but I'll probably end up modifying the other EmbSysRegView proc

Cortex-M3 exceptions with ARM code

A test application using FreeRTOS and an arm cross compiler was landing in the default exception handler during the start up code in main(). Because several of the exception handlers are still using the default exception handler the debugger indicates WWDG_IRQHandler. Some googling turned up this post  but while mapping the FreeRTOS handlers with #defines did correct something I had missed it wasn't the cause of the exceptions. Single stepping through the code narrowed the issue down to a call to malloc(), in at a label called _malloc_from_thumb(). The particular instruction was "bx pc". When the 'bx pc' was executed the processor jumped directly to the watchdog isr handler. Next I ran 'objdump -d -S -l' on the elf file and started looking at the code and assembly. main() looks like: _malloc_from_thumb(): looks like: You can see that this function has a couple of 16 bit thumb instructions and then a 32 bit arm instruction. Its purpose, a

Viewing embedded register values with Eclipse

Embedded processors tend to require a registers configuration beyond the traditional CPU registers found in the x86 architecture. Power, interrupts, clocks, I/O hardware modules can have from several to dozens of different registers that contain configuration settings. Having to find the address for each register is relatively painful. Some processors make it even more difficult with a configurable base address. Once you've found the address you want you still have to figure out what the bits in the register mean and which configurations are valid. Embedded development Integrated Development Environments (IDEs) like IAR's Embedded Workbench provide helpful address to value mappings for internal registers. EmbSys RegView is a plugin for Eclipse that breaks out the processors registers and fields (although it appears to lack a mapping for the meaning of the individual fields and the valid values). Eclipse EmbSys Registers pane