Zibb

Robert CravottaTechnical Editor Robert Cravotta explores processor and software-processing architectures and the impact they have on system and software development. Relevant architectures include microprocessors, microcontrollers, digital signal processors (DSPs), multiprocessor architectures, processor fabrics, coprocessors, and accelerators, plus embedded cores in FPGAs, SOCs, and ASICs.



   Advertisement

Profile

RSS Feed

  • Add this blog to your RSS newsreader!

Recent Posts

Recent Comments

Most Commented On

Archives

By Category

Processor-based Design Articles

Blog

Monday, June 30, 2008

Is embedded different? The experience of a designer transitioning to embedded design

Jun 30 2008 11:59AM | Permalink |Comments (10) |


In a previous post I proposed that the differences between developing for embedded versus application-level systems are poorly distinguished and that, as an industry, we are paying an increasingly visible price for this lack of clarity. I personally came to understand some of the differences between the two types of development when I transitioned into the embedded world many years ago.

I did not think much of those differences as a public discussion until someone asked me why more embedded developers are not attending multicore conferences. That question made me realize that there are at least two very different perspectives on what multicore or multiprocessor means, and the typical embedded care-abouts are not the same as what I have seen as the major focus of contemporary muticore conferences (topic for the future).

I was moved closer to pointing out that there are different needs when I found independent observations noted that even after decades of opportunity, college curriculums still are not adequately preparing graduates for the embedded-design community. The tipping point for me though, was that across several years of embedded-designer surveys, "better debugging tools" is still the No. 1 concern among those surveyed, and no one seems to understand why. I smell a disconnect.

I will share my experience of transitioning into the embedded world as a starting point to making the needs of the embedded-software developer more visible. One of my goals is to get you to think back on how you entered the embedded-design world and what transition you had to go through. I am working on a feature article for Sept. 4 that I hope will be able to point out what is going well and what needs work for system-debugging tools to meet the needs of embedded designers. I ask that you post here or email me with any insights you can share. This is an opportunity to take those survey results and add another layer of information to help the toolmakers help you.

Making the transition to embedded design required profound changes in how I viewed software and hardware. Prior to making the transition, I had 10 years of experience developing software for many types of platforms—from time-share mainframes down to 8-bit computers. I developed assemblers, compilers, operating systems, interpreters, database engines, automation tools, and even computer games. In hindsight, a common description for all of this software is that it is all application-level or end-product software—software that the user is aware of and works with in some direct or indirect interface.

One of the first things I had to internalize when transitioning to embedded design was that my software was invisible in the end system. The end user had no idea it was there—nor did they ever need to. I believe this an essential component of what makes something an embedded system. This had a significant impact on how I defined my worth and my ability to tell people what I did for a living. I laughingly adopted the philosophy of "You know you're an embedded designer when you have to oversimplify your job description for 'normal' people". I found myself just telling people I worked on the Space Shuttle or aircraft because it was too frustrating to try to explain the invisible portion of the system that I actually worked on in those types of systems.

Working on the invisible portion of the system has a profound consequence on design constraints because it is difficult to extract a premium from an end customer for something they cannot directly see, but that is required for the product to do what it does. I believe this is a fundamental reason why embedded systems are built as cheaply as possible. Cheap and small implementations do not make it embedded—rather, the fact that you cannot extract extra revenue out of it drives the need to do it cheaply.

Another immediate difference was that I had to learn about real-world errors. In the nonembedded world, errors were pretty straightforward—you wrote code that queried an API or a register for a logical or discrete indication of the success of an operation. For many embedded designs, I had to learn about uncertainty, ambiguity, hysteresis, nonlinearity, and how to apply many types of filtering to address these design challenges. In closed-loop control systems, correct and incorrect operation is not always easy or obvious to discern.

As an example, I spent the better part of a year in the desert doing prototype research for autonomous vehicles. When we ran a test, it often took an additional week or more of intensive data analysis in the lab to determine if the vehicle behaved correctly for the proper reasons. It was not sufficient just to observe the overall system behavior because in the production version, there would be no human intervention available to help the system resolve ambiguities and uncertainties. The tool of choice for that data analysis was a spreadsheet program coupled with homegrown system-level software simulators.

I believe this experience begins to speak to a possible reason why embedded designers keep asking for better debugging tools. While a better and faster software simulator of the target processor is a nice thing to have, it is wholly insufficient to capture and visualize the complex relationships in a system where outputs affect inputs, such as in closed-loop control systems. Because we had no such tools, other than the ones we built for ourselves, we tested with iterative approximations using open-loop data, and if we were lucky enough to have the budget and time, we got to build hardware-in-the-loop simulations. I expect that this situation is still prevalent today.

