

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 限定您的電路板
<a name="freertos-qualification"></a>

## 先決條件
<a name="prerequistes-qualification"></a>

硬體要求：

FreeRTOS AWS IoT 程式庫執行所在的 MCU 型開發板必須具有：
+ 乙太網路、Wi-Fi 或行動連線功能

軟體要求：

*FreeRTOS * [移植指南中的移植流程圖](https://docs.aws.amazon.com/freertos/latest/portingguide/porting-chart.html)可識別任何指定 MCU 型開發板所需的 FreeRTOS AWS IoT 程式庫。最小子集為：
+ FreeRTOS 核心
+ coreMQTT
+ AWS IoT Over-The-Air(OTA)

測試需求：
+ 針對使用 AWS IoT Device Tester for FreeRTOS 定義的[測試](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests) GitHub 儲存庫，驗證 FreeRTOS 程式庫所需的硬體平台特定 APIs 實作。請參閱 [驗證使用 AWS IoT Device Tester (IDT) 移植的 FreeRTOS 程式庫](#qualifying-your-device-idt)。
+  AWS IoT Core 使用 Device Advisor 驗證與 的互通性。請參閱 的步驟 4[驗證使用 AWS IoT Device Tester (IDT) 移植的 FreeRTOS 程式庫](#qualifying-your-device-idt)。

## 建議
<a name="recommendations-qualification"></a>

為了提高安全性，建議您執行下列動作。
+ 為了防止離線或暫時入侵成為永久，請將秘密和登入資料存放在可抵禦實體攻擊的硬體信任根中，例如 [Secure Element](https://wikipedia.org/wiki/Secure_element) 或 Secure Enclave。
+ 為了降低網路[詐騙](https://wikipedia.org/wiki/Spoofing_attack)和[man-in-the-middle](https://wikipedia.org/wiki/Man-in-the-middle_attack)攻擊可能導致未經授權的資料洩露的風險，請針對實作 DHCP、DNS、TCP/IP 和 TLS 等通訊協定的 FreeRTOS 程式庫使用 [True Random Number Generator (TRNG)](https://wikipedia.org/wiki/Hardware_random_number_generator)。如需詳細資訊，請參閱[使用確定性隨機位元產生器產生隨機數字的建議](https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final) (NIST SP 800-90A 頁。

## 資格步驟
<a name="qualifying-your-device"></a>

### 驗證使用 AWS IoT Device Tester (IDT) 移植的 FreeRTOS 程式庫
<a name="qualifying-your-device-idt"></a>

1. 將 FreeRTOS 程式庫移植到您的主機板。如需說明，請參閱 [FreeRTOS 移植指南](https://docs.aws.amazon.com/freertos/latest/portingguide/)。

1. 建立測試專案，並從 [FreeRTOS-Libraries-Integration-Tests](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests) GitHub 儲存庫移植所需的測試。呼叫測試執行器任務 [ RunQualificationTest](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/blob/a8cafefc714cdbb4ee1d0f97c92e9c4cc75059fd/src/qualification_test.c#L52)。
**注意**  
為了獲得良好的開發人員體驗，建議移植 FreeRTOS 程式庫，並使用 IDE 在本機執行對應的個別測試群組來驗證整合。  
測試執行器任務會在個別測試專案或您的示範應用程式專案中執行。

1. 建立 `manifest.yml` 檔案以列出您資格中使用的所有相依性。相依性包括 FreeRTOS 程式庫和測試儲存庫。如需詳細資訊，請參閱 [FreeRTOS 資訊清單檔案指示](afq-checklist-manifest-instr.md)。
**注意**  
IDT `manifest.yml`會使用 來尋找針對特定 FreeRTOS 程式庫版本的完整性檢查所需的相依性，以及設定測試專案來建置、刷新和執行測試二進位檔。  
IDT 不會要求特定的專案結構，並使用 `manifest.yml` 檔案中包含的參考路徑。

1. <a name="qualifying-your-device-da"></a>使用 Device Advisor 驗證 AWS IoT 互通性。

   1. 建立使用相同元件的示範專案，包括 FreeRTOS 程式庫、移植、整合任務，例如上述測試中使用的 OTA。

      若要符合資格，示範應用程式必須提供下列功能：
      + 執行 MQTT 發佈和訂閱主題。
      + 執行 OTA 更新。
      + 建立支援 OTA 更新的開機載入器。使用您自己的開機載入器或 [MCUBoot](https://freertos.org/mcuboot/) 。請參閱 [Labs-FreeRTOS-Plus-MCUBoot](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-MCUBoot)。
**注意**  
[FreeRTOS GitHub](https://github.com/FreeRTOS/FreeRTOS) 儲存庫已預先設定示範個別任務的範例。還有整合的 [coreMQTT 代理程式示範](https://github.com/FreeRTOS/coreMQTT-Agent-Demos)，同時包含 coreMQTT 和 OTA 任務。此外，請參閱 FreeRTOS 精選 IoT 整合，網址為 [資格專案的範例](examples-qualification.md)。

   1. AWS IoT Device Tester 將針對 [AWS IoT Device Advisor](https://docs.aws.amazon.com/iot/latest/developerguide/device-advisor.html) 執行您的示範。資格需要下列 Device Advisor 測試案例。  
**測試案例**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/freertos/latest/qualificationguide/freertos-qualification.html)

1. 從 執行測試 AWS IoT Device Tester 並產生測試報告。
   + IDT 會設定測試，並自動建置和刷新電路板。若要啟用此功能，您必須設定 IDT 在 `userdata.json` 檔案中執行裝置的建置和快閃記憶體命令。請參閱《[IDT for FreeRTOS 使用者指南](https://docs.aws.amazon.com/freertos/latest/userguide/device-tester-for-freertos-ug.html)》中的[設定建置、刷新和測試設定](https://docs.aws.amazon.com/freertos/latest/userguide/lts-qual-steps.html#lts-cfg-dt-ud)。
   + 在 `device.json` 檔案中提供裝置支援的功能，例如連線類型、密碼編譯演算法、IDT 的金鑰佈建方法，以判斷要執行的適用測試。請參閱《[IDT for FreeRTOS 使用者指南》中的在 IDT for FreeRTOS 中建立裝置集](https://docs.aws.amazon.com/freertos/latest/userguide/lts-qual-steps.html#lts-cfg-dt-dp)區。 [ FreeRTOS ](https://docs.aws.amazon.com/freertos/latest/userguide/device-tester-for-freertos-ug.html) 
   + 為 IDT 建立和設定 AWS 您的帳戶，以建立所需的雲端資源。請參閱《[IDT for FreeRTOS 使用者指南》中的建立和設定 IDT AWS 帳戶以建立必要的雲端資源](https://docs.aws.amazon.com/freertos/latest/userguide/lts-qual-steps.html#lts-cfg-aws-afr)。 [ FreeRTOS ](https://docs.aws.amazon.com/freertos/latest/userguide/device-tester-for-freertos-ug.html) 

### 準備提交
<a name="qualifying-your-device-preparation"></a>

1. 撰寫**入門指南**，在您的裝置上執行 MQTT 或 OTA 示範專案。如需說明[，請參閱建立裝置的 FreeRTOS 入門指南](https://docs.aws.amazon.com/freertos/latest/qualificationguide/afq-gsg.html)。

1. 提供威脅建模文件，驗證您是否減輕 *FreeRTOS 移植指南*中[移植 OTA 程式庫](https://docs.aws.amazon.com/freertos/latest/portingguide/afr-porting-ota.html)中所述[AWS IoT 的裝置開機載入器威脅建模](https://docs.aws.amazon.com/freertos/latest/portingguide/afr-porting-ota.html#afr-bootloader)中定義的風險。在 [APN Partner Central](https://partnercentral.awspartner.com) 中提交您的裝置時，此文件必須上傳為支援資產。

1. 提供用於程式碼下載的公有儲存庫。我們建議您提供公司 GitHub 儲存庫連結。

### 提交資格
<a name="qualifying-your-device-submission"></a>
+ IDT 測試報告。
+ AWS IoT Device Advisor 測試報告。
+ 威脅建模文件。
+ 具有下載原始碼的 GitHub 儲存庫。