Windows Debuging Environment
Visual Studio Code で開発¶
1. Source Tree で履歴を共有¶
1-1. Source Tree のインストール¶
- Sourcetree - 無料の Git & Mercurial クライアント | Atlassian
1-2. ローカルレポジトリの初期設定¶
- mbed レポジトリからクローン
- Source Tree でリモートレポジトリをローカルPCにコピーします。
- リモートレポジトリのURLは、「TTDC」チームの「Code」タブから「switches 」を開くと「Clone repository to desktop:」欄にあります。
- Visual Studio Code の設定
- 除外ファイルの指定
1-3. Source Tree の使い方¶
- 変更をコミット
- mbed レポジトリから他人の変更をプル
- mbed レポジトリへプッシュ
2. Visual Studio Codeでソースを編集¶
2-1. Visual Studio Codeのインストール¶
- Mac OS X, Linux, および Windows で使える軽量、高速な高機能エディター - Microsoft
2-2. Visual Studio Codeでフォルダを開く¶
3. PlatformIO でコンパイルとデバッグ¶
3-1. CMSIS-DAP デバッグ環境のインストール¶
- CMSIS-DAP対応のファームウェアへアップデート
- ファームウェアをダウンロードし、LPC1768 のUSBメモリへコピーして再起動します。
- http://mbed.org/handbook/CMSIS-DAP-MDK
- シリアルドライバのインストール
- CMSIS-DAP対応の mbed Windows serial port driver をダウンロードし、インストールします。
- https://os.mbed.com/handbook/Windows-serial-configuration#1-download-the-mbed-windows-serial-port
3-1. Python 2.7 のインストール¶
- PlatformIO が対応している Python 2.7 をインストール
- Python のバージョンを開発環境ごとに切り替える virtualenv のインストール
python -m ensurepip pip install virtualenv
- virtualenv を開発環境に適用
- Python 2 では、2バイト文字のフォルダ名が認識できないため、英字のフォルダ名を使う事。
cd C:\Work\Training\mbed_LPC1768\switches virturalenv venv
3-2. PlatformIO のインストール¶
- virtualenv の起動
venv\Scripts\activate.bat
- PlatformIO Core のインストール
pip install platformio
3-3. PlatformIO IDE for VSCode のインストール¶
- 拡張機能で PlatformIO IDE for VSCode を検索しインストール。
- PIO Home 画面が追加される。
pio account register pio account login pio account password
platformio lib install MMA7660 platformio lib install C12832
3-4. PlatformIO の新規プロジェクトを作成¶
- プロジェクト名: switches
- Boards :アイコンをクリックし LPC1768 を追加する。
- フォルダ: C:\Work\Training\mbed_LPC1768\
3-5. Visual Studio Code で開発¶
μVision4でデバッグ!2018-03-28¶
https://os.mbed.com/users/MACRUM/notebook/uvision4_debug/
- 評価版(Lite edition)は、作成できるオブジェクトサイズが32kバイトに制限されています。
- switches は 34,732 bytes でリンクエラーになり、デバッグできませんでした。
switches link error
.\BUILD\switches.axf: error: L6047U: The size of this image (34732 bytes) exceeds the maximum allowed for this version of the linker