I suspect "better debugging tools" means not only better visibility into the processor resources, but better visibility and visualization of the entire system, especially real-world interfaces that experience all sorts of physical anomalies such as drift, hysteresis, stuck values, and nonlinear responses. This leads me to perhaps the most profound shift of my transition into embedded design.

When I first started doing embedded design work, we invariably ran into design issues. Even though the software I was responsible for (usually) did exactly what the specification called for it to do, almost every single design problem was labeled as a software bug. At first this irked me to no end because the source of most of the problems was most definitely hardware in nature. By the end of my transition, I became a full convert to the following philosophy: If the software can detect, compensate, avoid, or correct an anomalous condition in the system, it is, by definition, a software problem—regardless of the root cause. In the long run, for most classes of problems, it is much cheaper to fix it in the software than in the hardware.

This approach makes the task of debugging software messy because it requires cross-discipline skill in the designer or cross-discipline cooperation between the hardware and software developers that is usually not necessary for end-system-level, or application-level software development. Before I entered the embedded-design world, I had never used an in-circuit emulator, a logic probe, or an oscilloscope. These became valuable tools for embedded design, but alas, they were standalone from the software-debugging tools. So in addition to having a cross-discipline problem, debugging embedded designs includes coordinating a mish-mash of tools that do not integrate with each other very well.

I hope that sharing my experiences triggers some thoughts for you that you can share here or in an email to me. The further I follow this line of reasoning, the more convinced I am that we are not directly addressing the needs of embedded developers, but rather, we are indirectly addressing them by directly addressing the needs of application developers. Unfortunately, embedded development includes a whole layer of additional cross-discipline issues that go beyond pure software debugging. Help me to help you by sharing your pet peeves about what is missing (and working) in today's embedded tools. I suspect some patterns will become evident if enough people respond.

As mentioned, I am working on a September article on embedded debugging that I hope can shed light on your issues. I am also planning a hands-on project for a 2009 article that will tackle the challenges in porting software to different processor architectures. I suspect both of these articles will be opportunities to give your observations more weight.


Reader Comments



at 7/1/2008 4:44:31 AM, Michael said:
Think about what is available to embedded engineers as debugging tools. At the high end we have big packages like eclipse+friends. I've used eclipse. But with its dozens of docked panes and mind-numbing interface, its amazing anyone can get work done with it. In the middle of the spectrum is debug logging and the venerable printf statement. Despite debug logging being ancient and lo-tech, it is what I (and I suspect most engineers) really use for debugging. Finally, at the bottom is the always handy oscilloscope. With it, You get very limited visibility, but it requires no additional software or hardware.

What we need is a MUCH easier to use eclipse, without thousands of options and flags, and just works.



at 7/1/2008 4:45:54 AM, Michael said:
Let me also add... a major part of the problem is that most engineering managers are not willing to shell out the money on decent software tools. If there was a sizable market for quality debugging tools, this problem would have been solved.



at 7/1/2008 2:09:52 PM, Gerald J. said:
I have seen this interplay between the software and hardware folks first hand and some software oriented people don''t seem to realize that while is is possible to design and build custom valves, actuators and other mechanical parts, it is a whole lot cheaper to do linearization, acceleration curves and oh so many other things in software than in hardware.

Write the software to use an off the shelf standard valve once and the money is spent once. Design and have a custom valve built for a low volume product and you pay for that 100 to 1000X more expensive valve every time you build one of the suckers.



at 7/1/2008 2:23:43 PM, Policebox said:
I never spent much time in the applications arena, so I suppose I have a unique perspective. I have always thought it was a crazy shoehorning to be putting Windows of any type into an Embedded system, but you hear about it all the time. I suppose it makes sense if most of the Embedded programmers are Application programmers that are being pushed into the Embedded arena. Having said that, I have always felt that the reason there aren't good tools for debugging Embedded systems is because the system is so variable. It is almost impossible to capture the complexity of an arbitrary system in a package software. Furthermore, it is almost impossible to reason your way through a failed sequence in real time. This brings us into the realm of simulation pretty quickly. I started out working with systems in which we wrote not only the embedded program, but a software simulation of the hardware for the program to run inside. We could then simulate failures by coding them into the simulation software and tracing the embedded program's reaction. Clumsy, maybe, but very effective. If we ran into a problem in test, we simply wrote a piece of code that ran the simulator through the same sequence. If there was a tool out there that made that process easy, you might have something.



