One of the biggest challenges in embedded software development is the integration of low-level drivers with higher-level middleware and application code. Purchasing middleware or reusing application code is necessary to meet the demanding and grueling pace of the modern product development cycle. Developers often have struggled with integration due to a lack of standard interfaces along with changing abstraction layers. They usually conquer these difficulties through clunky and inefficient wrappers, but silicon vendors are coming to the rescue.
A number of silicon vendors, including Renesas and STMicroelectronics, recently announced qualified hardware abstraction layers (HALs) that provide a standard and consistent interface between low-level hardware and the middleware/application code. Middleware and application developers now can develop their modules using a fixed interface, with no more attempts to fit a square into a round hole. The result will be faster, higher quality firmware development.
There are many advantages to using a HAL provided by a silicon vendor. First, the HALs are being certified for use even in strict development environments such as automotive. Take, for example, STMicroelectronics' recent announcement of its certified HAL for the STM32 ARM Cortex-M series of microcontrollers. The HAL meets MISRA-C standards in addition to the demanding ISO/TS16949 standard. Second, STMicro developed the HAL in parallel with the MCU itself and verified it on FPGA hardware prior to a full battery of tests on the final microcontroller silicon. The tests included full-parameter checking, peripheral functionality, and even critical timing measurements and system-level interactions with the HAL.
The true advantages of utilizing a silicon-vendor HAL go far beyond the certification and interface testing. The use of a certified and proven interface allows developers to cast their eyes beyond the low-level workings of the microcontroller and focus on the product's application instead. MCUs have become complex beasts, and getting them up and running can be time consuming, which in turn results in burned budgets and development time. Employing the HAL abstracts out the hardware layer and brings focus to the middleware and the application layer. The road to faster firmware is wide open!
Middleware and application developers should be able to leverage the HALs to create more robust and portable code. Using a standard interface to gain access to the low-level hardware allows application blocks to be developed and used from one product to the next. Each use should improve the reliability of the component, improving software quality and decreasing development time and cost.
Despite all of the advantages, there are some possible drawbacks to adopting the certified HALs provided by the microcontroller vendors. First, each microcontroller vendor has its own set of HALs. Adoption of one vendor's HAL will potentially exclude access to certain middleware and third-party application code. Second, development teams will begin the gradual slide into being locked with one silicon vendor for software and tool chain. Over the course of a few development cycles, software will be heavily tied to the HAL, which will make changing microcontroller vendors a time-consuming and costly endeavor if existing code is to still be leveraged in future applications. There will be an eventual point of no return, and the development team will be forced to use a single vendor for all microcontroller solutions.
Adopting a microcontroller vendor's HAL has many advantages. It is another tool that silicon vendors are providing to help developers decrease their time and cost of developing embedded systems. The adopter must be aware and diligent in understanding the advantages and disadvantages of using a certified HAL. A team that likes to switch between microcontroller vendors or has more than one microcontroller to support may find that it is more advantageous to utilize their own HALs.
Nevertheless, microcontroller vendors are stepping up to the plate and not just providing quality hardware but now quality tools to help developers build faster, cheaper, and higher quality products.
Interested in learning more about the best practices of HALs and APIs and how to get the most out of them in your design cycle? Consider reading "Embedded System Design Techniques - An API Standard for MCU's," which can be found here.
Jacob Beningo is a Certified Software Development Professional (CSDP) whose expertise is in embedded software. He works with companies to decrease costs and time to market while maintaining a quality and robust product. Feel free to contact him at [email protected], at his website www.beningo.com, and sign up for his monthly Embedded Bytes Newsletter here.