在 Texas Instruments CC3220SF-LAUNCHXL 上下载、构建、刷写并运行 FreeRTOS OTA 演示 - FreeRTOS
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

在 Texas Instruments CC3220SF-LAUNCHXL 上下载、构建、刷写并运行 FreeRTOS OTA 演示

下载 FreeRTOS 和 OTA 演示代码

  1. 浏览至 AWS IoT 控制台,从导航窗格中选择 Software (软件)

  2. FreeRTOS Device Software (Amazon FreeRTOS 设备软件) 下,选择 Configure download (配置下载)

  3. 从软件配置列表中,选择 Connect to AWS IoT - TI (连接到 AWS IoT – TI)。选择配置名称,而不是 Download (下载) 链接。

  4. Libraries (库) 下,选择 Add another library (添加另一个库),然后选择 OTA Updates (OTA 更新)

  5. Demo projects (演示项目) 下,选择 OTA Update (OTA 更新)

  6. Name required (需要名称) 下,输入 Connect-to-IoT-OTA-TI,然后选择 Create and download (创建和下载)

将包含 FreeRTOS 和 OTA 演示代码的 zip 文件保存到计算机上。

构建演示应用程序

  1. 将 .zip 文件解压缩。

  2. 按照 FreeRTOS 入门中的说明进行操作,将 aws_demos 项目导入 Code Composer Studio,为主板配置 AWS IoT 终端节点、Wi-Fi SSID 和密码,以及私有密钥和证书。

  3. 打开 freertos/vendors/vendor/boards/board/aws_demos/config_files/aws_demo_config.h,注释掉 #define CONFIG_MQTT_DEMO_ENABLED 并定义 CONFIG_OTA_UPDATE_DEMO_ENABLED

  4. 构建解决方案,并确保其构建没有错误。

  5. 启动终端模拟器,并使用以下设置连接到主板:

    • 波特率:115200

    • 数据位:8

    • 奇偶校验:无

    • 停止位:1

  6. 在主板上运行项目,确认它可以连接到 Wi-Fi 和 AWS IoT MQTT 消息代理。

终端模拟器在运行时应当显示类似以下内容的文本:

0 0 [Tmr Svc] Starting Wi-Fi Module ... 1 0 [Tmr Svc] Simple Link task created Device came up in Station mode 2 142 [Tmr Svc] Wi-Fi module initialized. 3 142 [Tmr Svc] Starting key provisioning... 4 142 [Tmr Svc] Write root certificate... 5 243 [Tmr Svc] Write device private key... 6 340 [Tmr Svc] Write device certificate... 7 433 [Tmr Svc] Key provisioning done... [WLAN EVENT] STA Connected to the AP: Mobile , BSSID: 24:de:c6:5d:32:a4 [NETAPP EVENT] IP acquired by the device Device has connected to Mobile Device IP Address is 192.168.111.12 8 2666 [Tmr Svc] Wi-Fi connected to AP Mobile. 9 2666 [Tmr Svc] IP Address acquired 192.168.111.12 10 2667 [OTA] OTA demo version 0.9.2 11 2667 [OTA] Creating MQTT Client... 12 2667 [OTA] Connecting to broker... 13 3512 [OTA] Connected to broker. 14 3715 [OTA Task] [prvSubscribeToJobNotificationTopics] OK: $aws/things/OtaGA/jobs/$next/get/accepted 15 4018 [OTA Task] [prvSubscribeToJobNotificationTopics] OK: $aws/things/OtaGA/jobs/notify-next 16 4027 [OTA Task] [prvPAL_GetPlatformImageState] xFileInfo.Flags = 0250 17 4027 [OTA Task] [prvPAL_GetPlatformImageState] eOTA_PAL_ImageState_Valid 18 4034 [OTA Task] [OTA_CheckForUpdate] Request #0 19 4248 [OTA] [OTA_AgentInit] Ready. 20 4249 [OTA Task] [prvParseJSONbyModel] Extracted parameter [ clientToken: 0:OtaGA ] 21 4249 [OTA Task] [prvParseJSONbyModel] parameter not present: execution 22 4249 [OTA Task] [prvParseJSONbyModel] parameter not present: jobId 23 4249 [OTA Task] [prvParseJSONbyModel] parameter not present: jobDocument 24 4249 [OTA Task] [prvParseJSONbyModel] parameter not present: afr_ota 25 4250 [OTA Task] [prvParseJSONbyModel] parameter not present: streamname 26 4250 [OTA Task] [prvParseJSONbyModel] parameter not present: files 27 4250 [OTA Task] [prvParseJSONbyModel] parameter not present: filepath 28 4250 [OTA Task] [prvParseJSONbyModel] parameter not present: filesize 29 4250 [OTA Task] [prvParseJSONbyModel] parameter not present: fileid 30 4250 [OTA Task] [prvParseJSONbyModel] parameter not present: certfile 31 4251 [OTA Task] [prvParseJSONbyModel] parameter not present: sig-sha1-rsa 32 4251 [OTA Task] [prvParseJobDoc] Ignoring job without ID. 33 4251 [OTA Task] [prvOTA_Close] Context->0x2001b2c4 34 5248 [OTA] State: Ready Received: 1 Queued: 1 Processed: 1 Dropped: 0 35 6248 [OTA] State: Ready Received: 1 Queued: 1 Processed: 1 Dropped: 0 36 7248 [OTA] State: Ready Received: 1 Queued: 1 Processed: 1 Dropped: 0 37 8248 [OTA] State: Ready Received: 1 Queued: 1 Processed: 1 Dropped: 0 38 9248 [OTA] State: Ready Received: 1 Queued: 1 Processed: 1 Dropped: 0