at 7/2/2008 12:12:28 PM, Keith said:
Going from working on mini-computers to 8-bit microcontrollers many years ago was really an eye-opening experience. It was an extremely high volume keyboard. We had to save space so that the OTP was under 6K bytes. Compare that to the space and CPU hog that you see in the Windows space.

I agree with tools. Small thinking managers will put their mark on a project by not allowing adequate code development tools. It only bites them in the end. Then you wave goodbye as they get the boot so they can screw up another place.

A lot of time the hardware is fixed in place and I have to tweak the software to make things work. ISP helps to make those last minute changes that are found out during Beta testing. So, if I can fix hardware "features" in the hardware, I will. If it is fixed, then I try and make it work in the software. Just the way life is...

I have not been able to justify a purchased RTOS with the stuff I do yet. I am still keeping it all under 32K Bytes. I have "rolled my own" quite a few times. Eventually, I am sure that I will get something that will make me go back to a commercial RTOS.



at 7/5/2008 9:33:26 PM, Prabhu said:
I believe the major difference between embedded SW and the rest is that in embedded software your environment is not always the same. It keeps changing. So it becomes hard to learn what kind of tools the new environment/platform provides. A few standardized, simple and easy to use tools for all environments is the need of the hour. Till now I rely on understanding of the product and few improvised tools to debug/solve problems. There are also times when I learn to use a particular tool supported on a platform to solve a specific problem, I could learn to use all the tools in the begining of the project but I dont know which one will be really helpfull when I start.



at 7/7/2008 11:37:26 AM, David said:
I've been transitioning myself.
Just learned PIC programming
last month.

You need much better problem
solving skills to debug
hardware & software than
just software. To be able
to reason through a schematic,
probe a test point, and write
code to test things. And as
you say, to understand the
whole system.

Embedded programmer's motto:
Trust Nothing, Verify Everything.





at 7/10/2008 11:02:26 AM, Fred R said:
There are two very worthwhile points in this thread:
1) Robert wrote, "...my software was invisible in the end system."
2) David replied, "Trust Nothing, Verify Everything."
Imagine the time and money that would be saved on bugs and crashes if ''''applications developers'''' had these attitudes.
I migrated into embedded control via the electronic aspect of hardware equipment development. There are a few points I''''d like to add from my perspective:
1) Failsafe operation, which cannot be guaranteed within firmware, is often critical - a situation that demands a S/W developer MUST be conversant with the hardware.
2) A S/W developer must also be intimately conversant with how the product is used and structure the user interface appropriately. Some programmers still forget that the user is not a programmer. The term "User Friendly" is still valid.
3) Vendors should always provide solid, compileable, error free S/W templates as stating points for their target platforms. Later debugging will be a lot smoother.



at 7/10/2008 1:53:46 PM, Neil said:
As an embedded designer, I think most embedded designers short change what they need to do and the tools they need to build into a product.
As an example, the University driven tinyos.net (which is following the Unix route of collabrative design) is a multi-target-process/vendor effort to understand how to teach embedded designs. While absolutely amazing in its scope, its also ended up focusing on the high profile "application domain" - with simulators and a range of companies supported hardware - which of course can be nicely explained. All absolutely excellent theory - but no understanding that network stability requires design support at the very lowest elements of modules from the beginning.
The embedded designer typically has to build in tools to be able to debug the system should it go wrong. A few guidelines I use are - 1) always design state based subsystems 2) provide access to dumping those states and inputs to subsystems (usually a dedicated serial channel)



at 7/10/2008 7:50:19 PM, Gerry said:
I am in the fortunate position of doing both the hardware and software desig for the systems we manufacture. Even so, the very first thing that I do when starting the software on a new project is bring up the dev environment for what ever processor is being used and implement the trusty 'printf'.
I also always try to choose a processor that has at least one more serial port thant the system requires. This becomes a dedicated debug port.
Another thing I do is to write a lot of low level code to exercise the hardware very early on the dev cycle. I find that this helps during the development of the embedded app because I already (by then) have a good understanding of the basic HW & SW interactions.
I also consider the CRO to an essential debug aid, preferably a good high bandwidth storage CRO for capturing those little glitches or metastable events.
The paradigm of "Trust Nothing, Verify Everything" is another essential tool in the embedded developers arsenal.



Post a comment



Display Name

Change Image
Before submitting this form, please type the characters displayed above.
Note the letters are NOT case sensitive.


ADVERTISEMENT

©1997-2009 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other Reed Business sites