Component-based Software Development for Microcontrollers Zhang Zheng FAE, ARM China 1 1
Agenda The Challenge in embedded software creation The Software Pack concept Implementation in MDK Version 5 Consistent driver interface Workflow and Summary 2
Software Complexity The Challenge Development Costs (Industrial Application) 1970 1980 1990 2000 2010 Software development costs rise with increasing performance and higher requirements 3
Hardware uses standardized interfaces Serial Connector Serial Driver RAM Ethernet Connector PHY MCU Bus SD Card SD Connector Flash 4
3rd party software reuse is limited today Does your current project reuse code from a previous embedded project? 79% 14% 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 Source: UBM Embedded Market Study 2013 5
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? 6
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 7
Software Packs MDK Core Software Packs in Keil MDK Version 5 µvision IDE with Editor Pack Installer ARM C/C++ Compiler µvision Debugger with Trace Device System/Startup Driver 1: SPI Driver 2: Ethernet Driver n: USB CMSIS CMSIS-CORE CMSIS-DSP CMSIS-RTOS MDK Professional Middleware USB Host USB Device TCP/IP Networking File System Graphic Keil MDK (Microcontroller Development Kit) 8
Web Portal for Software Packs 9
Component View and templates in Keil MDK Version 5 10
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; Device Pack Startup / System UART Driver SPI Driver MCI Driver NAND Flash Driver NOR Flash Driver USB Device Driver USB Host Driver Ethernet Driver RTE_Device.h Configuration File 11
Device and Driver Configuration Device Pack Startup / System UART Driver 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 12
Device and Driver Configuration Device Pack Startup / System UART Driver 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 Graphical User Interface File System TCP/IP Networking USB Device Stack USB Host Stack 13
Keil MDK Workflow using Software Packs Install Select Configure Implement Download relevant Software Packs from Web Portal Choose device and select required middleware Setup parameters of the Run-Time Environment Use code templates for faster software development 14
Advantages of Software Components in Keil MDK Enhanced Productivity Simplified Long-term Project Maintenance Improved Flexibility Convenient selection of software components Easy access to documentation Code templates and examples to kick-start development Software Packs with update facility and version management Simplifies the replacement of the target device Support for new devices is provided by Software Packs Open standard allows adding third party components 15