Arizona Lottery's Not-So-Random Number Generator
Random numbers -- really, truly random numbers -- play a very important role in security. Unfortunately, they are also common sources of non-random behavior, as in the Arizona Lottery drawing.
How-to articles about designing safe, reliable, and secure embedded systems.
Random numbers -- really, truly random numbers -- play a very important role in security. Unfortunately, they are also common sources of non-random behavior, as in the Arizona Lottery drawing.
If you've got a lot of real-time tasks and tight deadlines, what's the best way to prioritize them? Rate Monotonic Algorithm provides the optimal technique.
In a recent DDoS attack, devices such as webcams and DVRs were used to launch an attack on domain service provider, Dyn. The enormity of this event brings to light the importance of securing all devices capable of connecting to the Internet.
Too often engineers give up trying to discover the cause of infrequent anomalies--because they can't be easily reproduced in the lab--dismissing them as "user errors" or "glitches." Yet these ghosts in the machine live on. So here's a guide to the most frequent root causes of difficult-to-reproduce firmware bugs.
Whether you're using only static memory, a simple stack, or dynamic allocation on a heap, you have to proceed cautiously. Embedded programmers can't afford to ignore the risks inherent in memory utilization.
Unexpected power loss and software bugs can undermine the reliability of non-volatile data. Fortunately, there are various ways to make non-volatile data resilient to such corruption.
Proper timing in user interfaces often has more to do with the user's perception than with the actual passage of time.
Understanding software and hardware bugs in other embedded systems can help you identify, diagnose, and fix bugs in your own.
The placement of knobs, buttons, and switches is as essential as the firmware to making a usable embedded system.
Designing firmware-accessible debugging resources into embedded systems provides a valuable supplement to hardware test and analysis tools.
These built-in troubleshooting resources for direct memory access (DMA) controllers can pave the way for smoother embedded software integration.
State machines are perhaps the most effective method for developing robust event-driven code for embedded systems.
The formalism of Hierarchical State Machines (aka statecharts) makes the state machine approach truly applicable to real-life embedded systems.
What is the Design by Contract programming philosophy, what can it do for you, and why should all embedded software developers care?
Metaphors and analogies can be valuable tools for learning new software concepts and tapping subject matter expertise during embedded software development.
A state machine is any object that behaves different based on its history and current inputs. Many embedded systems consist of a collection of state machines at various levels of the electronics or software.
Rethinking basic programming techniques can avoid many of the problems that heap-based memory management poses for embedded real-time system designs.
RedBoot is a portable, open-source ROM monitor that offers a download and debug environment. What more could you want?
Many embedded developers today use a ROM- or flash-resident software program that provides functionality such as loading and running application software, scripting, read/write access to processor registers, and memory dumps. A ROM monitor, as it is often called, can be a useful and far less expensive debugging tool than an in-circuit emulator.
The first task when using any new real-time operating system (RTOS) is to get it up and running on your hardware. The open-source eCos RTOS makes that part pretty easy.
The way you write software can affect the power consumption of the resulting product. Here are four approaches to minimizing power consumption through software.
In this first installment of a series of articles on the proper use of a real-time operating system (RTOS), we examine the important differences between a mutex and a semaphore.
A C coding standard can help keep bugs out of embedded software by leveraging common language features and development tools.
This second article on enforceable coding standards for embedded systems adds a set of additional bug-killing rules for using certain C keywords and naming global variables.
An object-oriented framework can be used to create safe, testable and tunable motion control systems.
According to a recent survey, there are "10" types of people in this world: those who understand binary and those who don't.
As you are presumably (by nature of being reading this niche blog) one of the former and also experienced in the art of embedded systems design, won't you please participate in a quick online survey regarding trends in our industry:
As Internet connectivity advances, the transportation, automotive, medical device, smart grid and other industry sectors have become more dependent on embedded software. But is software reliable?
A number of embedded systems, such as medical devices and printers, feature replaceable components designed to be installed new, consumed through one or more cycles of product use, and ultimately disposed.
According a recent study by the European Union, approximately 10% of electricity used in homes and offices is 'vampire power'. That is to say that even when many products, especially embedded systems, are turned "off" they are still consuming power! The same report puts the total amount of energy wasted in this way, within Europe alone, at dozens of Terawatt hours per year.
Finding and killing latent bugs in embedded software is a difficult business. Heroic efforts and expensive tools are often required to trace backward from an observed crash, hang, or other unplanned run-time behavior to the root cause. In the worst case scenario, the root cause damages the code or data in a subtle way such that the system still appears to work fine or mostly fine--at least for a while.
Real-time systems design and RMA go together like peanut butter and jelly. So why is it that wherever I go in the embedded community, engineers are developing real-time systems without applying RMA? This is a dangerous situation, but one that is easily remedied by ensuring every programmer knows three things about RMA. In case you are entirely unfamiliar with RMA, there's a handy primer on the technique at http://www.netrino.com/Embedded-Systems/How-To/RMA-Rate-Monoton
The results of Barr Group's 2017 Embedded Systems Safety & Security Survey are in (free PDF available at: https://barrgroup.com/Embedded-Systems/Surveys/2017-embedded-systems-sa…). More than 1,700 active, professional embedded systems designers from around the world participated.
With all the automation available today, it's easy for programmers to overlook costly overhead introduced into machine code by the compiler. Interrupt handlers are one key area worthy of a closer inspection.
Examining the structure of the ANSI and ISO usability standards is the first step to developing medical devices that protect users from accidents.
Every commercial RTOS employs a priority-based preemptive scheduler. This despite the fact that real-time systems vary in their requirements and real-time scheduling doesn't have to be so uniform. Multitasking and meeting deadlines is certainly not a one-size-fits-all problem.
With thoughtful design, user interfaces for embedded systems can avoid some user errors altogether and helpfully guide the user through the rest.
C's offsetof() macro can be a helpful addition to your bag of tricks, including for packing data structures and describing how EEPROM data are stored.
Controller Area Network (CAN) is the most widely-used automotive bus architecture. Here are some reasons why.
At peak, some automobiles contained up to three miles of cabling. To reduce the cost and weight of wiring and still allow ECUs to become more intelligent, new methods had to be found to reduce the amount of wiring. The CAN bus has since found application in other industries as well.
Most real-time operating systems employ preemptive schedulers. This primer on preemption also looks at the kind of multitasking it enables
Motorola's Background Debug Mode is one of a variety of on-chip debug technologies. Collectively, they offer some of the best features of debug monitors and in-circuit emulators—with far less headache and cost.
Should you integrate a GUI into an embedded system by adding a dedicated processor or upgrading the existing one? Here are some options and trade-offs.
In the market for a real-time operating system (RTOS)? This article provides an overview of RTOSes and how you can select the best one for your project.
Finite impulse response (FIR) filters are the most popular type of filters implemented in software. This introduction will help you understand them both on a theoretical and a practical level.
The limitations of an 8-bit microcontroller (MCU) can sometimes make conventional C constructs produce suboptimal code. In this article we look at common problems on the 8051 family and discuss workarounds in C.
Counter units (aka, timer units) are crucial components of most embedded systems and included in many microcontrollers. Here's a primer on the hardware.
Most control systems utilize feedback in some manner. Here's a look at several fundamental feedback mechanisms, culminating in a description of a basic PID controller.
In 1998, the UK's Motor Industry Software Reliability Association established a set of 127 guidelines for the use of C in safety-critical systems. Here's a look at the rules, what they mean, and how they can work for you.
Sun's K Virtual Machine gives embedded developers a virtual kick in the pants. KVM makes it possible to, for the first time, run Java programs on any 16-bit processor with 128KB of available memory.
Language specifications, including those for C and C++, are often loosely written. A static analysis tool called lint can help you find dangerous and non-portable constructs in your code before your compiler turns them into run-time bugs.
When tasks share resources, as they often do/must, strange things can and will happen. Priority inversions can be particularly difficult to anticipate. A basic understanding of the problem is key.
Memory leaks can be particularly risky for long-running embedded systems. Here are some tools to identify, track, and analyze memory leaks in embedded C and C++ programs.
For those embedded systems that can't be constantly watched by a human, watchdog timers may be the solution.
Most embedded systems need to be self-reliant. It's not usually possible to wait for someone to reboot them if the software hangs. Some embedded designs, such as space probes, are simply not accessible to human operators. If their software ever hangs, such systems are permanently disabled. In other cases, the speed with which a human operator might reset the system would be too slow to meet the uptime requirements of the product.
Pulse width modulation (PWM) is a powerful technique for controlling analog circuits with a processor's digital outputs. PWM is employed in a wide variety of applications, ranging from measurement and communications to power control and conversion.
The proper use of C's volatile keyword is poorly understood by many programmers. This article will teach you the proper way to do it.
The format of non-volatile data may change with a new version of software. Carefully planning data layouts and using data version numbers can make these upgrades easier.
SRAM or DRAM? EEPROM or flash? What types of memory will you use in your next embedded systems design?
Embedded systems programmers often value the assert() macro. This article explores the underlying definition of this handy macro, to show you how to roll your own.
The assert() macro is one of those simple tools that would not seem to merit an entire article, but I have come across an alarming number of engineers who have not heard of it or do not use it.
When it comes to safety-critical applications, sometimes you have to protect users from the software. And sometimes you have to protect users from themselves.
Products destined for use in multiple countries often require user interfaces that support several human languages. Sloppy string management in your programs could result in unintelligible babble.
To keep a watchdog timer from resetting your system, you've got to kick it regularly. But that's not all there is to watchdog science. We will examine the use and testing of a watchdog, as well as the integration of a watchdog into a multitasking environment.
Network processors are programmable chips like general purpose microprocessors, but are optimized for the packet processing required in network devices. But what are they good for and how do they work?
If ever there was a piece of embedded software ripe for reuse it's the memory test. This article shows how to test for the most common memory problems with a set of three efficient, portable, public-domain memory test functions.
The address resolution protocol provides a necessary bridge between physical and logical addresses on a TCP/IP network.
Every system on a TCP/IP network has two addresses, one physical and one logical. The address resolution protocol (ARP) provides a necessary bridge between these two addresses.
Merely adding a protocol stack and networking API to your software doesn't make you TCP/IP ready. You'll also need to assign your product a MAC address.
Any book on TCP/IP will tell you that each network-connected device has a globally unique hardware address. But where, exactly, do these addresses come from? And why is it that the authors of books on TCP/IP never bother to answer this or any other practical implementation question?
Embedded software developers operate in a perfect digital environment but must interact with the imperfect analog real world. To do this it's essential to know how to perform calibration of inputs and sensors.
If your embedded system is on a network, the key question is not will you include TCP/IP but which subset of the Internet Protocol suite will be supported in your product.
Given a particular programming problem, what language should you use to realize the solution? Your choice could very well affect the success or failure of the project. So you'd better choose wisely.
CRCs are among the best checksums available to detect and/or correct errors in communications transmissions. This article shows how to implement an efficient CRC in C or C++.
Many common types of data transmission errors cannot be detected by additive checksums. This article describes a stronger type of checksum known as a CRC.
What if data is lost or corrupted in transit? Communication protocols usually attempt to detect such errors automatically. To do that they use checksums.
New standards are making the delivery of Web-based and enhanced content alongside television a reality. This article describes the ATVEF enhanced television standard and the requirements for designing ATVEF-compatible receivers.
As engineers design more and more products with embedded computer systems that require connections of one sort or another, short-range wireless protocols offer an attractive alternative to wired connections.
Bug fixes, patches, and third-party application programs are all possible in today’s more powerful embedded systems, but you need to plan for them at design time. This article shows you how.
One of the least used but potentially most useful features of the C preprocessor is the ANSI-specified #error directive. Here's a look at a couple of clever uses for #error that have proven invaluable in embedded software development.
Quite a few embedded systems include multiple processors. Sometimes these processors stand in isolation, but more often they're required to communicate over a multidrop bus such as EIA RS-485 or RS-422.
In recent years, the line between hardware and software has blurred. Hardware now engineers create the bulk of their new digital circuitry in programming languages such as VHDL and Verilog. This article will help you make sense of programmable logic.
Let's face it, there's nothing sexy about the topic of cross compilers. Embedded programmers couldn't get the job done without one, but spend very little time thinking about how they work or how they could make our work easier.
The 8051, 68HC11, and Microchip PIC are popular microcontrollers, but they aren't necessarily easy to program. This article shows how the use of ANSI C and compiler-specific constructs can help generate tighter code.
Java compilers (also known as ahead-of-time or AOT compilers) may be the breakthrough needed to propagate widespread use of Java throughout the embedded industry.
Designers of embedded systems face three significant challenges in today's ultra-competitive marketplace. Products must always: do more, cost less, and arrive to market faster. Fortunately, new flexible hardware design techniques are emerging from the study of reconfigurable computing.
The information that a user gets from a life-critical system may spell the difference between a slight mishap and a serious accident. This article addresses the issue of safety in the design of a user interface.
Quite a few embedded programmers are considering adopting the Java programming language. But it's not as easy to run Java programs in an embedded environment as you might think.
Should you consider using Java as an embedded programming language? This article describes when and where Java works for embedded development.
Understanding software and hardware bugs in other embedded systems can help you identify, diagnose, and fix bugs in your own.
The placement of knobs, buttons, and switches is as essential as the firmware to making a usable embedded system.
Designing firmware-accessible debugging resources into embedded systems provides a valuable supplement to hardware test and analysis tools.
These built-in troubleshooting resources for direct memory access (DMA) controllers can pave the way for smoother embedded software integration.
State machines are perhaps the most effective method for developing robust event-driven code for embedded systems.
The formalism of Hierarchical State Machines (aka statecharts) makes the state machine approach truly applicable to real-life embedded systems.
What is the Design by Contract programming philosophy, what can it do for you, and why should all embedded software developers care?
Metaphors and analogies can be valuable tools for learning new software concepts and tapping subject matter expertise during embedded software development.
A state machine is any object that behaves different based on its history and current inputs. Many embedded systems consist of a collection of state machines at various levels of the electronics or software.
SAE J1939 is the standard communications network for sharing control and diagnostic information between electronic control units (ECUs) which reside on heavy duty and commercial vehicles. Examples of such vehicles are school busses, cement mixers, military vehicles, and semi-tractors.