IT Guy

IT、AI / Machine Learning、IoT、Project Management、プログラミング、ITIL等々

展示会 - 日経xTECH EXPO 2018 (2018/10/17 - 10/19)

オフィシャルサイト

expo.nikkeibp.co.jp

展示会

  • エンタープライズICT
  • クラウド Impact
  • Security Solution
  • IoT Japan
  • FinTech & ブロックチェーン
  • 人工知能/ビジネスAI
  • 働き方改革
  • デジタルヘルスDAYS
  • デジタルものづくり
  • 建設テック

出展者一覧

展示会 - CEATEC JAPAN 2018 (2018/10/16 - 10/19)

オフィシャルサイト

www.ceatec.com

展示会

  • A.トータルソリューション
  • B.AI/ビッグデータ/サイバーセキュリティ
  • C.エネルギー/スマートライフ/スマートワーク
  • D.モビリティ/ロジスティクス
  • E.エンターテインメント
  • F.フィットネス/ヘルスケア
  • G.スマートファクトリー
  • H.電子部品/デバイス&装置
  • S.主催者企画/特別テーマエリア

出展者一覧

図解 暗号の用語と仕組み

tech.nikkeibp.co.jp

目次

パスワード暗号化の仕組み、最新の情報漏洩事件で解説

https://tech.nikkeibp.co.jp/it/atclact/active/18/072300002/072300001/?ST=act-security

共通鍵と公開鍵、異なる暗号方式の特徴を押さえる

https://tech.nikkeibp.co.jp/it/atclact/active/18/072300002/072300002/?ST=act-security

インターネット通信の安全を確保、暗号の仕組みを図解

https://tech.nikkeibp.co.jp/it/atclact/active/18/072300002/072300003/?ST=act-security

無線LANの暗号化、混乱しがちな専門用語

https://tech.nikkeibp.co.jp/it/atclact/active/18/072300002/072300004/?ST=act-security

NUCLEO-F302R8 - Hello World Project (Blink)

参考文献

itguy.hatenablog.jp

必要Tool Chain / Tool

  • STM32 CubeMX
  • Keil μVision 4
  • STM32 ST-Link

開発手順

CubeMX

  • CubeMXを立ち上げ「New Project」を選択

  • Board Selectorタブから「NUCLEO-F302R8」ボードを選択 f:id:blog-guy:20180825093423p:plain

  • 「Project」メニューから「Generate Code」を選択 f:id:blog-guy:20180825093534p:plain

  • Project SettingsからProject Name, Project Location, Toolchain/IDE等を選択
    f:id:blog-guy:20180825093826p:plain

  • 「Code Generator」タブから下記のように選択 - 「Copy only the necessary library files」
    f:id:blog-guy:20180825094032p:plain

  • 「OK」をクリック。Code Generationが完了すると下記のメッセージが表示されるはず。
    f:id:blog-guy:20180825094136p:plain

  • 「Open Project」で進む ⇒ これでKeil μVisionが立ち上がるはず。

Keil μVision

最初の設定
  • 「Open Project」からμVisionを立ち上げると、最初に下記のエラーメッセージが出る。
    f:id:blog-guy:20180825094421p:plain

  • Keil μVisionの「File」メニューから「Device Database...」を選択
    f:id:blog-guy:20180825094544p:plain

  • 「Device Database」画面から「STM32F302RB」を選択し、「Close」を選択

コーディング
  • 生成されたコードの中のmain.c (Application/Userの中)は下記の通り。
    f:id:blog-guy:20180825095503p:plain

  • while (1)文に下記のコードを追加

  while (1)
  {

  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */
     HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
     HAL_Delay(500);
  }
  /* USER CODE END 3 */

}
  • 上記のLD2_GPIO_Port、LD2_Pinはmain.hで以下のように定義されている。
#define LD2_Pin GPIO_PIN_13
#define LD2_GPIO_Port GPIOB
Compile / Linking
  • ツールボックスから「Build」を実行
    f:id:blog-guy:20180825100838p:plain

  • 下段の「Build Output」にこのようにCompile、Linkingを行う。

