3.1.6 Project Setup - RNWF MCC Melody Library Configuration
- Selecting RNWF module
- Click on Device Resources>Libraries>RNWF module
- Add RNWF from Device Resource to Project Resource as illustrated below
- After adding RNWF to Project
Resources, follow the note from RNWF>Software Settings>Select
UART as below:To follow the configurations mentioned in the above figure (RNWF Select UART), Select UARTx component available in Builder Window and select USART2 from drop-down under UARTx Configurations>Dependency Selector (Scroll to bottom)>UART PLIB Selector as illustrated below:
- Configure UARTx instance
specific TX and RX pins referring host MCU data sheet. Hint will be
generated in the Notifications [MCC] tab about UARTx pin re-mapping as
illustrated below:Note: When using the AVR128DB48 with Curiosity Nano Base for Click boards, configure Port F pins- PF4 and PF5 as UART2 TX and RX pins respectively, as illustrated below:
- Configure UARTx instance
specific TX and RX pins referring host MCU data sheet. Hint will be
generated in the Notifications [MCC] tab about UARTx pin re-mapping as
illustrated below:
-
Using Main PLIB Version
- Use "Main" PLIB v3.1.2 or newer with MCC Melody based RNWF02 v2.0.0 driver, to generate
main.c
appropriately. - Select correct version for the Main PLIB from the drop-down available under the MCC Content Manager and then click Apply as illustrated below
- Use "Main" PLIB v3.1.2 or newer with MCC Melody based RNWF02 v2.0.0 driver, to generate
- For clock Settings – Select Clock Control (CLKCTRL) from Project Resource>System>Clock Control (CLKCTRL). Configure Clock Control as illustrated below:
- Configure MCC Melody based RNWF02 driver for
different services as below:
-
Wi-Fi Settings
Under the Wi-Fi Settings, configure Wi-Fi Modes field by selecting one of the option from available options under the drop-down, as per your application requirements. By default, MCC Melody based Wi-Fi System Service configures DUT for Station mode.
Wi-Fi Station Mode
- SSID: Configure SSID field with Wi-Fi Access Point/Network Name at home or office to connect
- Security Type: Select the appropriate Wi-Fi security protocol from the options available in the Security Type drop-down menu.
- Passphrase: Enter the Wi-Fi Access Point/Network password in the Passphrase field
- Auto Connect: Enables a device to automatically establish a connection to a Wi-Fi network.
- Wi-Fi-Callback Handler: Responsible for configuring the callback function name to manage Wi-Fi service-specific events, such as Wi-Fi STA device connections and disconnections, DHCP resolution, and Wi-Fi scan indications.
- NTP Client: Enabling NTP Client exposes respective client mode configurations. For more details on NTP client and DNS client configurations, refer to the AT Command Specification document available on the RNWF02 Add-on Board Product Page.
Advanced Settings with Station Mode
When the Device Under Test (DUT) is in Wi-Fi "Station Mode," it can be further configured with the following settings if "Advanced Settings" is enabled:
- Country Code (Regulatory Domain/Region): The available options are: i) GEN ii) USA iii) EMEA. By default, "GEN" is selected. However, users will need to utilize the WiFi-Callback Handler to set or configure the Device Under Test (DUT) with the desired regulatory domain
- Channel: the network must reside on (or select ‘0’ for any)
- BSSID: ID of the network to connect
-
Ping: After enabling, user will be prompted to enter a device's IP address to ping
-
Configuring for Power Save Mode, Connection timeout duration and so on.,
- WiFi-BT
CoEx: Implementation of Bluetooth/Wi-Fi coexistence,
compliant with the recommendations in IEEE 802.15.2. For more
details, refer to the AT Command Specification document
available on the RNWF02 Add-on Board Product
Page
-
- CoEx Interface Type: Drop-down to select
Interface type
- 3-wire interface (BT_Act, BT_Prio, WLAN_Act)
- 2-wire interface (BT_Prio, WLAN_Act)
- CoEx Interface Type: Drop-down to select
Interface type
- CoEx WLAN RX over BT: Select to give WLAN RX higher priority
- CoEx WLAN TX over BT: Select to give WLAN TX higher priority
- CoEx
Antenna Mode: Select Co-Ex antenna mode.
Available modes are:
- Dedicated antenna
- Shared antenna
-
Wi-Fi Soft-AP-Mode- SSID: Configure SSID field with a DUT's Soft-AP name - for allowing other third party devices to connect, for example, Laptop(s)/Mobile phone(s)
- Security Type: Select applicable Wi-Fi security protocol from options available under Security Type drop-down
- Passphrase: Enter DUT's Wi-Fi Soft-AP's password in the Passphrase field
- Wi-Fi-Callback Handler: Configures callback function name to handle Wi-Fi service specific events (for example, Wi-Fi STA device connection and disconnection, DHCP resolution, Wi-Fi Scan indication)
-
NTP Client: Enabling NTP Client exposes respective client mode configurations. For more details on NTP client and DNS client configurations, refer to the AT Command Specification document available on the RNWF02 Add-on Board Product Page
Advanced Settings with Soft-AP-Mode
When the DUT is in Wi-Fi "Soft-AP Mode", it can be further configured with the following settings if "Advanced Settings" is enabled:
- Country Code
(Regulatory Domain/Region): Available options are
- GEN
- USA
- EMEA
- Ping: On enabling, user will be prompted to enter a device's IP address to ping
-
Channel: channel on which to set up the DUT’s network/Soft-AP
- WiFi-BT CoEx:
Implementation of Bluetooth/Wi-Fi coexistence, compliant with the
recommendations in IEEE 802.15.2. For more details, refer to the
AT Command Specification document available on the RNWF02 Add-on Board Product
Page
- CoEx
Interface Type: Drop-down to select Interface
type
- 3-wire interface (BT_Act, BT_Prio, WLAN_Act)
- 2-wire interface (BT_Prio, WLAN_Act)
- CoEx WLAN RX over BT: Select to give WLAN RX higher priority
- CoEx WLAN TX over BT: Select to give WLAN TX higher priority
- CoEx
Antenna Mode: Select Co-Ex antenna mode. Available
modes are:
- Dedicated antenna
- Shared antenna
- CoEx
Interface Type: Drop-down to select Interface
type
Wi-Fi Provision Mode:- Provision
Method: provides a drop-down to select Wi-Fi
Provisioning methods, available options are
- Mobile App
- Web Server
- SSID: Configure SSID field with a DUT's Provision mode AP name - for allowing other third party devices to connect, for example, Laptop(s)/Mobile phone(s)
- Security Type: Select applicable Wi-Fi security protocol from options available under Security Type drop-down
- Passphrase: Enter DUT's Wi-Fi Provision mode AP's password in the Passphrase field
- Wi-Fi-Callback Handler: Configures callback function name to handle Wi-Fi service specific events (for example, Wi-Fi STA device connection and disconnection, DHCP resolution, Wi-Fi Scan indication)
- Provision Callback Handler: Configures callback function name for Wi-Fi Provisioning states (Applicable only if selected Wi-Fi Mode is ProvisionMode)
- NTP Client: Enabling NTP Client exposes respective client mode configurations. For more details on NTP client and DNS client configurations, refer to the AT Command Specification document available on the RNWF02 Add-on Board Product Page
Advanced Settings with Provision Mode
When the DUT is in Wi-Fi "Provision Mode", it can be further configured with the following settings, if "Advanced Settings" is enabled:- Country Code
(Regulatory Domain/Region): Available options are
- GEN
- USA
- EMEA
- Ping: On enabling, user will be prompted to enter a device's IP address to ping
- WiFi-BT
CoEx: Implementation of Bluetooth/Wi-Fi coexistence,
compliant with the recommendations in IEEE 802.15.2. For more
details, refer to the AT Command Specification document
available on the RNWF02 Add-on Board Product
Page
- CoEx
Interface Type: Drop-down to select Interface
type
- 3-wire interface (BT_Act, BT_Prio, WLAN_Act)
- 2-wire interface (BT_Prio, WLAN_Act)
- CoEx WLAN RX over BT: Select to give WLAN RX higher priority
- CoEx WLAN TX over BT: Select to give WLAN TX higher priority
- CoEx
Antenna Mode: Select Co-Ex antenna mode.
Available modes are:
- Dedicated antenna
- Shared antenna
- CoEx
Interface Type: Drop-down to select Interface
type
- OTA DFU
Settings
Optionally, users can add, enable and configure SPIx PLIB instance from available "Device Resources" section as SPI Host in SPI Mode 0 to use external Flash for storing OTA firmware image. For host application logs, add and configure additional UARTx PLIB and Driver instance. For more details on configuration of these drivers and PLIBs, follow Builder window in MCC Melody for (AVR128_OTA_demo).
This section allows OTA DFU service configuration as mentioned below:- Enable OTA Configs: Toggle to enable/disable OTA DFU settings. If disabled, OTA system service source and header files will not be generated
- OTA Tunnel Selection: Tunnel to receive the OTA server and Image details. Drop-down to select OTA Tunnel. Currently supports TCP only
- OTA Tunnel Port: Configure OTA server port
- OTA Callback Handler: Configure callback function name to handle OTA service events (for example, downloading firmware binary from OTA server, erasing RNWF Flash before programming it with newly downloaded firmware image from server and perform RNWF Reset/Reboot with new firmware image)
- DFU TX Pin: Configure DFU UART TX pin name
- DFU RX Pin: Configure DFU UART RX pin name
Note: Configure chip-select (CE) for RNWF Flash as illustrated in pin settings (see Figure 3-22)Note: Configure Port E input pin - PE1 as MCLR_N for DFU as illustrated below: - Cloud Configuration
SettingsThis section allows Cloud service configuration as mentioned below:
- Enable Cloud Configs: Toggle to enable/disable cloud configuration settings. If disabled, cloud system service source and header files will not be generated
- Cloud/MQTT Debug Logs: Toggle to enable/disable Cloud/MQTT debug logs
- Cloud URL: Configure Cloud provider endpoint / MQTT Broker URL
- Cloud Port: Configure Cloud/MQTT port
- Azure DPS:
Toggle to enable/disable Azure DPS option (applicable only when
Azure endpoint is used)
- Scope ID: Provide Scope ID from Azure IoT Central portal for registered device
- Device Template: Configure Azure DPS specific device template
Note:'Azure DPS' feature is deprecated in the Melody Based MQTT System service (latest release v2.0.0). It is still available in the Melody Based MQTT System service (release v1.0.0)
- User Name and Password: Configure cloud client credentials
- Client ID: Device ID registered with cloud provider
- MQTT Callback Handler: Configure Callback function name to handle MQTT specific service events (for example, MQTT Client-Broker connection/disconnection, handling periodic/event based telemetry)
- Publish: Toggle to enable/disable MQTT Publish option. If enabled, it offers related configurations such as Publish Topic Name, Pub QoS, Retain Flag.
- Keep
Alive: Toggle to enable/disable Keep Alive MQTT specific
option.
- Keep Alive Interval: Configure the field in the range of 1-1000 (in seconds)
- Subscribe: Toggle to enable/disable MQTT Subscribe option. If enabled, it provides subscribe specific configurations such as Total Subscribe Topics, Table for Subscribe Topics, Sub. QoS
- TLS: TLS
behavior is controlled by setting parameters in a TLS
configuration. Toggle to enable/disable TLS Configuration
option. If enabled, it will further prompt to enter the
parameters, that include:
- Peer Authentication: Toggle to enable/disable authentication of the peer’s certificate chain. With this setting, an appropriate certificate file name must be passed to the Server Certificate parameter.
- Server Certificate
- Device Certificate
- Device Key
- Device Key Password
- Server Name
- Peer Domain Verify: Toggle to enable/disable verification of the peer’s certificate name. With this setting, an appropriate name must be passed to the Domain Name parameter.
- Domain Name
Note:-
Peer Authentication and Peer Domain Verify parameters are part of firmware release
v2.0.0
. As per recommended setting, they are enabled by default. - For more details, refer to the RNWF02 Supplemental User Guide available in the RNWF02 Firmware and Release Notes v2.0.0 on the RNWF02xx Silicon Product Page.
- Net Sock Settings
Figure 3-26. Net Sock Settings Figure 3-27. Net Sock Settings: TLS This section allows Net Sock service configuration as mentioned below:- Enable NetSock Configs: Toggle to enable/disable Net Sock configuration settings. If disabled, Net Sock system service source and header files will not be generated
- Currently, NetSock Service supports 20 Non-TLS and 2 simultaneous TLS socket instances.
- Total Sockets: Configure this field in the range of 1-2.
- Socket Callback Handler: Configure callback function name to handle Net Sock service specific events (for example, Socket connection/disconnection, handling socket read/write events and notifying an error to the application)
- Server/Client Mode Selection: Toggle to ON state will enable Server and toggle to OFF will enable Client mode
- Socket IP Protocol Version: The protocol to use, to open a new socket - IPv4, IPv6 Global/Local
- Server Address: IP/Domain Select: This allows to configure Server address in the form of either IP Address or Domain Name
- Server Domain: Will be visible only if Server Address: IP/Domain Select is toggled ON. This accepts Domain Name
- Server IP and Port: Configure these fields with respective server details
- Protocol:
Drop-down to select an underlying Network Layer protocol.
Available options:
- TCP
- UDP
- TLS: TLS
behavior is controlled by setting parameters in a TLS
configuration. Toggle to enable/disable TLS Configuration
option. If enabled, it will further prompt to enter details as
below:
- Peer Authentication: Toggle to enable/disable authentication of the peer’s certificate chain. With this setting, an appropriate certificate file name must be passed to the Server Certificate parameter.
- Server Certificate
- Device Certificate
- Device Key
- Device Key Password
- Server Name
- Peer Domain Verify: Toggle to enable/disable verification of the peer’s certificate name. With this setting, an appropriate name must be passed to the Domain Name parameter.
- Domain Name
Note:-
Peer Authentication and Peer Domain Verify parameters are part of firmware release
v2.0.0
. As per recommended setting, they are enabled by default. -
For more details, refer to the RNWF02 Supplemental User Guide available in the RNWF02 Firmware and Release Notes v2.0.0 on the RNWF02xx Silicon Product Page.
-