views:

559

answers:

12

Well, initial reason I ask this question is I need from time to time learning materials for struggling C / C++ developer who is in general competent but needs to improve some aspect directly related to embedded system software development (telecom mainly). And I found I have not so many useful things to recommend.

Could community help with good references (I think this is more related to junior / middle level but I suppose good materials for mature engineers are even more valuable)?

Obvious areas to cover are:

  • Software development in limited resources conditions.
  • Low level programming strategies.
  • Software development before hardware is available.
  • Special debugging tricks.
  • Architecture dependent techniques.
  • Distributed programming.

Thank you in advance, let us help ourselves ;-).

+7  A: 

I recommend subscribing to Jack Ganssle's The Embedded Muse email newsletter and skimming the back issues.

Daryl Spitzer
awesome resources there :o +1
Samuel_xL
+6  A: 

Embedded.com

Control.com

EmbeddedGurus

Doug Currie
+3  A: 

Probably the easiest way to get into this is to do it. Get a microcontroller, read some tutorials, and get underway.

Do realize that I've found that most of the developers into embedded programming are doing it in C, not C++. From this discussion, I've learned that some of them just don't see learning/using C++ as bringing benefit to their craft. If it's not broken, don't fix it is their motto.

Since your doing stuff with telecom, I bet its mostly C, due to the age of most of the equipment and the fact that most of the skilled programmers in telecom come from the age of C. Is there a better way to do it? I suppose, but that's how they did it, and they likely had good reasons for it. Don't try to port it to C++, that's a horrible idea. C is pretty powerful in its own right. Make sure you have K&R.

Good programming techniques, especially for your discipline, are often discovered/observed through reading other's code, so I strongly suggest doing that. Telecom has interesting challenges (complex data protocols, redundancy, networks interfaces). Maybe reading some code for some drivers in C would help, or maybe some high-performance open source apps. There are lots of good resources, but if your'e looking for "the best way" you'll have to find it through so-called best practices books or through community critique on the internet.

sheepsimulator
+1, get cheap avr microcontroller, play around with it.just reading about things is very different from actually trying to implement it.
aaa
The age of C isn't over. The age of the C++ is not at hand.
Matt Joiner
@Matt Joiner - Didn't mean to imply it was; simply that IME most of the skilled programmers in telecom learned C before C++ existed.
sheepsimulator
@sheepstimulator: Nevermind, LOTR reference ;)
Matt Joiner
I can't agree C is the only way for telecom. Modern telecom equipment (especially starting from provider edge) is complex enough and resourceful so C++ features are really critical to speedup upper layers development. Yes, lower layer is plain C and there is nothing to invent. But C code could be really different depending on developer experience.The reason I asked about 'list of useful materials' is current situation with lot of talented young developers (especially C++) that have not faced yet telecom development. They need to teach faster than it can be done just looking on others code.
Roman Nikitchenko
+4  A: 

This book is pretty decent:

http://www.amazon.com/Embedded-Software-Primer-David-Simon/dp/020161569X

Paul Nathan
+2  A: 

This isn't exactly what you're looking for, but: Code review. Have them review your designs and code. Review their designs and code. They will help you find your errors. They will learn from your work. You will get a chance to suggest improvements to designs/code before they turn into a mess.

As far as online resources, I'll second the previous mention of The Embedded Muse.

Really though, I picked up most of what I know from guys I've worked with, reading lots of code, and getting things wrong enough times that now I know better...

bstpierre
Others people code quality is variable and this is relatively slow way. I don't like for example my team to do thing several times wrong and then right. Nobody pays for this ;-).Large amount of developers are entering now embedded area and yes, they have previous experience but, for example, they have not yet wrote flash device driver or new logics for in-service upgrade subsystem. So they don't ever faced some conditions and don't know about ways to handle them. I'd like to collect materials set everyone can use to improve skills at lease in areas original question listed.
Roman Nikitchenko
+5  A: 

If you are working on embedded linux, the following are handy:

Linux Kernel Development by Robert Love

Essential Linux Device Drivers by Sreekrishnan Venkateswaran

hopia
Especially +1 for Robert Love, I suggest this is one of the best books for embedded Linux developers published today.
Roman Nikitchenko
+5  A: 

I would love to write a book or books on the subject, too bad I have not yet...

I vote for the just do it approach. the arduino, armmite pro, olimex, etc boards can be had for less than 50 dollars. qemu and one I wrote thumbulator, can be had for free, these are instruction/system simulators, as are MANY other instruction set simulators out there as well. The compilers are free, and gobs of websites including stack overflow with gobs of how to get started information.

Things like debugging tricks have a lot to do with the type of code you write, what style what level (true embedded, embedded linux, device driver, application, scripty python like high high level, etc). it is not possible to explain everything you might encounter and then explain the debug tricks used for each of those situations. Listening to people tell "war stories" about their adventures are as good as any method for learning different ways to think about the problem as well as how to tell your own war stories to share with others.

My best piece of advice, which many disagree with, is what I call "drive down the middle of the road". Avoid fun compiler or language gee whiz features. Write code that is extremely portable, even if you know it can never be ported. Do this as a habit and your code will stand a better chance at being compiled correctly even with marginal compilers (if you go into the embedded world you are going to have to deal with marginal compilers, of course gcc is marginal and it is out there in the open). Or think of it this way, the number one rule for a clean house or work environment is "dont make the mess in the first place". For example when cooking you hopefully dont carry the saucepan and a bowl into the living room and pour the contents into the bowl while standing on the carpet, nor do it over the stove or a counter, if you do it over the sink you make fewer messes to have to clean up, dont make the mess in the first place. Same goes with programming, dont fiddle with or near the trap door, sometimes you will fall in. Avoid bitfields at all costs for example, and never use structs across compile domains. The biggest debugging trick is to not make avoidable bugs, lets put it that way.

The second most useful advice I can give is start compiling stuff for different architectures (llvm is easier to use than gcc, but both can do it), and disassemble that output, you dont have to write complete programs, single functions will do. This is where you learn your resource limited programming, architectural differences, etc. Depending on how low level you need to go in this venture, you may have to debug at the instruction by instruction level. You may think you know what you told the compiler to do but it did something else that you wont find until you look at the code in this way. You may be shocked to find resource consumption for globals vs locals and compare that to what you were taught about globals and locals. Here again drive down the middle of the road, if your programs use add and and and or and xor operations, if equal, if less than, etc, avoid division at all costs, and limit the use of multiplication, every processor does those things (add, and, or, xor, subtract, ones complement inversion, bit shifts) and your program will be architecturally independent, automatically. No book is going to explain this you have to touch it and feel it yourself by taking the same lines of C code and compiling them in different ways for different target architecures and inspecting the disassembly.

Third bit of advice, avoid using debuggers, single step, breakpoints, that kind of debugger, at all costs. Hide more bugs than they find and do not improve the overall product.

An author by the name of Michael Abrash probably had the best influence on me for how to think in the ways you are looking to think. Starting with a book called the zen of assembly language, which I have in print but was hard to get even then, was re-printed as an appendix to the the big black book of graphics programming. I think you can find a lot of his work online for free. Zen of assembly for example works through the 8088 and 8086 which are now antiques and the specific problems being solved are no longer problems, but it is the thought process that is more important not the solutions to specific problems.

dwelch
+3  A: 

You only learn when it's fun : go buy you a nintendo ds and a "linker" and then start programming homebrew software/games in C with devkitpro (a gcc configured for nintendo ds development) and libnds library (included in devkitpro).

Nintendo DS has lots of fun things (2 CPUS : an arm7 and an arm9, a touch screen, 2 screens, timers, etc.) Some even has ported linux to Nintendo DS.

And you also have a wifi component allowing you to establish adhoc connections and learn to program telecommunication software.

A nintendo ds has not a lot of resources and you should be coding near the machine or your software will be too slow.

If you think Nintendo DS is too big to be considered embedded, buy you a GBA on ebay and GBA cart for hombrew.

Jérôme Radix
Jerome, the way you propose maybe is useful for student and definitely is great for school boy but what I actually asked for is references to books or learning resources (including commercial). I need (and suppose it would be useful for many others) some set of learning materials to quickly improve embedded-oriented skills of general developer (new in this area but generally competent). Yes, in parallel with coding non-critical tasks, participating in code reviews on both sides and so on.But your approach is nice, +1 for complete set of links to start this way ;-).
Roman Nikitchenko
+5  A: 
ZXX
+2  A: 

For C++ I can recommend reading (!) the parashifts C++ FAQ lite if you have at least mediocre knowledge.

If you understand German, both mikrocontroller.net and roboternetz are great sites about embedded development (they focus on assembler and C).
On a more general note, beginner programmers of embedded systems often want to skip reading the datasheet. Once they were taught Java, they think they're programming gods. Make them RTFM. :)

If you want to do distributed systems, sensor nodes specifically, you can have a look at the TinyOs docu although this would be pointless otherwise (be careful, the tos guys have some questionable programming practices).

To really make efficient stuff (for embedded systems that is still quite important), Hacker's Delight should be standing in your bookshelf. Read. Seriously!

bitmask
+4  A: 

Try these books. Maybe they'll prove to be useful to you. I have left C++ programming ever since i switched to Java, but these were the beautiful books that helped me. How to think like a Computer Scientist C++ version

Compilers and Compiler Generators: an introduction with C++

Data Structures and Algorithms with Object-Oriented Design Patterns in C++

and many such books on http://www.techbooksforfree.com/ccpp.shtml ...You can choose your book of choice. Now, the choice of books obviously depends on the reason for what you want the book..

Humming Bird
Great link. Have favorited it!
this.Liar
+4  A: 

And you must refer this question. It says a lot.

Ravi