Build target 'Blink_LED1'
assembling startup_stm32f302x8.s...
compiling main.c...
compiling stm32f3xx_it.c...
compiling stm32f3xx_hal_msp.c...
compiling stm32f3xx_hal_tim.c...
compiling stm32f3xx_hal_tim_ex.c...
compiling stm32f3xx_hal_uart.c...
compiling stm32f3xx_hal_uart_ex.c...
compiling stm32f3xx_hal.c...
compiling stm32f3xx_hal_rcc.c...
compiling stm32f3xx_hal_rcc_ex.c...
compiling stm32f3xx_hal_gpio.c...
compiling stm32f3xx_hal_dma.c...
compiling stm32f3xx_hal_cortex.c...
compiling stm32f3xx_hal_pwr.c...
compiling stm32f3xx_hal_pwr_ex.c...
compiling stm32f3xx_hal_flash.c...
compiling stm32f3xx_hal_flash_ex.c...
compiling stm32f3xx_hal_i2c.c...
compiling stm32f3xx_hal_i2c_ex.c...
compiling system_stm32f3xx.c...
linking...
Program Size: Code=4476 RO-data=480 RW-data=16 ZI-data=1136  
FromELF: creating hex file...
"Blink_LED1\Blink_LED1.axf" - 0 Error(s), 0 Warning(s).
  • STM32 ST-Link Utilityアプリケーションを実行
    f:id:blog-guy:20180825101346p:plain

  • 「Target」メニューから「Program & Verify...」を選択
    f:id:blog-guy:20180825101509p:plain

  • File pathからhexファイルを選択し、「Start」をクリック
    f:id:blog-guy:20180825101637p:plain

  • 実行されると、下記のログのあと、NucleoボードのLED LD2が0.5秒間隔で点滅するはず

10:15:20 : ST-LINK SN : 066FFF554857707067053924
10:15:20 : ST-LINK Firmware version : V2J25M13
10:15:20 : Connected via SWD.
10:15:20 : SWD Frequency = 4,0 MHz.
10:15:20 : Connection mode : Normal.
10:15:20 : Debug in Low Power mode enabled.
10:15:20 : Device ID:0x439 
10:15:20 : Device flash Size : 64KBytes
10:15:20 : Device family :STM32F301x4-x6-x8/F302x4-x6-x8/F318xx
10:15:44 : [Blink_LED1.hex] opened successfully.
10:15:44 : [Blink_LED1.hex] checksum : 0x0007A520 
10:16:58 : Memory programmed in 0s and 578ms.
10:16:58 : Verification...OK
10:16:58 : Programmed memory Checksum: 0x0007A520

コード修正

点滅の間隔を0.5s, 2sずつ繰り返すサンプルは下記の通り

#define BLINK_TICKS1  (500)
#define BLINK_TICKS2  (2000)
    
int sw = 1;
while (1)
{
  if(sw) {
    HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
    HAL_Delay(BLINK_TICKS1);
    sw = 0;
  } 
  else {
    HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
    HAL_Delay(BLINK_TICKS2);
    sw = 1;
  }         
}

MinGW (gcc) のインストール (Windows10)

windows.blogo.jp

環境

(2018/08) Windows 10 64 bit

Install / メモ

上記の「MinGW(GCC)のインストール(Windows10)」サイトを参考にインストール

下記の4つをインストール!他のサイト情報だと、「mingw32-base」、「mingw32-gcc-g++」のみで十分というところもあったが、相当色々なエラーで苦労した・・・

  • mingw32-base
  • mingw32-gcc-g++
  • msys-base
  • mingw-developer-toolkit

設定

環境変数Pathに「C:\MinGW\bin」を通しておく

動作確認

gcc確認

コマンドプロンプトから下記を実行

gcc --version

こんな感じでgccのバージョンが表示されればOK。

f:id:blog-guy:20180823220609p:plain

