2015年6月11日木曜日

NUCLEO の mbed プロジェクトを Keil uVison5 で Build Debug

ST micro から発売されている評価基板 NUCLEO-F072RB 、オンボード ST-Link/V2-1 デバッグアダプタ込み、を PCに接続し、ARMmbed で作ったプロジェクトを、フリーの開発がサポートされている Keil MDK-ARM for STM32F0 and STM32L0 に Export し、ソースコードをコンパイル、ビルドし、デバッガが利用できることを確認します。

ARM mbed で Export したプロジェクトを展開し Keil uVison5 で開き、コンパイル、リビルド、デバッグまで行うには、Options for target の 2箇所をマニュアルで調整しなくてはいけませんでした。

Migrate ARMmbed project to Keil uVison5

  • Options for target - Linker - Misc controls
    文字数制限超え
    mbed output over "maximum number of letters" limitation
  • Options for target - Utilities - Configure flash menu command - Settings - Programming Algorithm
    未設定なので STM32F0xx 128kB Flash に設定
    Flash download - need to configure programming algorithm 

mbed で Export したプロジェクトは、Project Open で開き、Version 5形式に変換します。上のボタンで取り込む。

  • Options for target - Linker - Misc controls
    mbed output over "maximum number of letters" limitation

    Misc controls の中身をコピーし、エディタで余計な Space を削除し文字数を減らした後書き戻す。
  1. Options for target - Linker - Misc controls の中身をすべて選択しエディタにコピー
    Select all, copy to text editor.
    Ctrl-A will not work in this text box.
  2. エディタ上で、タブ埋めのスペースを削除する
    Remove extra tab filling spaces to reduce the number of letters
  3. Misc controls にコピーする
    Select all and copy to misc controls text box
    これで、Keil 側の文字数制限にひっかからなくなりました。
この時点で、コンパイルは正常に終了し、 .bin  ファイルが \build フォルダに生成されます。この .bin ファイルをデバッガのフラッシュドライブに転送するとターゲットの書き換えができます。
この状態ではまだ、デバッガの開始に失敗しました。デバッガを正しく動かすには、Flash download tool を正しく設定する必要がありました。
  • Options for target - Utilities - Configure flash menu command
    プログラミングアルゴリズムを追加します。
  1. Options for target - Utilities - Configure flash menu command-setting ボタン。
  2. アルゴリズムを追加します。
  3. ターゲットのアルゴリズムを選択し追加します。
  4. これでデバッガが正しく起動し、Run Stop Step 実行など行えます。
    It works!

念のため、ソースを編集し、リビルド、デバッグ、Run 等行い変更が正しく機能に反映されていることを確認します。



0 件のコメント: