EMB422 Advanced Embedded Visual C Application Development Control - View PowerPoint PPT Presentation

presentation player overlay
1 / 28
About This Presentation
Transcript and Presenter's Notes

Title: EMB422 Advanced Embedded Visual C Application Development Control - View


1
EMB422Advanced Embedded Visual C Application
DevelopmentControl - View
  • Nat Frampton
  • President
  • Real Time Development
  • nat_at_realtimeonline.com

2
(No Transcript)
3
OEM/IHV Supplied
BSP(ARM, SH4, MIPS)
OEM Hardware and Standard Drivers
Standard PC Hardware and Drivers
Hardware/Drivers
Windows XP DDK
Device Building Tools
Windows Embedded Studio
Platform Builder
Lightweight Relational
SQL Server 2005 Express Edition
EDB
Data
SQL Server 2005
SQL Server 2005 Mobile Edition
Win32
Native Managed Server Side
Programming Model
MFC 8.0, ATL 8.0
.NET Compact Framework
.NET Framework
ASP.NET Mobile Controls
ASP.NET
Windows Media
Multimedia
DirectX
Location Services
MapPoint
Development Tools
Visual Studio 2005
Internet Security and Acceleration Server
Communications Messaging
Exchange Server
Live Communications Server
Speech Server
Device Update Agent
ManagementTools
Software Update Services
Image Update
Systems Management Server
Microsoft Operations Manager
4
Goal
  • Develop
  • Control Application
  • View Application
  • Leverage
  • eVC
  • MFC
  • Win32
  • Observe
  • Real Time Practices

5
Overview
  • Native vs. .NET Compact Framework
  • SDK Creation
  • Application Architecture
  • Win32 Application Development
  • MFC Application Development

6
Windows CE 5.0Tools
  • Operating System Development
  • Windows CE 5.0
  • Platform Builder
  • Application Development
  • Windows CE 5.0
  • Platform Builder
  • eMbedded Visual C
  • Visual Studio .NET
  • Smart Device Extensions

7
Windows CE 5.0Application Development
  • eMbedded Visual C 4.0 SP4
  • Native Code
  • Win32, MFC, ATL
  • Visual Studio .NET 2003
  • Managed Code
  • C, Visual Basic .NET

8
Framework Sizes
Win32 MFC .NET Framework
Windows XP Embedded --- 1.25 MB 34 MB
Windows CE .NET --- 280 KB 1.5 MB
  • Windows CE 5.0 OLECE400.DLL 200 KB
  • Windows XP Embedded ASP .NET 1.5 MB

9
Framework - Strengths
API API Strengths
Microsoft Win32 (C / C) Smallest and fastest .exe files and DLLs Lowest memory overhead Required for device drivers, control panel applets, shell extensions No runtime required Windows CE 5.0 is the runtime Smallest and fastest .exe files and DLLs Lowest memory overhead Required for device drivers, control panel applets, shell extensions No runtime required Windows CE 5.0 is the runtime
MFC (C) Object-oriented. Inheritance, Encapsulation, Polymorphism, also called .function overloading Container classes support arrays, lists, object maps and simplify data handling Type safety Complete MFC source code ships with Embedded Visual Tools Good tool support wizards Object-oriented. Inheritance, Encapsulation, Polymorphism, also called .function overloading Container classes support arrays, lists, object maps and simplify data handling Type safety Complete MFC source code ships with Embedded Visual Tools Good tool support wizards
.NET Framework (C and Microsoft Visual Basic .NET) Well-designed programming interface Object-oriented. Inheritance, Encapsulation, Polymorphism, also called function overloading Container classes support arrays, lists, hashtables, dictionaries, and stacks Type safety Namespaces Automatic garbage collection eliminates memory leaks Portable machine instruction set, MSIL / CIL, provides binary portable of executable (.exe .dll) files Web service clients are quick and easy to write Great support for handling XML Great tool support Forms Designer Well-designed programming interface Object-oriented. Inheritance, Encapsulation, Polymorphism, also called function overloading Container classes support arrays, lists, hashtables, dictionaries, and stacks Type safety Namespaces Automatic garbage collection eliminates memory leaks Portable machine instruction set, MSIL / CIL, provides binary portable of executable (.exe .dll) files Web service clients are quick and easy to write Great support for handling XML Great tool support Forms Designer
10
Framework - Weaknesses
API Weaknesses
Microsoft Win32 (C / C) Object cleanup is the responsibility of the application/driver programmer, making this API prone to memory leaks Low-level API can be hard to learn Procedure-oriented API, not object-oriented
MFC (C) Object cleanup only semi-automatic, therefore less prone to memory leaks than Win32, but still somewhat vulnerable since MFC is thin wrapper on top of Win32 Size of runtime 500 KB (MFC OLECE)
.NET Framework (C and Microsoft Visual Basic .NET) Size of runtime 1.5 MB Overhead of calls between managed and unmanaged code is high COM Interoperability somewhat clumsy. Requires writing Win32 wrappers that call the COM interface functions Source code is not available Requires display based platform
11
.NET Compact Framework
  • Lightweight version of .NET Framework
  • Designed for resource-constrained devices
  • Compatible with VS.NET, C, VB.NET
  • Runs applications securely on-device
  • High performance JIT compiler
  • Guarantees robustness and security
  • Highly interactive, offline, and networked
    experiences
  • Makes it easy to consume web services
  • Tunable size and performance

