阿甘
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- # ICM_演算法_實驗1 Building in 2024/3/19 --- # 環境建置 * 我的環境 * 作業系統: windows 11 * 處理器: 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz * 目標裝置: stm32f429I-DISC1 ## STM32CubeMX ### 目的 * 由 ST 提供的初始化代碼生成器 ### 安裝步驟 1. 從[官網](https://www.st.com/en/development-tools/stm32cubemx.html)下載最新版本 * 需要登入會員才能下載 ![image](https://hackmd.io/_uploads/HJRZo3IRp.png) 2. 解壓縮後就照步驟安裝即可 ## Windows make ### 目的 * make 是一個工具程式,經由讀取一個叫做 makefile 的檔案,自動化建構軟體 * 因為 windows 沒有自帶 make 工具,因此需要另外安裝 ### 安裝步驟 1. 到 [GNU 的網站](https://gnuwin32.sourceforge.net/packages/make.htm)下載安裝檔 ![image](https://hackmd.io/_uploads/rkF2anUR6.png) 2. 照步驟安裝 * 這時候需要紀錄安裝位置,因為稍後需要設定相關的環境變數 3. 設定環境變數 1 * ```檔案總管 >> 本機(右鍵) >> 內容 >> 進階系統設定 >> 環境變數``` ![image](https://hackmd.io/_uploads/ByLW0hL0a.png) ![image](https://hackmd.io/_uploads/BJIwR2UCp.png) ![image](https://hackmd.io/_uploads/B1StCnIR6.png) 4. 設定環境變數 2 * ```使用者變數 >> path >> 新增 make 的執行檔位置``` 5. 環境變數設定測試。有出現以下文字表示設定成功 ```shell= C:\Users\again>make -v GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-pc-mingw32 ``` ## Arm GNU Toolchain ### 目的 * 一系列用於製作軟體程式的工具。例如:編譯器(arm-none-eabi-gcc)、連結器(arm-none-eabi-ld)等 * 不同的軟體開發需要不同的工具鍊,本篇文章是面向 STM32f4xx 的開發,因此需要的工具鍊為 "Arm GNU Toolchain" * 過去常用的 GNU Arm Embedded Toolchain 已被 Arm GNU Toolchain 取代,並且已經被 Arm 標記為 discontinued ### 安裝步驟 1. 到 [Arm GNU Toolchain 官網](https://gnuwin32.sourceforge.net/packages/make.htm)下載安裝檔並安裝 * 可以選擇使用安裝檔或是使用壓縮檔再移動到 "Program Files (x86)" * ![image](https://hackmd.io/_uploads/rJPTelv0a.png) 2. 設定環境變數 * 就是找到執行檔位置並加入環境變數 3. 環境變數設定測試。有出現以下文字表示設定成功 ```shell= C:\Users\again>arm-none-eabi-gcc -v Using built-in specs. COLLECT_GCC=arm-none-eabi-gcc COLLECT_LTO_WRAPPER=C:/Program\ Files\ (x86)/Arm\ GNU\ Toolchain\ arm-none-eabi/13.2\ Rel1/bin/../libexec/gcc/arm-none-eabi/13.2.1/lto-wrapper.exe Target: arm-none-eabi Configured with: /data/jenkins/workspace/GNU-toolchain/arm-13/src/gcc/configure --target=arm-none-eabi --prefix=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/install --with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --with-isl=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --disable-shared --disable-nls --disable-threads --disable-tls --enable-checking=release --enable-languages=c,c++,fortran --with-newlib --with-gnu-as --with-headers=yes --with-gnu-ld --with-native-system-header-dir=/include --with-sysroot=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/install/arm-none-eabi --with-multilib-list=aprofile,rmprofile --with-libiconv-prefix=/data/jenkins/workspace/GNU-toolchain/arm-13/build-mingw-arm-none-eabi/host-tools --host=i686-w64-mingw32 --with-pkgversion='Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)' --with-bugurl=https://bugs.linaro.org/ Thread model: single Supported LTO compression algorithms: zlib gcc version 13.2.1 20231009 (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) ``` 4. 編譯測試 * 使用從 [jserv 的 stm32f429-lcd-demo 專案](https://github.com/jserv/stm32f429-lcd-demo/tree/master)修改的測試範例 * 編譯成功則顯示 * ![image](https://hackmd.io/_uploads/H18eklwA6.png) * 備註: 主要的修改是根據最新版本的 openocd 修改 makefile ```shell= git clone https://github.com/AgainTW/stm32f429-lcd-demo cd stm32f429-lcd-demo make all ``` ## Openocd ### 目的 * OpenOCD(Open On-Chip Debugger)開源片上調試器,是一款開源軟體,最初是由 Dominic Rath 同學還在大學期間發起的(2005年)專案。 OpenOCD 旨在提供嵌入式設備的調試、系統編程和邊界掃描功能。 ### 安裝步驟 1. 到 [Openocd 官網](https://openocd.org/pages/getting-openocd.html),選擇非官方的二進制檔 * ![image](https://hackmd.io/_uploads/Bkec-lPCa.png) 2. 選擇 win32 的壓縮檔 * ![image](https://hackmd.io/_uploads/r1SeGevRp.png) 3. 將執行檔的位置加入環境變數 * ```..我不知道你放哪裡\xpack-openocd-0.12.0-2-win32-x64\xpack-openocd-0.12.0-2\bin``` 4. 環境變數設定測試。有出現以下文字表示設定成功 ```shell= C:\Users\again>openocd -v xPack Open On-Chip Debugger 0.12.0+dev-01312-g18281b0c4-dirty (2023-09-04-22:32) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html ``` 5. 燒錄測試 ```shell= git clone https://github.com/AgainTW/stm32f429-lcd-demo cd stm32f429-lcd-demo make all make flash ``` ## 小節 * 完成編譯和燒錄測試後,到這邊就差不多完成必要的環境的建置了 * windows 上的 git 是我在很早之前安裝的,網路上應該查的到教學課程,本篇就不另外贅述 --- # 參考 * [HT32 MCU GNU Arm Compiler 使用說明](https://www.holtek.com.tw/webapi/105580/an0611tc.pdf) * [Windows 下构建 STM32 开发环境](https://wangyuyang.me/posts/windows%E4%B8%8B%E6%9E%84%E5%BB%BAstm32%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/#fn:1) * [GNU win32 make](https://gnuwin32.sourceforge.net/packages/make.htm) * [Arm GNU Toolchain Downloads](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) * [jserv: stm32f429-lcd-demo](https://github.com/jserv/stm32f429-lcd-demo/tree/master) * [修改後的測試範例](https://github.com/AgainTW/stm32f429-lcd-demo) * [跟我一起学OpenOCD(一)](https://zhuanlan.zhihu.com/p/41517198)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully