TOPPERS $&7$Q$CM,R0KP©-P618§¨­ $&7$§¨    $CM,R0KP©§¨Zl3&8N

­ .NET Micro Framework for TOPPERSZ}

­ vY7>&19L&>R2«X­ª Wi¬r¤­ ¥016Gcz®g016G©[!©}

­ TOPPERS/ASP *R<NQ.NET Micro Framework«NETMF¬# TOPPERS S¥016Go!

"

M$N3&G{_ p

016G© £qF9N'($.DR8 #EN4CL58A)RGo!

o NETMF =R9'($]n-$Q-R9§ba

TOPPERS dj!¥016Gczg016G©tuJR/Rh-R9#©j

TX¥ OS oV\

NETMF ©-FI;6%A%R9>5+!

$&7$/$CM,R0KP¡TOPPERS/ASP+TECS S.NET Micro Framework # OS on OS x|!TINET`!

 TOPPERS mTECS #[ NETMF

 OS Facilities s#!TOPPERS S NETMF SUJR/R$CM,R0KP¦^fZ#.DR8! TOPPERS  NETMF ~w.R@1RN#¢

NETMF .NET $CM,R0KPeyj TOPPERSInterOp +L1L&BLM#!Windows Sk GCC +O1-P?&L

TOPPERS  NETMF U#@N9jHP6:P1#p!

TOPPERS ņŘEGcEEo~RW|ƸśTbYd
Ā¾Ñ-ƞĢ

2013 ó 9 Ĩ 30 ğİõŤcjGYe}GjZ ğǅÃ

hidaka@devdrv.co.jp

-1-

Şļ1.

2.

3.

4.

.8+ ......................................................................................................................... 3
1.1.

.NET Micro Framework (.ǐ ............................................................................. 3

1.2.

őƷǆMono (-êŀǇ ......................................................................................... 3

1.3.

OS 2-ťĲ ........................................................................................................ 4

1.4.

ÂſăÛ .................................................................................................................. 4

1.5.

}G[Y .............................................................................................................. 5ƸśĞń ......................................................................................................................... 5
2.1.

TkG}-ƴċ ................................................................................................... 5

2.2.

]

2.3.

ĶćĵƎ .................................................................................................................. 6

2.4.

ĴĵƎ .................................................................................................................. 7S`dŕÝ ....................................................................................................... 6

EGcE-tGd ....................................................................................................... 8
3.1.

Eo~R

W|ƹư......................................................................................... 83.2.

u_o}`dmK

3.3.

veHIE-ņŘ .............................................................................................. 11

w....................................................................................... 11

ëĭ-íĪ ................................................................................................................... 11-2-

1. 
Ā¾Ñ-ƞĢ-¶+Ó-EGcE-bu'>.NET Micro Framework +$

&űÁ+ŷ5
1.1.

.NET Micro Framework J.NET Micro Framework ǆ NETMFǇ.Ų× Microsoft Research Ƹś& 2001
ó+ÀŲ'ƣß?
bwŘ-Lq

