Renesas Synergy: A Peek Under the HoodRenesas Synergy: A Peek Under the Hood
Recently, Renesas released a new development platform known as Synergy, whose purpose is to decrease development time for basic software components and RTOSs by providing qualified and tested software components. Does it live up to the fanfare?
March 4, 2016
Building a production-intent embedded system is not a trivial endeavor. The effort required to get a basic board support package up and running let alone the application code can take up a fairly large portion of the development cycle. Recently, Renesas released a new development platform known as Synergy, whose purpose is to decrease development time for basic software components and RTOSs by providing qualified and tested software components. Let’s take a look under the hood at the software behind the Synergy platform.
The Synergy Software Platform, SSP, makes up the heart of Renesas Synergy. The SSP consists of an integrated software stack that not only contains microcontroller drivers but also a real-time operating system with supporting frameworks such as USB and file system. Developers looking to accelerate their designs can easily configure the SSP to use only the components they need. One of the exciting aspects of having these components already integrated is that teams can focus on innovation and product differentiation rather than on simply getting their microcontroller to run code.
Development kits like this serve as a basis for the hardware platforms on which the Synergy Software Package is qualified and warranted. DKs are available for every series of Synergy microcontrollers.
(Source: Renesas)
In my article Don’t Ship Merely Functional Systems, at Design News sister publication EDN, I examined some of the pitfalls of using example code in a production-intent system. The SSP is designed to be used as-is, without modification other than for configuration, so I wondered whether the code under the hood would be well organized and represent what one might expect in production-intent software. I purchased a Synergy S7 development kit, and after installing the E Squared development toolchain with SSP 1.0.0, I decided that a USB Mass Storage Device Host application would be a perfect example to explore.
After importing the USB example, the first item of interest to check was how well the code was organized. Usually an example project or supplied driver code is atrociously organized, highly coupled, and at best cryptic. The USB example was organized quite nicely with include and source folders for the example code with separate synergy and synergy cfg folders for the SSP. The SSP folders then drilled down into bsp, driver and framework folders that each contained highly cohesive modules.
The next area of interest was to review the complexity of the SSP. Many developers know that a McCabe complexity for a function less than 10 is highly desirable to decrease the probability of bugs in the code. Many USB stacks that I’ve encountered have had a horrible track record in this respect with complexities of some functions reaching well into the 30s. After setting up my trusted analysis tool, I was fairly surprised to find that within the SSP all of the functions were well within the desired complexity value of 10.
READ RELATED ARTICLES ON DESIGN NEWS:
As I dug deeper into the code, I discovered that the SSP was also commented fairly well. Comments existed throughout the code that seemed to make sense and at times even referenced the hardware manual (although the exact document and page were absent from the comment). The SSP interface and APIs even appeared to follow a standard along with many best practices for the development of embedded software.
The SSP appears to be a good leap forward considering the typical set of software that a developer gets at the start of project, but like any software base it isn’t perfect. Compiling the example code and SSP resulted in a successful build with 19 warnings and seven informational messages. After sorting through the messages, the majority of them were found to be coming from the USB example module and not the SSP except for one.
Within the SSP, there was the declaration of an uninitialized status variable that had the possibility of being read before initialization. The variable was initialized within a switch statement that contained a fall-through case (bad programming practice), two additional cases that set status depending on the case, and then finally an empty default case. To make the matter worse, the switch statement is usually the last tool an experienced developer reaches for and instead could have been written using a simple if/else statement that would have removed the compilation warning and made the encapsulating function more efficient.
The remainder of the compiler warnings were located in the high-level example code. Examining the warnings revealed that within the example code, a number of global variables were defined at the file-scope level that were shadowed by function local variables of the same name! Examining the complexity of the example code functions also revealed a cyclomatic complexity of 22 as can be seen in Figure 1.
Figure 1.
(Source: Jacob Beningo)
The Renesas Synergy platform is making an exciting entry into the embedded system marketplace with the potential to ease the development pressures placed on embedded software engineers. A focus on innovation and speed rather than basic system functions could result in an explosion of new technologies and devices. The peek under the hood of the SSP appears to reveal a well-developed, integrated, and tested software platform many 21st century developers would expect to have access to.
If you want to take a look at the starter kit I used to experiment with the SSP, read my EDN article Hands-on Review of the Synergy S7 Starter Kit – First Look.
Jacob Beningo is principal consultant at Beningo Engineering, an embedded software consulting company. Jacob has experience developing, reviewing and critiquing drivers, frameworks and application code for companies requiring robust and scalable firmware. Jacob is actively involved in improving the general understanding of embedded software development through workshops, webinars and blogging. Feel free to contact him at [email protected], at his website www.beningo.com, and sign-up for his monthly Embedded Bytes Newsletter here.
Like reading Design News? Then have our content delivered to your inbox every day by registering with DesignNews.com and signing up for Design News Daily plus our other e-newsletters. Register here!
You May Also Like