12
.NET Compact Framework
System.Web
System.WinForms
Services
UI
Design
ComponentModel
Description
HtmlControls
Discovery
WebControls
System.Drawing
Protocols
Caching
Security
Drawing2D
Printing
Text
Configuration
SessionState
Imaging
System.Data
System.Xml
ADO.NET
SqlClient
XmlDocument
Serialization
Design
SqlServerCe
Xslt/XPath
Reader/Writers
System
Collections
IO
Configuration
Runtime
InteropServices
Security
Net
ServiceProcess
Remoting
Text
Reflection
Diagnostics
Serialization
Globalization
Resources
Threading
13
SDK Creation
  • Encapsulation Mechanism
  • Contains
  • Compiler
  • Component Documentation
  • OEM Help, Docs and Libraries
  • Understand the target user
  • Application Only?
  • Device Driver?
  • Real Time Applications?

14
Application Architecture
15
Synchronization Strategy
1
Copy Event
2
Demo Memory
3
4
Finished Event
5
16
Control Architecture
IST
LED
Checks for Button up Inc Button Flashes the
LED Interrupt Done
Push Button
IST
Control Thread
Checks for Finished Flag Increments the Bin
Count Calcs the Bin Stats Check for Copy Request
Event Copies Data to Shared Memory Sets the
Copy Finished Event Sleeps 5 ms Loop
Copy Event
Demo Memory
Finished Event
17
Hardware
18
DemoControl.exeA Win32 App
19
Interrupt Architecture
Thread
IST Latency
IST
OAL
ISR1
ISRN
ISR
ISR Latency
ID
Kernel
Set Event
ISR
HW
All Higher Enabled
All Except ID
All
20
WindowsCE 5.0 Priority Map
Priority Component
0-19 Open Real Time Above Drivers
20 Permedia Vertical Retrace
21-89 Open Real Time Above Drivers
99 Power management Resume Thread
100-108 USB OHCI UHCI, Serial
109-129 Irsir1, NDIS, Touch
130 KITL
131 VMini
132 CxPort
133-144 Open Device Drivers
145 PS2 Keyboard
146-147 Open Device Drivers
148 IRComm
149 Open Device Drivers
150 TAPI
151-152 Open Device Drivers
153-247 Open Real Time Below Drivers
248 Power Management
249 WaveDev, TVIA5000,Mouse,PnP,Power
250 WaveAPI
251 Power Manager Battery Thread
252-257 Open
21
Interrupt Initialization
// Create the Event gIntEvent
CreateEvent( NULL, // NULL FALSE, // Manual
reset FALSE, // Init as not
signaled NULL // No Named Events ) //
Create a thread that waits for signaling gThreadIn
t CreateThread( NULL, // NULL 0, // No
Stack Size ThreadInt, // Interrupt
Thread NULL, // No Parameters CREATE_SUS
PENDED,// Suspended dwThreadID // Thread
Id) // Initilialize the Interrupt gSysInterruptNu
m KernelIoControl( IOCTL_HAL_TRANSLATE_IRQ,
gIRQNum, sizeof(DWORD), gSysIntNum,
sizeof(DWORD), NULL ) InterruptInitialize( gSysI
ntNum, // From Map gIntEvent, // Global
Event NULL, // Not Used (DWORD)NULL // Not
Used ) ) // Get the thread going ResumeThread(
gThreadInt )
22
Interrupt Service Thread
DWORD WINAPI ThreadInt( LPVOID lpvParam ) //
The magic thread waits for the event. while(
gRun ) // Wait until we have been signaled
that there is an interrupt WaitForSingleObject(
gIntEvent, INFINITE ) // Increment the
counter gInterruptCount // Run your
logic here // Reset the interrupt so we can
get another one InterruptDone( gSysIntNum
) return 0
23
DemoView.exe a MFC App
24
Review
  • Native and .NET CFW applications both have their
    place
  • Complex Applications can be rapidly Development
    in Embedded Visual C
  • Windows CE provides a rich real-time environment
    for a variety of application architectures
  • Embedded Visual C is now your most powerful
    tool!

25
While at MEDC 2005
  • Fill out an evaluation for this session
  • Randomly selected instant WIN prizes!

Visit the Microsoft Product Pavilion in
the Exhibit Hall Shorelines B
Use real technology in a lab Instructor
led Reef E/F Breakers L
Self-paced Reef B/C
26
After The Conference
Build
Install Build Join
Full-featured trial versions of Windows CE
and/or Windows XP Embedded Cool stuff tell us
about it msdn.microsoft.com/embedded/community
Windows Embedded Partner Programwww.mswep.com
Develop
Install Enter Join
Windows Mobile 5.0 Eval Kit including Visual
Studio 2005 Beta 2 Mobile2Market Contest and win
up to 25000 mobile2marketcontest.com
Microsoft Solutions Partner Programpartner.micr
osoft.com
27
Tools Resources
Build
Develop
Websites
msdn.microsoft.com/ embedded
msdn.microsoft.com/ mobility
Newsgroups
microsoft.public. windowsxp.embedded
windowsce.platbuilder
windowsce.embedded.vc
microsoft.public. pocketpc.developer
smartphone.developer
dotnet.framework.compactframework
Blogs
blogs.msdn.com/ mikehall
blogs.msdn.com/ windowsmobile
vsdteam netcfteam
Tools
Windows CE 5.0 Eval KitWindows XP Embedded Eval
Kit
Windows Mobile 5.0 Eval Kit
28
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com