Cコンパイル

下記のhello.cコードを書いてコンパイル

#include <stdio.h>

int main(void) {
    printf("Hello, World\n");
    return 0;
}

コマンドプロンプトから下記のコマンドでhello.cをコンパイルし、実行ファイルhello.exeを生成

gcc -o hello.exe hello.c

f:id:blog-guy:20180823220841p:plain

洋書 - いまどきのCプログラミング

21st Century C

21st Century C: C Tips from the New School

21st Century C: C Tips from the New School

基本セット
  • compiler : gcc
  • gdb, a debugger.
  • Valgrind, to test for C memory usage errors.
  • gprof, a profiler.
  • make, so you never have to call your compiler directly.
ツール
  • pkg-config, for finding libraries.
  • Doxygen, for documentation generation.
  • Editor : emacs, vim, nano
  • IDE : Eclipseでも各ベンダーが出してるIDEでも
  • Autotools: Autoconf, Automake, libtool
  • Git
  • Shell scripts
ライブラリ
  • libaries : libcURL, libGlib, libGSL, libSQLite3, libXML2

Learn C the Hard Way

Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C) (Zed Shaw's Hard Way Series)

Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C) (Zed Shaw's Hard Way Series)

洋書 - Smart Cards, Tokens, Security and Applications

Smart Cards, Tokens, Security and Applications

Smart Cards, Tokens, Security and Applications

  • 2017/5/18 2nd Edition発売

Table of Contents

1 An Introduction to Smart Cards

Keywords

Smart cards, Tokens, Security, Applications, Java, MULTOS, RFID, SIM, ID Contactless, Microprocessor cards, Chip card, Magnetic Stripe card, Memory card, Development, Lifecycle, Tags, IoT, NFC, MIFARE Classic

2 Smart Card Production Environment

Keywords

Card body production, Smart card personalisation

3 Multi-Application Smart Card Platforms and Operating Systems

Keywords

Java card, MULTOS, GlobalPlatform, Smart Card Operating System (SCOS), Multi-application Smart Cards, WfSC, .NET, BasicCard

4 Smart Cards and Security for Mobile Communications

Keywords

SIM, USIM, UICC, R-UIM, SIM toolkit, CAT, STK, JSR177USB, Authentication, Mileage, NFC, Menu, GSM, UMTS, BIP, VAS

5 Smart Cards for Banking and Finance

Keywords

Payment cards, Magnetic stripe cards, EMV, Chip, PIN, Dynamic passcode, CNP, 3D secure, E-commerce, Token authentication

6 Security for Video Broadcasting

Keywords

7 Introduction to the TPM

Keywords

8 Common Criteria: Origins and Overview

Keywords

Smart card, Common Criteria, Security evaluation

9 Smart Card Security

Keywords

Embedded software, Fault analysis, Side channel analysis, Smart card security

10 Application Development Environments for Java and SIM Toolkit

Keywords

11 OTA and Secure SIM Lifecycle Management

Keywords

Over-the-Air(OTA), SIM Application Toolkit SAT/ STK, SIM Lifecycle Management, SIM/ USIM Card, OTA Performance Limitations, Public Land Mobile Network(PLMN)

12 Smart Card Reader and Mobile APIs

Keywords

13 RFID and Contactless Technology

Keywords

14 ID Cards and Passports

Keywords

ID Cards, e-ID, e-Passport, Chip, ICAO, Security, Basic Access Control(BAC), Extended Access Control(EAC), Password Authenticated Connection Establishment(PACE)

15 Smart Card Technology Trends

Keywords

Silicon, Technology, Trends, Memory, Microcontroller

16 Securing the Internet of Things

Keywords

17 MULTOS and MULTOS Application Development

Keywords

18 Trusted Execution Environment and Host Card Emulation

Keywords

Mobile devices, NFC, Security, Trusted Execution Environment(TEE), Secure Element, Platform integrity, Host Card Emulation(HCE), Tokenisation, Secure storage, Secure execution