Embedded System and Development: Rajani Bhandari Senior Project Manager HCL Technologies
Embedded System and Development: Rajani Bhandari Senior Project Manager HCL Technologies
Development
Rajani Bhandari
Senior Project Manager
HCL Technologies
Topics
2
Introduction to Embedded systems
3
Introduction of Embedded system
4
Connect via peripherals
5
Examples In Your Daily Life
…wake up …
…have breakfast …
6
Examples In Your Daily Life
(cont’)
7
Examples In Your Daily Life
(cont’)
…Back Home …
8
A “short list” of embedded systems
10
Difference - Embedded and PC
Embedded PC Application
12
Embedded vs PC App - Testing
Embedded PC Application
Debugging is very difficult Usually simple to get a basic
Emulators or simulators are debug output
required at the time of Can be very sophisticated
development testing
14
Design Challenges
The physical space required by the system and measured in bytes for
Size software and gates for hardware.
Power
Performance Size
NRE
cost
16
Examples of embedded system
17
Mobile evolution – impact on design matrices
Factors Affected
Cost
Design Complexity
Size
Performance
Power Consumption
18
Digital camera- An embedded system example
lens
19
Time to Market- Design challenge
Revenues ($)
Time (months)
Market window:
Period during which the product would have highest sales
Average time-to-market constraint is about 8 months. Delays can be costly.
20
Design Challenge
21
Software Development Life cycle
22
Embedded system Life Cycle
24
Architecture of embedded system
Application Software
Operating System
Hardware
25
Hardware architecture
26
Development Guidelines
27
Guidelines for embedded application
development
Memory Guidelines
Data Type
Life time of variable
Memory allocation on heap or stack. Memory should be freed
if not required
Stateless components
Logging and Instrumentation
User Interface
Simple UI
Hour glass as visual indicator for blocking operation
Resolution and LCD size
Design for usability by supporting for touch, stylus driven, 5-
way
Do not update ui frequently
Power:
Optimal Power usage
Transferring data on Air
Reset Device
Design for the restoration of configuration
28
Key rules for best coding
29
Maintenance problems
Unstructured code
Insufficient documentation
30
Efficiency
31
Coding standards
Readability of code
Size of Function
Variable naming
Code Commenting
Long methods
Private, public or local variable naming rule
Formatting and indentation
Complexity of code
Multiple return statement
Nested loop or conditions
Uninitialized variables
Duplicate code prone to errors
Avoid Hard Coding
Multilingual support
Use of enum to indicate discrete values
Reusable code or shared libraries
32
Sample code
// This class provides the functionality
// of adding numbers
#include <iostream>
using namespace std;
int main( )
class Adder{ {
public:
// constructor
Adder a;
Adder(int i = 0)
{ a.addNum(10);
total = i;
}
a.addNum(20);
// interface to outside world a.addNum(30);
// Adds a number and calculates
total
void addNum(int number) cout << "Total " << a.getTotal()
{ <<endl;
total += number; return 0;
}
// interface to outside world
}
//get sum total result
int getTotal()
{
return total;
};
private:
// hidden data from outside world
int total;
33
};
Which one is better
34
Sample Code
function do_stuff() { function do_stuff() {
// …
if (is_writable($folder)) { // ...
if ($fp =
fopen($file_path,'w')) { if (!is_writable($folder)) {
if ($stuff = return false;
get_some_stuff()) {
}
if
(fwrite($fp,$stuff)) {
if (!$fp = fopen($file_path,'w')) {
// ...
return false;
} else {
}
return false;
if (!$stuff = get_some_stuff()) {
} return false;
} else { }
return false;
} if (fwrite($fp,$stuff)) {
} else { // ...
return } else {
false; return false;
} }
} else { }
return false;
}
}
35
Good Coding and Design brings >>>
36
Questions ??
37
Thanks!!
38