Movatterモバイル変換


[0]ホーム

URL:


Getting started with the Nordic nRF52840-DK - FreeRTOS
DocumentationFreeRTOSUser Guide
OverviewSet up the Nordic hardwareSet up your development environmentEstablish a serial connectionDownload and configure FreeRTOSBuild and run the FreeRTOS demo projectTroubleshooting

Getting started with the Nordic nRF52840-DK

This reference integration is hosted on the Amazon-FreeRTOS repository which is deprecated. We recommend that youstart here when you create a new project. If you already have an existing FreeRTOS project based on the now deprecated Amazon-FreeRTOS repository, see theAmazon-FreeRTOS Github Repository Migration Guide.

This tutorial provides instructions for getting started with the Nordic nRF52840-DK. If you do not have the Nordic nRF52840-DK, visit the AWS Partner Device Catalog to purchase one from ourpartner.

Before you begin, you need toSet up AWS IoT and Amazon Cognito for FreeRTOS Bluetooth Low Energy.

To run the FreeRTOS Bluetooth Low Energy demo, you also need an iOS or Android mobile device with Bluetooth and Wi-Fi capabilities.

Overview

This tutorial contains instructions for the following getting started steps:

Set up the Nordic hardware

Connect your host computer to the USB port labeled J2, located directly above the coin cell battery holder on your Nordic nRF52840 board.

For more information about setting up the Nordic nRF52840-DK, see thenRF52840 Development Kit User Guide.

Set up your development environment

Download and install Segger Embedded Studio

FreeRTOS supports Segger Embedded Studio as a development environment for the Nordic nRF52840-DK.

To set up your environment, you need to download and install Segger Embedded Studio on your host computer.

To download and install Segger Embedded Studio
  1. Go to theSegger Embedded Studio Downloads page, and choose the Embedded Studio for ARM option for your operating system.

  2. Run the installer and follow the prompts to completion.

Set up the FreeRTOS Bluetooth Low Energy Mobile SDK demo application

To run the FreeRTOS demo project across Bluetooth Low Energy, you need to run the FreeRTOS Bluetooth Low Energy Mobile SDK demo application on your mobile device.

To set up the FreeRTOS Bluetooth Low Energy Mobile SDK Demo application
  1. Follow the instructions inMobile SDKs for FreeRTOS Bluetooth devices to download and install the SDK for your mobile platform on your host computer.

  2. Follow the instructions inFreeRTOS Bluetooth Low Energy Mobile SDK demo application to set up the demo mobile application on your mobile device.

Establish a serial connection

Segger Embedded Studio includes a terminal emulator that you can use to receive log messages across a serial connection to your board.

To establish a serial connection with Segger Embedded Studio
  1. Open Segger Embedded Studio.

  2. From the top menu, chooseTarget,Connect J-Link.

  3. From the top menu, chooseTools,Terminal Emulator,Properties, and set the properties as instructed inInstalling a terminal emulator.

  4. From the top menu, chooseTools,Terminal Emulator,Connectport (115200,N,8,1).

Download and configure FreeRTOS

After you set up your hardware and environment, you can download FreeRTOS.

Download FreeRTOS

To download FreeRTOS for the Nordic nRF52840-DK, go to theFreeRTOS GitHub page and clone the repository. See the README.md file for instructions.

Configure your project

To enable the demo, you need to configure your project to work with AWS IoT. To configure your project to work with AWS IoT, your device must be registered as an AWS IoT thing. You should have registered your device when youSet up AWS IoT and Amazon Cognito for FreeRTOS Bluetooth Low Energy.

To configure your AWS IoT endpoint
  1. Sign in to theAWS IoT console.

  2. In the navigation pane, chooseSettings.

    Your AWS IoT endpoint appears in theDevice data endpoint text box. It should look like1234567890123-ats.iot.us-east-1.amazonaws.com. Make a note of this endpoint.

  3. In the navigation pane, chooseManage, and then chooseThings. Make a note of the AWS IoT thing name for your device.

  4. With your AWS IoT endpoint and your AWS IoT thing name on hand, openfreertos/demos/include/aws_clientcredential.h in your IDE, and specify values for the following#define constants:

    • clientcredentialMQTT_BROKER_ENDPOINTYour AWS IoT endpoint

    • clientcredentialIOT_THING_NAMEYour board's AWS IoT thing name

To enable the demo
  1. Check that the Bluetooth Low Energy GATT Demo is enabled. Go tovendors/nordic/boards/nrf52840-dk/aws_demos/config_files/iot_ble_config.h, and add#define IOT_BLE_ADD_CUSTOM_SERVICES ( 1 ) to the list of define statements.

  2. Openvendors/nordic/boards/nrf52840-dk/aws_demos/config_files/aws_demo_config.h, and define eitherCONFIG_OTA_MQTT_BLE_TRANSPORT_DEMO_ENABLED orCONFIG_OTA_HTTP_BLE_TRANSPORT_DEMO_ENABLED as in this example.

    /* To run a particular demo you need to define one of these. * Only one demo can be configured at a time * * CONFIG_BLE_GATT_SERVER_DEMO_ENABLED * CONFIG_MQTT_BLE_TRANSPORT_DEMO_ENABLED * CONFIG_SHADOW_BLE_TRANSPORT_DEMO_ENABLED * CONFIG_OTA_MQTT_BLE_TRANSPORT_DEMO_ENABLED * CONFIG_OTA_HTTP_BLE_TRANSPORT_DEMO_ENABLED * CONFIG_POSIX_DEMO_ENABLED * * These defines are used in iot_demo_runner.h for demo selection */#define CONFIG_OTA_MQTT_BLE_TRANSPORT_DEMO_ENABLED
  3. Since the Nordic chip comes with very little RAM (250KB), the BLE configuration might need to be changed to allow for larger GATT table entries compared to the size of each attribute. In this way you can adjust the amount of memory the application gets. To do this, override the definitions of the following attributes in the filefreertos/vendors/nordic/boards/nrf52840-dk/aws_demos/config_files/sdk_config.h:

    (For tests, the location of the file isfreertos/vendors/nordic/boards/nrf52840-dk/aws_tests/config_files/sdk_config.h.)

Build and run the FreeRTOS demo project

After you download FreeRTOS and configure your demo project, you are ready to build and run the demo project on your board.

To build and run the FreeRTOS Bluetooth Low Energy demo from Segger Embedded Studio
  1. Open Segger Embedded Studio. From the top menu, chooseFile, chooseOpen Solution, and then navigate to the project fileprojects/nordic/nrf52840-dk/ses/aws_demos/aws_demos.emProject

  2. If you are using the Segger Embedded Studio terminal emulator, chooseTools from the top menu, and then chooseTerminal Emulator,Terminal Emulator to display information from your serial connection.

    If you are using another terminal tool, you can monitor that tool for output from your serial connection.

  3. Right-click theaws_demos demo project in theProject Explorer, and chooseBuild.

  4. ChooseDebug, and then chooseGo.

    After the demo starts, it waits to pair with a mobile device across Bluetooth Low Energy.

  5. Follow the instructions for theMQTT over Bluetooth Low Energy Demo Application to complete the demo with the FreeRTOS Bluetooth Low Energy Mobile SDK demo application as the mobile MQTT proxy.

Troubleshooting

For general troubleshooting information about Getting Started with FreeRTOS, seeTroubleshooting getting started.

Microchip Curiosity PIC32MZ EF
Nuvoton NuMaker-IoT-M487

[8]
ページ先頭

©2009-2025 Movatter.jp