challenges in embedded development
DESCRIPTION
SQABD Lightning Talks 3 www.sqabd.comTRANSCRIPT
![Page 1: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/1.jpg)
M. Kaisar Ul HaquePrincipal Software EngineerReliSource Technologies Ltd.
![Page 2: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/2.jpg)
M. Kaisar Ul HaquePrincipal Software EngineerReliSource Technologies Ltd.
![Page 3: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/3.jpg)
The Embedded Platform8 bit MCU (Microcontroller Unit)16 bit MCU32 bit MCU/ProcessorCosting, Physical Size, Power Consumption,
Computational Power, Resources (RAM, Program memory, Peripherals).
All architectures are currently popular, for example new 8 bit models comes out every few months!
![Page 4: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/4.jpg)
![Page 5: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/5.jpg)
Resource Constrains8 bit MCU, an example:
1 KB of RAM16 K instructions / Code Size / Program
memoryLimited peripherals
![Page 6: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/6.jpg)
Resource Constrains (Contd.)“What makes ESW different [from other
software development] is resource constraints,” says Bob Iannucci, senior vice president and head of Nokia Research Center, Nokia's corporate research unit in Helsinki. Dr. Zhang agrees: “You have to think about space, power conservation and pixel constraints. You have to balance power, simplicity, footprint, cost and size.”
![Page 7: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/7.jpg)
Code Sizelong SomeFunction(long a, long b){
long c = a * b;return c;
}
![Page 8: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/8.jpg)
Code Size (Contd.)long SomeFunction(long a, long b){
long c = a * b;return c;
}
Assignments can be expensive!
![Page 9: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/9.jpg)
Code Size (Contd.)uint16 SomeFunction(uint8 a, uint8 b){
uint16 c = a * b;return c;
}
![Page 10: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/10.jpg)
Code Sizeuint16 SomeFunction(uint8 a, uint8 b){
uint16 c = a * b;return c;
}
Function calls can be expensive!•Next instruction (PC) is changed,•Stack frame is changed•Parameters are placed in stack (assignments)•Room made for return value•Room made for locals•Function code executes•Return value stored (assigned)•Stack frame changed / popped•Return value assigned as function’s value•PC is changed / popped
![Page 11: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/11.jpg)
Code Size (Contd.)Macros are better in many casesBut not in all cases..
#define SomeFunction(a, b) ((a) * (b))x = SomeFunction(y, z);
![Page 12: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/12.jpg)
Code Size (Contd.)Multiplications can be expensive..x = y * 8;x = y << 3;
Floating point operation can be expansive1.5 * 1.5 = 2.25 is more expansive than15 * 15 = 225
![Page 13: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/13.jpg)
Code Size (Contd.)What machine code/instructions your code
generatesHow to minimize your codeSave every instruction you canHundreds of business logics can be difficult
to fit into the program memory (for example in 16k)
![Page 14: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/14.jpg)
RAM SizeHow much RAM your code needs?How to minimize RAM utilization?Save every ‘bit’ you can.. Literally
![Page 15: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/15.jpg)
RAM Size (Contd.)Many data types (int, long, float, double) can
be expensive!
long SomeFunction(long a, long b){
long c = a * b;return c;
}
![Page 16: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/16.jpg)
RAM – Saving every ‘bit’uint8 a; //value range 1 to 50uint8 b; //value range 1 to 10
![Page 17: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/17.jpg)
RAM – Saving every ‘bit’uint8 a; //value range 1 to 50uint8 b; //value range 1 to 10
typedef struct{
uint8 a: 6;uint8 b: 2;
} s_ab;s_ab ab; //takes 1 byte
![Page 18: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/18.jpg)
PowerSleeping is better than working :)Some peripherals consume more powerHigh clock speed consumes more powerNeed to save as much uA as possibleLess utilization of power = more battery life
= less cost = better business = less batteries = greener world
![Page 19: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/19.jpg)
Real-time IssuesSome communication timing must be
precise..Depended on the clock.. the clock doesn’t run
at the speed it should.. You asked for 2 MHz.. you got 1.4 MHz..
26uS
![Page 20: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/20.jpg)
Expertise over ‘the Platform’Memory – Banks, AddressingPeripherals – Clock, WDT, IRQ, IO, LCD,
ADC, RTC, TBC, TimersCommunications - UART, I2C, SPISpec/Datasheet, User Manual, Instruction
set, C Language, Compiler, Assembler, Linker Docs
![Page 21: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/21.jpg)
Cross-Platform ArchitectureCodes needs to support current and future
target platformsHardware abstraction layer is required to
separate platform specific and business codes.
Reusable modules is the keyChanges in a module needs to be tested over
all platforms
![Page 22: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/22.jpg)
Shortage of DocumentsNot much example code from vendorNo example/help returned in GooglePlatform not yet released in the marketYou only have the documents provided by the
MCU vendor and those can have errors!
![Page 23: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/23.jpg)
DebuggingLimited support of break pointsMany real-time scenarios are impossible to
debugNeed the right tools to debug
![Page 24: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/24.jpg)
Collaboration“Any device we manufacture these days is
getting more and more complicated, with quite a bit of software and hardware integration,” says Woo-hyun Paik, president and chief technology advisor at LG Electronics in the United States. “You can't do it all by yourself.”
![Page 25: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/25.jpg)
Testing, Testing.. TestingAccenture’s AJ Gupta. “Without a structured
approach to testing, a company cannot effectively match initial product requirements with specific testing activities and expected actual outcomes. This—coupled with the fact that many companies lack the robust tools necessary to adequately test today’s complex high-tech products— results in bugs that go uncaught before the product is shipped.”
![Page 26: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/26.jpg)
![Page 27: Challenges in Embedded Development](https://reader036.vdocument.in/reader036/viewer/2022081413/546d8aa3af795963268b6816/html5/thumbnails/27.jpg)