14
SDK For Firmware Development Ramesh Prasad [email protected]

Sdk For Firmware Development

Embed Size (px)

DESCRIPTION

This presentation discusses the need and design of an SDK for firmware development.

Citation preview

Page 1: Sdk For Firmware Development

SDK For Firmware Development

Ramesh [email protected]

Page 2: Sdk For Firmware Development

Outline

• Introduction• Need for SDK• Software Architecture• Benefits of SDK

Page 3: Sdk For Firmware Development

Introduction

• Software Development Kit (SDK) is a set of APIs which allow the programmer to develop application for a particular platform

• SDK simplifies the development, as the low level details are abstracted from the programmer

• SDK provides APIs to easily access, manage and transact with the hardware

Page 4: Sdk For Firmware Development

Need For SDK

• Software complexity is increasing while the time to market is shrinking

• Managing budget and schedule is becoming increasingly difficult

• Software reuse is the only way to meet these challenges

• Software reuse needs a methodological approach in embedded world as there is a wide variety of hardware and peripherals

Page 5: Sdk For Firmware Development

Software Architecture - Usage

• SDK is a static library which can be linked to the application code

.lib ApplicationCode Executable

Compiler/Linker

Page 6: Sdk For Firmware Development

Software Architecture - Layering

Hardware Platform

CMSIS Porting layer/Silicon Vendor Library Layer

Device Drivers

Driver Abstraction Layer

API Wrapper Layer

Application

Page 7: Sdk For Firmware Development

Software Architecture – Hardware Platform

Page 8: Sdk For Firmware Development

Software Architecture – SDK StructureThe following is the structure of the SDK-1. Boards

Contains the board specific source code, library and project for the SDK project.i. Common : Source and include files common to the different variants of the board.ii. Board_rev: Code specific to the board and revision

2. Docs Contains the documents.

3. inc SDK header files.

4. Libs SDK library.

5. Samples Various sample code for different peripherals.

6. stm32f10x_stdperiph_lib Standard peripheral library provided by ST.

7. Readme.txt This document.

8. change_log.txt Revision and details of the SDK.

9. TestTest routine for the SDK.

Page 9: Sdk For Firmware Development

Software Architecture – SDK Headers

• Platform.h• Data_types.h• Buzzer.h• LCD.h• Battery_monitor.h• Gsm.h• GPIO.h• I2C_EEPROM.h• LED.h

• Keypad.h• Pc_comm.h• Printer.h• RTC.h• Smart_card.h• SPI_Flash.h• System_init.h• Timer.h• Utils.h

Page 10: Sdk For Firmware Development

Software Architecture – GSM.h• #ifndef __GSM_H• #define __GSM_H

• #ifdef __GSM_C• #define GSM_SCOPE• #else• #define GSM_SCOPE extern• #endif

• typedef struct /* GPRS Usage Structure */• {• u8 APN[31];• u8 USER[11];• u8 PASSWD[11];• u8 IP_ADDR[16];• u8 PORT[6];• } GPRS_DETAILS;

• GSM_SCOPE GPRS_DETAILS IP_Details;

• GSM_SCOPE void Init_GSM(void);• GSM_SCOPE void Set_GSM_Reset(void);• GSM_SCOPE void GSM_Tmr_Delay(u32 M_Sec);• GSM_SCOPE void Send_DataTo_GSM(u8 Str[]);

• GSM_SCOPE s8 Setup_GSM_Modem(void);• GSM_SCOPE s8 Check_GPRSNwk(void);• GSM_SCOPE s8 Check_Network(void);• GSM_SCOPE s8 Send_SMS(s8 Num[], s8 Msg[]);• GSM_SCOPE s8 Establish_Connection(GPRS_DETAILS IP_Details);• GSM_SCOPE s8 Connect_To_TCP_UDP(u8 Udp_Tcp_Id, GPRS_DETAILS IP_Details, u8 *GPRS_Test_Msg);

• #endif

Page 11: Sdk For Firmware Development

Software Architecture – GSM

Device Driver

Driver Abstraction Layer

API Wrapper Layer

Application

GSM Module 1

Device Driver

GSM Module 2

Device Driver

GSM Module 3

Page 12: Sdk For Firmware Development

Software Architecture – utils.h• #ifndef __UTILS_H• #define __UTILS_H

• #include "platform.h"

• //32 bit utility functions• #ifdef __UTILS_C• #define UTILS_SCOPE• #else• #define UTILS_SCOPE extern• #endif

• UTILS_SCOPE void Delay(vu32 nCount);• UTILS_SCOPE void Clrbuf(u8 *Str, u32 Len);

• UTILS_SCOPE float AtoF(s8 *str);• UTILS_SCOPE u32 AtoI( u8 *str);• UTILS_SCOPE void ItoA( const unsigned long value, unsigned char *str);

• UTILS_SCOPE void Rev_String(u8 *str);• UTILS_SCOPE u16 Strlen( const u8 *str);• UTILS_SCOPE u8 Rev_ByteBits(u8 byte);• UTILS_SCOPE u32 Rev_WordBits(u32 byte);• UTILS_SCOPE u16 Rev_HalfWordBits(u16 byte);

• UTILS_SCOPE u8 *strset(u8 *s, u16 ch);• UTILS_SCOPE u8 *Strnset(u8 *str, u16 ch, u16 n);• UTILS_SCOPE u8 *Strcpy(u8 *dest, const u8 *src);• UTILS_SCOPE u8 *Strcat(u8 *dest, const u8 *src);• UTILS_SCOPE u8 *Strncpy(u8 *dest, const u8 *src, u16 maxlen);

• UTILS_SCOPE s8 Strcmp(const u8 *s1, const u8 *s2);• UTILS_SCOPE s8 Strncmp( const u8 *str1, const u8 *str2, u16 nob);

• #endif

Page 13: Sdk For Firmware Development

Benefits of SDK

• Code reusability• Small learning curve for application developer• Easy migration to a different processor and/or

peripheral• Code security• Abstraction of low level details• Ease of development for third party • Ease of upgrade

Page 14: Sdk For Firmware Development

Thank You