component-based software development for microcontrollers
TRANSCRIPT
1
Component-based Software Development
for Microcontrollers
Zhang Zheng
FAE, ARM China
1
2
Agenda
The Challenge in embedded software creation
The Software Pack concept
Implementation in MDK Version 5
Consistent driver interface
Workflow and Summary
3
Software Complexity – The Challenge
1970 1980 1990 2000 2010
Development Costs
(Industrial Application)
Software development costs rise with increasing performance and higher requirements
4
Hardware uses standardized interfaces
RAM
Flash
Serial
Driver
Serial
Connector
PHY Ethernet
Connector
SD
Connector
SD
Card
Bus MCU
5
3rd party software reuse is limited today
14%
79%
25%
15%
No, all new software, no
code reuse
Yes, reused code developed
in-house
Yes, reused open-source,
shareware code
Yes, reused purchased code
Does your current project reuse code from a previous embedded
project?
Source: UBM Embedded Market Study 2013
6
Questions when using 3rd party software
Usage of files (source code, header, library)?
Project Maintenance after files are integrated?
Where is the documentation?
What are the License conditions?
7
The Keil MDK Version 5 Solution: Software Packs
Software components are delivered in one
easy to install Software Pack
A package description file (PDSC) contains:
Supplier information
Download URL
License
Release version
Dependencies on processors, devices, tool chains
or other components
Software Pack
Component
Libraries
Configuration Files
Header File (API)
Documentation
Device Parameters
Flash Algorithm
Component
Component
8
Software Packs in Keil MDK Version 5
Keil MDK (Microcontroller Development Kit)
So
ftw
are
Packs
System/Startup
Driver 1: SPI
Driver 2: Ethernet
Device
Driver n: USB
…
CMSIS-CORE
CMSIS-DSP
CMSIS-RTOS
CMSIS
File System
MDK Professional Middleware
Graphic
TCP/IP
Networking
USB Device
USB Host
MD
K C
ore
Pack Installer
µVision IDE with Editor ARM C/C++ Compiler
µVision Debugger with Trace
9
Web Portal for Software Packs
10
Component View and templates in Keil MDK Version 5
11
Consistent Driver Interface for Peripherals
Drivers provide standardized interfaces to peripherals
Drivers are configured using a central file
Functions are accessed by a control structure
struct _DRIVER_SPI {
DRV_VERSION (*GetVersion) (void);
SPI_STATUS (*Initialize) (SPI_SignalEvent_t
SPI_STATUS (*Uninitialize) (void);
SPI_STATUS (*PowerControl) (POWER_STATE
SPI_STATUS (*Configure) (SPI_FRAME_FORMAT
SPI_STATUS (*SendData) (const uint8_t *buf,
SPI_STATUS (*ReceiveData) (uint8_t *buf,} const
DRIVER_SPI;
Startup / System
UART Driver
Device Pack
SPI Driver
MCI Driver
NAND Flash Driver
NOR Flash Driver
USB Device Driver
USB Host Driver
Ethernet Driver
RTE_Device.h
Configuration File
12
Device and Driver Configuration
Startup / System
UART Driver
Device Pack
SPI Driver
MCI Driver
NAND Flash Driver
NOR Flash Driver
USB Device Driver
USB Host Driver
Ethernet Driver
RTE_Device.h
Configuration File
UART1
SPI2 SPI3
NAND
USBD2
USBH1
RMII
13
Device and Driver Configuration
Startup / System
UART Driver
Device Pack
SPI Driver
MCI Driver
NAND Flash Driver
NOR Flash Driver
USB Device Driver
USB Host Driver
Ethernet Driver
RTE_Device.h
Configuration File
UART1
SPI2 SPI3
NAND
USBD2
USBH1
RMII
Middleware
File System
Graphical User
Interface
TCP/IP Networking
USB Device Stack
USB Host Stack
14
Keil MDK Workflow using Software Packs
Install
• Download relevant Software Packs from Web Portal
Select
• Choose device and select required middleware
Configure
• Setup parameters of the Run-Time Environment
Implement
• Use code templates for faster software development
15
Advantages of Software Components in Keil MDK
Enhanced Productivity
• Convenient selection of software components
• Easy access to documentation
• Code templates and examples to kick-start development
Simplified Long-term Project Maintenance
• Software Packs with update facility and version management
• Simplifies the replacement of the target device
Improved Flexibility
• Support for new devices is provided by Software Packs
• Open standard allows adding third party components