TinyCLR OSのポーティング

>100 Views

December 16, 17

スライド概要

https://centerclr.connpass.com/event/71414/

profile-image

SeeedKKの中の人。Microsoft MVP for Internet of Things。

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

(ダウンロード不可)

関連スライド

各ページのテキスト
1.

TinyCLR OSのポーティング Takashi Matsuoka

2.

Takashi Matsuoka 2017~ MVP for Windows Development Joined the Seeed K.K. Developing the Wio LTE for Arduino

3.

Raspberry Pi PIC Arduino AVR Mbed C / C++ / JavaScript / Python

4.

C# ???

5.

.NET Micro Framework Interpreter

7.

https://youtu.be/yMGntUwPT1I

9.

Visual Studio Extension (.vsix) Visual Studio 2017 NuGet Libraries (.nupkg) USB FEZ

10.

FEZ • • • • Flash: 0x08000000 GHI Bootloader 0x08004000 Config 0x08008400 TinyCLR Firmware 0x08040000 .NET Application 0x08080000 STM32F401RET6 Cortex-M4 w FPU Flash 512KB RAM 96KB

11.

• ファームウェア書き込み方法が煩雑 • UARTによるVisual Studio接続 NUCLEO-F401REへポーティングに挑戦! FEZ • • • • STM32F401RET6 Cortex-M4 84MHz Flash 512KB RAM 96KB NUCLEO-F401RE • • • • STM32F401RET6 Cortex-M4 84MHz Flash 512KB RAM 96KB

12.

NUCLEO-F401RE FEZ Flash: 0x08000000 0x08004000 0x08008400 Flash: GHI Bootloader <- dfu-util 0x08000000 drive Config TinyCLR Firmware <- XMODEM 0x08040000 0x08040000 .NET Application 0x08080000 TinyCLR Firmware <- Mbed .NET Application 0x08080000

13.

ST-LINK/V2-1 debugger/programmer with USB re-enumeration capability. Three different interfaces supported on USB: mass storage, virtual COM port and debug port • • • Debug port Virtual Com port Mass storage USB • • • Debug port Virtual Com port Mass storage USB ST-LINK/V2-1 SWD UART NUCLEO-F401RE SWD UART NUCLEO-F401RE

14.

http://docs.ghielectronics.com/tinyclr/porting/intro.html • • • • • Install the GCC. (6-2017-q2-update) Clone the TinyCLR-Ports repo. (https://github.com/ghi-electronics/TinyCLR-Ports) Copy and unzip the Arm CMSIS pack. Copy and unzip the TinyCLR OS Core. Run the build.bat. Build time: 00:10.57

16.

BuildConfiguration.txt FEZ コンフィグ領域削除 NUCLEO-F401RE

17.

Scatterfile.gcc.ldf FEZ コンフィグ領域削除 NUCLEO-F401RE 割当アドレス変更

18.

Device.h FEZ コンフィグ領域削除 NUCLEO-F401RE デバッグインターフェース変更

19.

ぜんぜん動かんorz

20.

FEZ NUCLEO-F401RE クリスタルが無い!

21.

Device.h FEZ NUCLEO-F401RE STM32F407G-DISC1 外部クリスタルから内蔵クリスタルに変更

22.

デバッガーと繋がらない

23.

Visual Studio 2017 Visual Studio Extension (.vsix) COM STLink Virtual COM Port USB STLink UART(PA2/PA3) STM32F401 FTDI Virtual COM Port USB

24.

Visual Studio 2017 Parityを明示的に設定していない Visual Studio Extension (.vsix) COM STLink Virtual COM Port USB STLink UART(PA2/PA3) STM32F401

25.

https://forums.ghielectronics.com/t/uart-debugport-via-stlink-virtual-com-port/20568

27.

DEMO

29.

NEXT PORTING Wio LTE JP Version • • • • • NUCLEO-F401RE • STM32F401RET6 • Cortex-M4 84MHz • Flash 512KB • RAM 96KB STM32F405RG Cortex-M4 168MHz Flash 1MB RAM 192KB with LTE module mbedRO359B • • • • • K24F Cortex-M4 120MHz Flash 1MB RAM 256KB with Wi-Fi module

30.

STM32F401RET6 (NUCLEO-F401RE) STM32F405RG (Wio LTE)

31.

STM32F401RET6 (NUCLEO-F401RE) K24F (mbedRO359B)

32.

LED制御はC/C++で実装 → C#からC/C++の呼び出し(Interop)

33.

Native Interops in TinyCLR C# class Generate stubs GCC C function ptr Native Bin RLI region C function Binary Resource Flash: TinyCLR Firmware RAM: RW Data Heap .NET Application Native Bin Native Bin Stack RLP

34.

Native APIs in TinyCLR Flash: TinyCLR Firmware RAM: RW Data Heap Native Interops .NET Application Native Bin Native Bin Stack Flash: TinyCLR Firmware Native APIs Custom Code RAM: RW Data Heap .NET Application Custom Library Stack RLP

39.

まとめ

40.

• NETMFの縮小版 • Visual Studio 2017対応 • 3つのファイルでポーティング(STM32F4) • ポーティングのデバッグ大変 • C/C++を呼び出し可能 • VS2017 15.5は運用回避