SPOT Watch (Î1âĺƁƃĤƕ+ĒŘ?

ìƐĹŸ6Ʃ6WYbFQWYbw(OS)(-ƸśŕÝ'ěŜ KB Ŧô-xy~( MMU ō- MCU ' MSIL (Microsoft Intermediate
LanguageǏ.NET -E[n~ ƹTBUte)BG]o~]»>}]Gw(?

d> OS }Gn}~ cjGYe}Gj n'Ķć? C#Ŭ-.NET ƔƝ'Ɨƫj`Q

=Jvz

]

^( Visual Studio - SDKdoQ}wB Visual Studio '\'»

=*<YTec

èģ+Ÿ6Ʃ6Eo~RW|BƸś>(ÆƁ'œØ.Lo\Y¿?& CodePlex (http://netmf.codeplex.com/) +&Tvzgb

F+;=ƸśxbfY?&520 ŧ-Ÿ6Ʃ6se:ķ

DGWYbw:odT
Řƭ:
1.2.

U

* CPU +ťĲ?

ơé*cjGYe}Gj(lYBÌ7ơé*veHIE-Utmd+;=Ĵ½ĚƀŘŸ6Ʃ6WYbw'âě´Ř?&5<EHMono ,9IÊLo\Y-u_o}`dmK?>ÜÉ=5w'»> Mono oXIPd(ŀƧ+ļ-ŌŚ*=5 NETMF .ō¥- Express ŏBÌ7 Visual Studio -TkG}BŘ&le>
8TkG}JX. Windows Ř(Ê'|êĀŬ-TkG}-đ>Ɔ:ŖćTâ-a

*A"J}e¬Ʈ'±Ŕ:LoW

Visual Studio +î>:ĺƁ´ŘÆƁ'

 NETMF . ì Ɛ Ĺ Ÿ 6 Ʃ 6 Ř ƭ ' - ´ Ř B Ą æ yXz¿ĔƱ?

ROM/RAM ěŜ KB Ŧô-xy~'»5 NETMF +. JITǆJust In TimeǇTkG}ĺƁō'»5-3-ò+ƹƔƝG]o~]1.3.

OS &@5

