4
4

More than 5 years have passed since last update.

STM32L152C-DISCOVERY + STM32CubeMX + MDK-ARM Lite で、Lチカをやってみた (その1~ツールの準備)

Last updated at Posted at 2015-04-14

32L152C-DISCOVERY (STM32L152RCT6, ARM-Cortex-M3 32MHz)を買った。

ツールの入手

  1. MDK-ARM (ライセンス情報がないと、32KBまでのコード生成ができるLite版として動作)
    • [Install MDK Verstion 5] => [Download MDK-Core Version 5] => フォームをがんばって記入
    • ファイル: MDK514.EXE (355,626K) Friday, February 13, 2015 MD5: b56f8a94db9f3ac92af4d63a0eceffb7
  2. STM32CubeMX
    • 一番下の |STM32CubeMX | v4.7.0 | Active | [Download] |の Downloadをクリック
  3. STM32 ST-LINK utility (STSW-LINK004)
    • 一番下の |STSW-LINK004| v3.6 | Active | [Download] |の Downloadをクリック

ツールとSTM32L152RC向けパッケージのインストール

  1. MDK-ARM
    1. mdk514.exeを実行。必要なとこにチェック入れたり、入力して Next>>ですすめる。
    2. インストール後、Package Installerが起動する
    3. 右側の Devicesと書かれた下の辺りに、Search:があるので、STM32L152RCとタイプ
    4. 左側の ARM::CMSIS, Keil::MDK-Middlewareの[Update]を Keil::STM32L1xx_DFPの[Install]を押す。
    5. インストールされるのを待つ。 [Up to date]に切り替わる

mdk_uptodate.png

  1. STM32CubeMX
    1. Javaが必要らしいので、その辺はインストールしておく。
    2. SetupSTM32CubeMX-4.7.0.exeを実行。[=>Next]ですすめる。
    3. STM32CubeMXを実行 (デスクトップにショートカットがあるハズ)
    4. メニューHelp => Check for Updates => [Check] => [Close]
    5. メニューHelp => Install New Libraries => Firmware Packege for Family STM32L1 - 1.1.0にチェック入れて、[Install Now] # v1.2.0が最新だが、Generate Codeに対応していない (2015.4.16)

NewLib_STM32L1.png

  1. STM32 ST-LINK utility
    1. zipを解凍して、実行。
    2. ST-Linkのプログラムと、USBドライバなどがインストールされる。
    3. Discoveryのボードと、USBで接続すると、Device Managerに STMicroelectronics STLink dongleが現れる。
    4. ST-Link側のファームウェアのアップグレードをしておく。
    5. プログラムから、STM32 ST-LINK Utilityを起動
    6. [ST-LINK] => Firmware update[Device Connect]を押して、Versionを確認。[Yes]で更新。

ST-Link_Upgrade.png

その2へとつづく...


メモ

STM32L152RCの特徴

Ultra-low-power ARM Cortex-M3 MCU with 256 Kbytes Flash, 32MHz CPU, LCD, USB, 3xOp-amp

32L152C-DISCOVERYの特徴

http://www.st-japan.co.jp/web/jp/catalog/tools/PF258515
ユーザが使えるLED2つ、タッチセンサー/キー, LCDがついてる。LCDは、ポート使いすぎ..
STM32L152CDISCOVERY_LCD.png

  • STM32L152RBT6 (128 KB Flash memory, 16 KB RAM, 4 KB EEPROM) or STM32L152RCT6 (256 KB Flash memory, 32 KB RAM, 8 KB EEPROM) microcontroller in an LQFP64 package
  • On-board ST-Link/V2 with selection mode switch to use the kit as a standalone ST-Link/V2 (with SWD connector for programming and debugging)
  • Board power supply: through USB bus or from an external 3.3 or 5 V supply voltage
  • External application power supply: 3 V and 5 V
  • IDD current measurement
  • LCD
    • DIP28 package
    • 24 segments, 4 commons
  • Four LEDs:
    • LD1 (red/green) for USB communication
    • LD2 (red) for 3.3 V power on
    • Two user LEDs, LD3 (green) and LD4 (blue)
  • Two pushbuttons (user and reset)
  • One linear touch sensor or four touchkeys
  • Extension header for LQFP64 I/Os for quick connection to prototyping board and easy probing

MDK-ARM Lite Editionの制限(32KB以上のプログラムは作れない、って制限)

MDK-ARM Lite Edition

  • Programs that generate more than 32 Kbytes of code and data will not compile, assemble, or link.
  • The debugger supports programs that are 32 Kbytes or smaller.
  • The compiler does not generate a disassembly listing of the machine code generated. The -S, --asm, and --interleave compiler command-line options are disabled. Projects will not compile with Target -> Listing -> C Compiler Listing enabled.
  • The compiler and assembler do not generate position-independent code or data. The --apcs /ropi /rwpi /pic/pid` compiler and assembler command line options are disabled.
  • The assembler and linker create Symbolic Output Format objects which cannot be linked with third-party linker utilities. Fully licensed tools generate standard ELF/DWARF files which may be used with third-party utilities.
  • The linker does not accept scatter-loading description files for sophisticated memory layouts. The --scatter command line option is disabled.
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4