Welcome to the February 2019 edition of the Embedded Artistry Newsletter! This is a monthly newsletter of curated and original content to help you build superior embedded systems. This newsletter supplements the website and covers topics not mentioned there.
This month we'll cover:
- The new Bluetooth 5.1 specification
- Phil Koopman's peer code review best practices
- Embedded news from around the web (there was a lot of activity this month!)
- Embedded job postings
- Updates to the Embedded Artistry Website
Bluetooth 5.1 Released
The Bluetooth SIG released Bluetooth version 5.1 in January. The Bluetooth 5.1 release adds new features and capabilities to Bluetooth Low Energy (BLE).
Direction finding is the primary feature of the Bluetooth 5.1 release. The new direction finding capabilities include both Angle of Arrival (AoA) and Angle of Departure (AoD) measurements. Location services, such as asset tracking, item location, proximity marketing, and indoor way-finding, will use the new BLE direction finding capabilities. For products to take advantage of the new direction finding features, multiple antennas are required: 2+ on receivers for AoA method, and 2+ on transmitters for AoD method. BLE stacks will need controller-level updates to support the new features.
- GATT Caching enhancements to reduce connection times in unbonded devices
- Randomized advertising channel indexing to improve packet collision avoidance
- Periodic advertising synchronization transfer
- HCI support for Debug Keys in LE secure connections
- Sleep clock accuracy update mechanism
- ADI field in scan response data
- Interaction between QoS and Flow Specification
- Host Channel Classification for Secondary Advertising
- Allow the SID to Appear in Scan Response Reports
- Specify the behavior when rules are violated
For more on Bluetooth 5.1:
- Bluetooth 5.1 specification
- Bluetooth 5.1 Feature Overview
- Bluetooth 5.1 Puts Bluetooth in its Place
Phil Koopman on Peer Code Reviews
Peer code review is a code quality practice that we encourage all teams to adopt. This month, we listened to Phil Koopman's lecture series on Peer Code Review. This lecture series is full of actionable information which can help teams looking to adopt a formal peer code review practice. The series also serves as a source of new ideas for teams already performing reviews.
One area we want to highlight is Phil's rules for successful peer reviews:
- Review everything that your team writes down:
- High-level design
- Detailed design
- Test plans
- Inspect the item, not the author
- Don't get defensive - nobody writes perfect code
- If you are getting defensive as the author, leave the room
- Find problems; don't fix them in the meeting
- Identify the symptom or technical deficiency of the problem as specifically as possible
- The word "should" is not appropriate in a peer review
- No debates on style
- Enforce conformance to style guide
- Do not debate whether the style guide is correct
Phil expands upon these rules with his peer code review best practices:
- Formal reviews (Fagan inspections) optimize bugs found per dollar
- Formal reviews find more bugs than informal reviews, and they find them more efficiently
- Informal reviews typically find < 10-50% of defects
- Online-review tools are OK, but they are not substitute for formal in-person review meetings
- Target 10% of total project effort to find 50% of bugs
- Also review documentation and designs - not just code
- Review documentation and design first to find issues before coding begins
- Use a checklist to find the most bugs
- Target 1 peer review per day so you don't burn out reviewers
- Schedule peer reviews regularly
- 2-3 reviews per week as the project progresses
- Limit meetings to 1-2 hours
- After 2 hours, review effectiveness drops off
- Target 150 lines of non-comment source code per hour for review
- Keep a queue of items pending review; pull off queue for a scheduled review
- Run static analysis tools before review meetings
- Static analysis tools do not eliminate the need for peer code review
Phil states that formal peer code reviews should capture > 50% of defects. If your team is not finding sufficient bugs during code reviews, listen to the lecture series and try applying a formalized review process. All of us can improve the quality of our peer code review by applying these straightforward rules and best practices in our organizations.
Here are additional publications on peer code reviews by Phil Koopman:
- Peer Review Lecture Slides
- Peer Reviews and the 50/50 Rule
- Embedded System Code Review Checklist (pdf)
- Another Peer Review Checklist (pdf)
Here are Embedded Artistry publications discussing peer code reviews:
- Best Practices for Peer Code Review
- March 2018 Newsletter
- Improving Our Software With 5 Lightweight Processes You Can Adopt This Month
Around the Web
There was a lot of activity in January, so we've grouped our reading recommendations by category:
Researchers in Japan studied how tree frogs regulate their communications to avoid croaking over each other frog in the colony. Their findings have implications for a future network packet collision prevention scheme.
Low-powered IoT devices with limited memory capabilities will have to eventually support IPv6. 6LoWPAN will make that happen.
Japan plans to hack 200 milion IoT devices in February to compile a list of vulnerable devices. This effort further highlights the fact that IoT devices, not people, are now the security weak link.
The Multicore Association has released a new version of the Software-Hardware Interface for Multi-Many Core (SHIM). Version 2 of the specification introduces new features around power consumption properties, inter-connect contention descriptions, custom instructions, vendor extensions, and more.
EDN gave us a look at NASA Apollo electronics from the 1960s.
Samsung shipped the first 1 terabyte NAND chip.
For years we have faced a constrained DRAM supply with rising prices. Now we are dealing with over-supply and a forecasted 20% price crash.
Nanopower announced their nP-BLE52 module, which is a System-in-Package (SiP) combining an nRF52832 with a custom power management IC. The custom power management IC enables the SiP to put the SoC into sleep mode, cut power, and wake it up at a pre-set time and restore the pre-sleep state. Sleep mode current consumption is spec'd at 10nA, making this processor ideal for low-power and long-life embedded applications.
Apple has filed a patent for a new version iBeacon, which will utilize ultra-wide band radio instead of BLE.
The electronics industry shipped over 1 trillion devices last year, including integrated circuits and optoelectronics, sensors, and discrete (O-S-D) devices.
All About Circuits has been publishing reviews of sensors, in case you need inspiration for your next project:
- Sensors for IoT, Robotics, and Mobile: ams Optical Imaging Sensors Roundup
- Sensors Behind Device Screens, Expression Tracking, and a New SDK: Facial Recognition Roundup
Feabhas published an article describing How to use C
structs to access memory mapped peripheral registers. Many vendor SDKs and frameworks use this technique for interacting with processor peripherals.
C++ can be a confusing language, especially when details such as lvalues and rvalues come up. This practical post on C++ moves is for those developers who don't know (or don't care) what rvalues are.
C++11 added smart pointers to our arsenal, but it's not always clear how we should move them into and out of functions.
As is commonly heard,
const is a contract. It's important to understand exactly what
const should communicate at different points in our programs.
Embedded Job Postings
Cisco Meraki is hiring for a Firmware Features Software Engineer in San Francisco. The features engineer will architect and implement features across the software stack, spanning from device drivers and routing code all the way up to Cisco's distributed, cloud-hosted backend.
Hiring Embedded Engineers?
Is your company hiring for embedded systems roles? Send us a short (< 100 words) job ad with a link to the description and we will be happy to include it in our newsletter.
We've added code syntax highlighting to our website. Please let us know if you notice any problems with code samples after the update.
We expanded the Glossary with additional terms.
We updated the following article with new content:
We published the following article in January:
These were our most popular articles in January:
- Circular Buffers in C/C++
- Jenkins: Configuring a Linux Slave Node
- Installing LLVM/Clang on OSX
- C++ Casting, or: "Oh No, They Broke Malloc!"
- Jenkins: Kick off a CI Build with GitHub Push Notifications
- Jenkins: Running Steps as sudo
- Demystifying Microcontroller GPIO Settings
- An Overview of C++ STL Containers
- Migrating from C to C++: NULL vs nullptr
Thanks for Reading!
Have any feedback, questions, suggestions, interesting articles, or resources to recommend to other developers? Simply reply to this email!