+ NETMF -ĶćÕBţ5 Ó-EGcEçœ(ƺŇőý. .NET E[n~-çƉŕÝ'> CLR(Common Language Runtime)BUtuWŕÝ.

d>

PAL(Platform Abstraction Layer) 'ČƢ¿?&&8-Ą- PAL .ieHIE(cjGYe}Gj'Ķć?> Native Platform - HAL !'*
Facilities BUtd> OS on OS ùą-\~zOS

W|+9êĀÆƁ*Ƙƕ(*#&>('Ó- NETMF -ťĲ+ƺ>EGcE'. TECS BŘ&- OS Facilities ïB)-;+ĶŰ>((Ɵǃ(*=5 - Native Platform- “OS on OS” Solution
CLR: Common Language Runtime
HAL: Hardware Abstraction Layer
PAL: Platform Abstraction Layer
Õǉǈ.NET Micro Framework -ÚĬĶƯ1.4.

)A/*Ó- OS on OS ùą'- TOPPERS 2- NETMF -ťĲ+$&.
+Ùū- Linux 2-ťĲ-Ɨ( G]mI«Ƹŉ\YT

eBÂſ+5

Yƛ 2011 ó 4 ĨÇĊƊƓƞ Linux 2-.NET Micro Framework ťĲ-¼Ĉǆ¶ŽǇ
 G]

mI

Yƛ 2011 ó 6 ĨÇĊƊƓƞ Linux 2-.NET Micro Framework ťĲ-¼ĈǆúŽǇ
 \YTeǎCodePlex .NET Micro Framework for Linux

http://netmflinux.codeplex.com/-4-ğǅ 2011 ó

1.5.

!

$.NET Micro Framework . CodePlex +&&«Ƹ?&5

Apache License 2.0 }G[Y+Ú%

(http://netmf.codeplex.com/license)¶ǁ- Linux 2-ťĲ9Êķ'Ó-Ƹś+&- CodePlex -

NETMF L~XfTeBęàć

Apache License 2.0 }G[YBöżƳŘ>9-(5Ƶ³+ƺ&.

Ƶ³

>.L~XfTeBÂſ+&
OS Facilities ïBĶŰ> TECS (?+Ƭ¹àĥ>Ƶ³+ƺ&.
TOPPERS }G[YBƳŘ>9-(5Y-8ƑÐĂ.ƈÊĤ+\YT(9+Lo\öżY¶ĕ-}G[eBƶñ>(ÆƁ(ſ&5

2. F?2:
+Ó-EGcE-çœ+ƽ&Ąæ&>ƸśĞńBűÁ+ţ52.1.

$!D1

NETMF -le+. ARM RVDS : ARM MDK, HEW Ŭ9´ŘÆƁ' Ó-Ƹś-Ƥġ-$(&Utd-ƒŌ<NETMF -\šũŞŝŘ+TeBƸţ>((u_o}`dmKwTkG}. GCC ŴŻ-ĒŘB¦¨&ĳƖ5YTe. gcc v4.2.1 ƻBUt

-;*TkG}´ŘÆƁ*8d&& Windows '»>

TOPPERS (¬Ʈ-PYTkG}´ŘÆƁ'ĒŘ>PYTkG}-¡ƍ(&ļ-;*9-=5Ƹś]S`dŕÝ+;#&9³>(ÆƁ'

 Cygwin pY-PYTkG}ǆƄ¶'ťĲǇ MinGW pY-PYTkG}ǆƄ¶'ťĲǇ Windows '»>PYTkG}k`Rúƫ>XǎLaunchpad GNU Tools, devkitPro, Yagarto, emIDE, , PizzaFactory,
Mentor Graphics Sourcery Tools / Sourcery CodeBench (Ġ CodeSourcery),* NETMF -leĉǂ'. Windows '»> Visual Studio SDK îMSBuild a:Tueoodǆj`_mDGǇ( VBScript Ŭ- Windows ŕÝÖĩ-YP~od-»ÆĻ'>

8

Ó-Ƹśo}`dmKw(&.

WindowsǆXP ƻǇBêƢ(5Mac OS : Linux Ŭ--ŕÝ'9 NETMF -le+ÿƎ* Windows YP~odçƉŕÝBĶŰ>(+;= NETMF -leÆƁ+*=5Kw'-ƸśŕÝĶŰ.Ĭb

u-Şŝ<ƲƂ>-5-8

?<-o}`dmÓ.ƶĆ5C2.2.

%=+ťĲĴƸãĤŌ' TOPPERS / ASP+TECS ( TINET åæ»&>ŕÝBøǀ
-ťĲ-]8S`d(5ťĲ¨-]Ó.u_o}`dmKw-UtdŞŝ'9>S`d.$+ź=5C*<Ơį(@œĤŌ'ĢŢ+ TINET BUt

ASP+TECS ŕÝƏ$=5C'-o}`dmKwŬçƌ¨]d&> TOPPERS /ú´Ř+*>(-Ŋ9Ì8& œĤŌ'.
S`d-¡ƍ(ſ<?5 Armadillo-800 EVA
 EmDoXIPd AP-SH4A-0A
 LEGO Mindstorms EV3
 EmDoXIPd XG1808ǆ(Ê CPU ĖƨǇ GHI FEZ Hydra ǆNETMF Ũ¤ŉ Open Hardware s cjGYe}GjeǇ

Z E!Kit-BF533ǆTOPPERS/JSP ťĲŉǇ°ŠǉǈE!Kit-BF533

2.3.

807B

+ NETMF B TOPPER +ťĲÜÉ-WYbwª-ĶćĵƎÕBţ5
NETMF Eo~RTOPPERS{{V Eo~R

V{]YPV]YP

W|

W|

{InterOP Class Lib.

V

TinyCLR ]YP]YP

PAL{V]YP{VTINET]YP

TinyCLR

TinyCLR

TinyCLR

IPC]Gu·=Ʃ6]YP]YPie}

Helper ]YPUlYTĎ÷UlYTTOPPERS / ASP ~E]GwMĎ÷UlYThÓƸśƵ³ÕǊǈNETMF - TOPPER 2-ťĲĶćĵƎÕ

-6-

2.4.

'67B

NETMF B TOPPERS +ťĲ>

8-Ĵ.ļ-Ʈ=' leŕÝ-ĶŰTOPPERS -leŕÝBÂſ+&eŕÝBĶŰ5Ê-PYTkG} NETMF Ř-l­ŝ+.ŕÝàě

leYP~od

NETMF Solution mDGProject mDGBć5NativeSample (}Gn}~Áŵ*Ď÷U> various.cpp J}

lYT.

~MYP~odĽ&NETMF -ǆn~`XĺƁǇBUtdō TOPPERS (~P'>(BŢƜ5 OS Facilities ï-ĶŰTECS BŘ& NETMF ¢+ TOPPERS -~\YBĕ> OS Facilities ïBƘƕ Ƹś&Ÿ6Ʃ65 ťĲ+>þŝĴƵ³' NETMF -G]mI

Y. PAL (Platform Abstraction Layer) +ÉA>

8

- OS FacilitiesïcjGYe}Gj-ĺƁB®,£>(+*=5TOPPERS ĕ>~\-4+ h`d-e}Gjï:Ď÷U

Y+.ĸŋŝ+Ut

P W~EtlYTd>]GuŬ-ÈUlYTd GPIO I2C SPI Q}mF`P*)( Flash ROM -©²¸BÌ65

NETMF ¢'. ƸśĤ+?<-3&ÿƎ*ĺƁBÎ0² NativeSample B»&ÈUlYT

(cjGYe}Gj-»Bcj`Qĳƙ5 Helper ]YP-Ƹś
NETMF .ĬĭieHIE'-»B¶ĕ+Ƹś?&>Te-8+

OS 2-ťĲBƉƽ+. ¶ǁ- OS Facilities ï'.ÍÅ'*ƿÊī»BUtd> ŒŪ

Helper ]YPÿƎ' TECS BŘ&?BƸś5

È Helper ]YP NETMF G]o~]- TinyCLR +ĕ>ĺƁ.ļ-Ʈ='
a. TinyCLR IPC ]YP
NETMF E o ~ R

W |  ( TOPPERS ( - Ä Ğ Ë IPC (Inter ProcessCommunication) BUtd5

b. TinyCLR ]Gu]YP
TinyCLR +ê&æīŝ(ƿæīŝ*]GuBUt

d5

c. TinyCLR ·=Ʃ6ie}
TinyCLR +ê&Èŧe}GjBÌ7·=Ʃ6»BUt
 TOPPERS Ď÷UYRXz~QlYTd5

-Ƹś

GC(Garbage Collection)-7-cj`NµüŬ- NETMF -Đ»B

NETMF Eo~Rµü>ĺƁ(TOPPERS Ď÷UlYTW|(ÄĞË~E]GwƮ>ĺƁBBƸś&Ÿ6Ʃ65

 TOPPERS InterOp P}Y}Gn}~ĶŰ
uh

XeTNETMF E o ~ Re'Ɨƫ?

TOPPERS -Ď÷UlYT(ưė>W|¢<Î0²&8-łŘŝ*P}Y}Gn}~B

NETMF InterOp ĺĶB´Ř&çƌ5 cj`QĺƁ-çƌVisual Studio Ũ¤> Windows rYd PC +ê& USBǆťĲ]jGY¢Ǉ W~Et
NETMF Eo~Rd(RS232C)S`dc

LAN(TCP/IP)-ǋŧǄ-Ğõ'ēż&W|-coG(\YTecj`QBUtd> cj`QĺƁBťĲ5 LAN ēż'.ŐŔï+ä+cj`Q'>;+5 CLR »ĳƙ
NativeSample B MSIL G]o~](cj`NG]mIGYB£> TinyCLR+©?Ħ& TOPPERS (¿&le

çƽ+ NETMF Eo~RW|Be&WYbwª-»ĳƙBƉ53. $Óĕı-EGcE-ŅŞŌ.ļ- 3 Ō' Eo~RW|ƹưė u_o}`dmKw

 NETMF veHIE-ņŘ+ÈŅŞŌ-ƚŶBţ53.1.

"%$GC(OS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