Note: Before getting started with this tutorial, users should familiarize themselves with the DA16200 FreeRTOS Getting Started Guide for the DA16200MOD.
This tutorial is meant to supplement the DA16200 FreeRTOS Getting Started Guide and adapt the information specifically, to our DA16200 boards. The majority of the material in this tutorial, including the installation and examples, are derived from that manual.
Additionally, users should note that the information in this tutorial may become depricated and hyperlinks may break as Dialog/Renesas provides new software releases. Please, refer to the DA16200 product page for the latest updates and resources.
Advanced Software: Novice users, may find the amount information contained in this tutorial somewhat daunting. The SDK and IDE are relatively complex.
System Requirements: The minimum system requirements for the DA16200 FreeRTOS SDK are:
*For more information on the required software, please refer to the DA16200 FreeRTOS Getting Started Guide.
Manufactured by Dialog (a subsidiary of Renesas), the DA16200MOD is a highly integrated ultra-low power Wi-Fi system on chip (SoC). The DA16200 contains a 802.11b/g/n radio (PHY), a baseband processor, a media access controller (MAC), on-chip memory, and a host networking application processor, all on a single silicon die. With multiple sleep modes (down to 0.2 - 3.5 µA), the DA16200MOD perfect for your next IoT project. Additionally, the SoC has full offload capabilities to run the entire networking OS and TCP/IP stack on chip; therefore, an external network processor, CPU, or microcontroller are not required.
Users can utilize the DA16200 FreeRTOS SDK and the Eclipse IDE on either a Windows 10 or Linux computer, to develop their Wi-Fi solutions. This guide will walk users through the download and installation process to get started with the DA16200 FreeRTOS SDK. Then, users will be shown the basic examples for the peripheral pin functions.
To follow along with this guide, we recommend the hardware below. Users will need a DA16200 module and a way to connect it to their computer.
If you're unfamiliar with serial terminals, jumper pads, or I2C be sure to checkout some of these foundational tutorials.
To understand what is a FreeRTOS and how it is involved in the SDK for the Dialog DA16200 module, users will need to familiarize themselves with the fundamentals of operating systems (OS), schedulers, and real time operating systems (RTOS). In this section, a brief overview of these topics is presented below. However, for a more in-depth introduction to real time operating systems and some of the features of FreeRTOS, please check out the Digi-Key video series on RTOS presented by Shawn Hymel (former SparkFun personality):
Digi-Key video series on RTOS (Source: Youtube)
For any operating system (OS), an individual processor core is capable of running only one thread at a time. However, some operating systems implement a scheduler to control its processing resources; where, the scheduler allocates the processing time and priority of tasks executed on the processor's core(s). This allows the OS to create the illusion of running multiple programs simultaneously (i.e. multi-tasking) when the scheduler rapidly switches between the individual processes for each program.
An operating system can be defined by how its scheduler prioritizes program execution. In a real time operating system (RTOS), the scheduler is designed to operate in a deterministic (i.e. predictable) execution pattern. This is ideal for embedded systems, which require a response to events within a specific time frame.
FreeRTOS is a prevalent real-time operating system that is distributed freely under the MIT open source license. It includes a kernel and a growing set of IoT libraries, which are designed to be light enough to run on a resource constrained processor; such as a microcontroller. Currently, the project is maintained by Amazon Web Services (AWS).
FreeRTOS was built with an emphasis on reliability and ease of use.
The DA16200 FreeRTOS SDK is provided and maintained by Renesas. It is a port of FreeRTOS, built specifically to operate on the DA16200 module. Unfortunately, due to the depth of information that can be covered, we won't go into details about the SDK operation beyond basic examples we provide.
For more documentation on FreeRTOS and the DA16200 FreeRTOS SDK, please refer to the resources below:
Users should have already familiarized themselves with the DA16200 FreeRTOS Getting Started Guide. While a majority of the information in this section is already covered in the DA16200 FreeRTOS Getting Started Guide, we have included a few additional details specific to the DA16200 boards in our catalog. Below, are a complete set of instructions for users to download, install, and setup the various programs required for the DA16200 FreeRTOS SDK.
Depending on the board and/or adapter being utilized, users will need to install the appropriate driver for their computer to recognize the serial-to-UART chip on their board/adapter. Most of the latest operating systems will recognize serial-to-UART chip on the board and automatically install the required driver.
To manually install the CH340 driver on their computer, users can download it from the WCH website. For more information, check out our How to Install CH340 Drivers Tutorial.
In order to program their board through the USB-C connection and access the serial debug interface, users will need a serial terminal installed on their computer. We have verified that these emulators, below, support Y-Modem to upload the SDK bootloader and firmware. Users are welcome to use their preferred serial terminal, but we will only provide support with these applications for this tutorial.
For Windows computers, we recommend Tera Term. Please refer to the serial terminal basics tutorial to get started with installing and utilizing Tera Term:
On Linux computers, users should install minicom
.
language:bash
sudo apt install minicom
Once installed, users will need to configure the serial terminal with the following settings for the COM port they are utilizing:
In order to utilize the DA16200 FreeRTOS SDK, users should to program their board with the latest DA16200 FreeRTOS SDK firmware. To download the DA16200 FreeRTOS SDK Image, users will need to register an account first. Then, from the Design & Development tab of the DA16200MOD product page, users can download the:
DA16200_FBOOT-GEN01-01-XXXXXXXXX_W25Q32JW.img
DA16200_FRTOS-GEN01-01-XXXXXXXXX-XXXXXX.img
C:/dialog_sdk
).To download the DA16200 FreeRTOS SDK, users will need to register an account first. Then, from the Design & Development tab of the DA16200MOD product page, users can download the:
For more information on the content of the DA16200 FreeRTOS SDK (i.e. file organization, API, example applications, etc.), please refer to the DA16200 FreeRTOS SDK Programmer Guide.
Users will need to install the xPack Project Manager (xpm), to install the following xPack development tools required to utilize the SDK. Follow the instructions on the xPack website to install the software.
To install the xPack Project Manager (xpm) through Node.js, open a Windows command line or a Linux terminal and enter the following command:
language:bash
npm install --global xpm@latest
In order to compile the code from the SDK, users will need to install the GNU Arm GCC (v10.2.1) cross compiler.
This development tool can be installed as an xPack package through the xPack Project Manager. Once users have installed the xpm, from the section above, open a Windows command line or a Linux terminal and enter the following command:
language:bash
xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@10.2.1-1.1.2
Windows does not include any build tools (i.e. make
) by default; therefore, users should install the Windows Build Tools xPack package.
This development tool can be installed as an xPack package through the xPack Project Manager. Once users have installed the xpm, from the section above, open a Windows command line and enter the following command:
language:bash
xpm install --global @xpack-dev-tools/windows-build-tools
The Eclipse IDE (integrated development environment) is a free and open source development platform that is released under the Eclipse Public License (EPL). The Eclipse IDE will be used to import the DA16200 FreeRTOS SDK into a workspace and build/compile the example projects using xPack development tools.
For more documentation on the Eclipse IDE, please refer to the resources below:
Installation of the Eclipse IDE is simple:
Run the downloaded executable to launch the Eclipse Installer.
On Linux platforms, use the following commands to extract and execute to Eclipse Installer:
language:bash
tar -xvzf eclipse-inst-jre-linux64.tar.gz
cd eclipse-installer
./eclipse-inst
The first time users launch the Eclipse IDE, they be prompted to select a folder for the program's workspace. However, before users can proceed to working on a project, they will need to setup DA16200 FreeRTOS SDK and link the xPack development tools.
Configure the Development Tools:
In order to build the DA16200 FreeRTOS SDK, users will need to configure the Eclipse IDE and link the necessary development tools.
Toolchain
folder points to the where the GNU Arm GCC 10.2.1 toolchain is installed.
C:/Users/<username>/AppData/Roaming/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/<gcc version>/.content/bin
make
; only on Windows), users need to provide the file path to the build tool:
C:/Users/<username>/AppData/Roaming/xPacks/@xpack-dev-tools/windows-build-tools/<Window Build Tools version>/.content/bin
Import the DA16200 FreeRTOS SDK:
<sdk_root_directory>
path length must be less than 70 characters.
Users will also need to import the DA16200 FreeRTOS SDK into the Eclipse IDE:
Extract the SDK zip file; this directory of this folder will be known as the <sdk_root_directory>
.
<sdk_root_directory>
path length must be less than 70 characters.
C:/dialog_sdk
).
<sdk_root_directory>
file path. (Click to enlarge) For Linux systems, certain files used during the build process need to be set as executable. After extracting the SDK files, the <sdk_root_directory>/tools/util
file permissions must be changed by running the set_linux_perm.sh
script in that directory:
language:bash
cd <sdk_root_diretory>/tools/util
chmod 755 set_linux_perm.sh
sh ./set_linux_perm.sh
<sdk_root_directory>
should be imported. This will provide a view into the full SDK source code and will set up the launch and debug configurations required by the SDK.
File
menu select Import
<sdk_root_directory>
directory and then press the Select Folder button.
<sdk_root_directory>
. (Click to enlarge) <sdk_root_directory>
. Select that project and then press the Finish button.
Note: In order to program and debug the DA16200MOD, a J-Link Lite (or higher) programmer is required. Users may also be interested in these J-Link programmers and accessories.
For a comparison of the different J-Link programmer models, please refer to the Segger website.
Below are the minimum requirements to setup the J-Link programmer to be used in the Eclipse IDE for the DA16200 FreeRTOS SDK:
In order to use the J-Link flash loader with the DA16200MOD, users will need to add it to the J-Link software:
JLinkDevices.xml
file.
C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml
Open JLinkDevices.xml
in a text editor and add device entries for the DA16200 to the <DataBase>
section as follows:
language:xml
<DataBase>
<!-- ->
<!-- Dialog Semiconductor ->
<!-- ->
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200_W25Q32JW" Core="JLINK_CORE_CORTEX_M4"
WorkRAMAddr="0x80000" WorkRAMSize="0x00040000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x100000" MaxSize="0x400000"
Loader="Devices/Dialog/DA16200_W25Q32JW.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200.SeggerES.4MB" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x83000" WorkRAMSize="0x00020000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x10000000" MaxSize="0x400000" Loader="Devices/Dialog/ES_DA16200_4MB.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200.SeggerES.2MB" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x83000" WorkRAMSize="0x00020000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x10000000" MaxSize="0x200000" Loader="Devices/Dialog/ES_DA16200_2MB.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200.eclipse.4MB" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x83000" WorkRAMSize="0x00020000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x10000000" MaxSize="0x400000" Loader="Devices/Dialog/DA16200_4MB.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200.eclipse.2MB" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x83000" WorkRAMSize="0x00020000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x10000000" MaxSize="0x200000" Loader="Devices/Dialog/DA16200_2MB.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
</DataBase>
JLinkDevices.xml
file. (Click to enlarge) <sdk_root_directory>/utility/j-link/scripts/flashloader/Devices/Dialog
directory into the directory where the JLinkDevices.xml
is located.
C:\Program Files (x86)\SEGGER\JLink\Devices\Dialog
directory. (Click to enlarge) jlink_path
as the variable name and set the value as the file path to the J-Link software:
C:\Program Files (x86)\SEGGER\JLink
C:\Users\<USER>\AppData\Roaming\SEGGER\JLinkDevices
jlink_path
variable linking to the J-Link software. (Click to enlarge) Note: If users are having trouble locating the flash loader files or modifying the JLinkDevices.xml
file, please feel free to utilize this archived version of the files. These files are meant to be used with:
Follow the instructions below, to utilize the archived files:
j-link_files.zip
zip folder.JLinkDevices.xml
file in the C:\Program Files (x86)\SEGGER\JLink
directory with the extracted file.Dialog
folder into the C:\Program Files (x86)\SEGGER\JLink\Devices
directory.Once the users have linked the J-Link software to the Eclipse IDE, they will need to import the j-link
project to provide an absolute path for the SDK scripts to use. The project can be imported using the Eclipse Project Explorer by navigating to the <sdk_top_directory>/utility/j-link/project/
and then right click on that directory and select Import as Project
.
For more information on utilizing J-Link with the DA16200 FreeRTOS SDK, please refer to the instructions in the <sdk_root_directory>\utility\j-link\scripts\ReadMe.txt
file.
Note: This tutorial assumes that users are already familiar with serial terminals and their use. However, for those of who have never heard of them before, feel free to check our tutorials below:
The serial terminal should be configured with the following settings:
The DA16200MOD can be controlled through the serial debug interface with the available console commands. The console is accessed by connecting the UART0
interface of the DA16200MOD module to a serial terminal on a computer.
Before proceeding further, users will need to update the firmware for the DA16200MOD.
DA16200_FBOOT-GEN01-01-XXXXXXXXX_W25Q32JW.img
DA16200_FRTOS-GEN01-01-XXXXXXXXX-XXXXXX.img
RTOS #0
begins at 0x023000
RTOS #1
begins at 0x1e2000
DA16200 DA16600 FreeRTOS SDK Image <version>
. (Users will need an account to download these files.)
To update the firmware on the DA16200MOD, users will need to connect to the module to a computer through the serial debug interface. From a serial terminal, users will use Y-Modem to upload the updated SDK bootloader and firmware images to the DA16200MOD.
To update the firmware images on the DA16200:
[/DA16xxx]
prompt, enter reset
to access to the MaskROM mode.
[MROM]
prompt, use the loady
command to upload one of the firmware images.
FBOOT
), use the loady boot
or loady 0
command.
FBOOT
image. (Click to enlarge) FRTOS
), use the loady 23000
command (for RTOS #0
).
FRTOS
image. (Click to enlarge) minicom
:
ymodem
from the menu.After the transfer completes, the total size is displayed.
FBOOT
) and the main firmware image (FRTOS
) must be uploaded.
FRTOS
) for a project built with the SDK (no version update), it isn't necessary to upload the second bootloader firmware image (FBOOT
).boot
command at the [MROM]
prompt to restart the firmware.[/DA16200]
prompt, users can return the DA16200MOD to a factory configuration state with the factory
command.
y
to confirm.
*.ttl
file.
The process for uploading new firmware for an SDK project build is a similar method to updating the SDK firmware. Users will need to connect to the module to a computer through the serial debug interface. From a serial terminal, users will use Y-Modem to upload the new firmware image to the DA16200MOD.
[/DA16xxx]
prompt, enter reset
to access to the MaskROM mode.
[MROM]
prompt, use the loady
command to upload one of the firmware images.
FRTOS
), use the loady 23000
command for RTOS #0
.FRTOS
) for a project built with the SDK (no version update), it isn't necessary to upload the second bootloader firmware image (FBOOT
).
FRTOS
image. (Click to enlarge) minicom
:
ymodem
from the menu.boot
command at the [MROM]
prompt to restart the firmware.There are two slots, in which the main firmware image FRTOS
can be stored in the SFLASH memory. These locations are at RTOS #0
(0x23000) and RTOS #1
(0x1e2000). Through the serial debug interface, users can specify which firmware image that the board boots up with.
boot_idx
command
boot_idx 0
- sets RTOS #0
as the firmware to bootboot_idx 1
- sets RTOS #1
as the firmware to bootboot_idx
command, run the reboot
command to boot the firmware that was
selected.Users can erase the firmware from the SFLASH memory. This can be performed through the Net command mode.
[/DA16200] #
prompt, enter net
to enter the NET command mode.[/DA16200/NET] #
prompt, enter the ota_update info
command to display the firmware information from the SFLASH memoryota_update erase_sflash <start> <size>
command to erase a section of the 4MB SFLASH memory.
RTOS #1
section (0x1e2000) with 1078496 bytes of memory, users will use the command ota_update erase_sflash 0x1e2000 1078496
RTOS #1
. (Click to enlarge) To configure the WiFi connection of the DA16200 Thing Plus, follow the instructions below:
[/DA16200] #
prompt, enter setup
.Stop all services for the setting. Are you sure ? [Yes/No] :
.
y
.us
for their country code.1
to configure the DA16200 Thing Plus for station mode.n
to skip this step.y
to confirm the configuration.a
to select an automatic DHCP IP address.y
to confirm the configuration.SNTP Client
and Dialog DPM (Dynamic Power Management)
.
n
for both of these options.Once completed, the DA16200 will automatically reboot. After the splash screen, users should see a statement declaring that the board is in station mode (System Mode : Station Only (0)
), which is eventually followed by a print out of information about the WiFi connection.
Each of the example project directories contain a folder structure, which includes a project
folder with the DA16200 (or DA16600) target folder(s).
GPIO
example application contains both the DA16200
and DA16600
target folders in the example's projects
folder:
/apps/common/examples/Peripheral/GPIO/projects/da16200
/apps/common/examples/Peripheral/GPIO/projects/da16600
To build an example application (or project), users must import them into the Eclipse Project Explorer. Navigate to the specific example project directory, right-click on the DA16200
folder in the project directory, and then select Import as Project.
DA16200
) folder of the example's projects
folder. (Click to enlarge) Once the target project is imported, it will appear in the Eclipse Project Explorer. To build the project, right-click on the imported project folder and select Build Project.
The first time a build process is performed in the SDK, a Generate Configuration window will be displayed automatically to select the flash memory type. Users will need to select the flash memory type and press the Generate button to create the appropriate flash configuration file required to build the firmware.
For the DA16200MOD, users will need to select:
W25Q32JV
4MB
4MB
While the project builds, the following output is displayed in the Eclipse IDE's Console window:
Once complete, there are two firmware images that are generated:
DA16200_FBOOT-GEN01-01-XXXXXXXXX_W25Q32JW.img
DA16200_FRTOS-GEN01-01-XXXXXXXXX-XXXXXX.img
The files are stored in the <sdk_root_directory>/<project_path>/img/
directory.
FBOOT
is the bootloader image which is used to initialize the DA16200 and launch the main firmware.
FRTOS
is the main firmware image which includes the RTOS and user applications.To configure the settings of the WiFi connection, users will need to modify the sample_preconfig.c
file of the SDK from the apps > common > examples > common_config directory.
sample_preconfig.c
WiFi configuration file for the DA16200 FreeRTOS SDK. (Click to enlarge) Users will need to modify the following lines in the file to configure and enable the WiFi connection of the board:
#define SAMPLE_AP_SSID "sparkfun-guest"
#define SAMPLE_AP_PSK "sparkfun6333"
#if 1 // Example ...
To configure the settings of the build version, users can modify the 2nd_major_number.c
file of the SDK from the tools > version directory.
There are two primary methods to update the main firmware (FRTOS
) image, with Y-Modem through the serial debug interface or with a J-Link programmer (debugging probe).
Before proceeding further, users will need to update the firmware for the DA16200MOD.
DA16200_FBOOT-GEN01-01-XXXXXXXXX_W25Q32JW.img
DA16200_FRTOS-GEN01-01-XXXXXXXXX-XXXXXX.img
To update the firmware on the DA16200MOD, users will need to connect to the module to a computer through the serial debug interface. From a serial terminal, users will need to use Y-Modem to upload the updated SDK bootloader and firmware images to the DA16200MOD.
The process for uploading new firmware for an SDK project build is a similar method to updating the SDK firmware. Users will need to connect to the module to a computer through the serial debug interface. From a serial terminal, users will use Y-Modem to upload the new firmware image to the DA16200MOD.
[/DA16xxx]
prompt, enter reset
to access to the MaskROM mode.
[MROM]
prompt, use the loady
command to upload one of the firmware images.
FRTOS
), use the loady 23000
command for RTOS #0
.FRTOS
) for a project built with the SDK (no version update), it isn't necessary to upload the second bootloader firmware image (FBOOT
).
FRTOS
image. (Click to enlarge) minicom
:
ymodem
from the menu.boot
command at the [MROM]
prompt to restart the firmware.Hardware Note: In order to program and debug the DA16200MOD, a J-Link Lite (or higher) programmer (i.e. debug probe) is required. Users may need to solder on a JTAG header to connect a J-Link programmer to their board; an adapter may also be required.
Below are a few examples of J-Link programmers and JTAG accessories from our catalog:
For a comparison of the different J-Link programmer models, please refer to the Segger website.
Software Note: Below are the minimum requirements to setup the J-Link programmer to be used in the Eclipse IDE for the DA16200 FreeRTOS SDK:
To program binaries into a target device, users will need to execute the program_all_jtag_win
script for Windows or the program_all_jtag_linux
script for Linux in the External Tools menu.
Run
menu, select External Tools
(i.e. Run > External Tools).program_all_jtag_win
or program_all_jtag_linux
.
The following scripts are available in the DA16200 FreeRTOS SDK:
erase_all_jtag_win
erase_all_jtag_linux
program_all_jtag_win
program_all_jtag_linux
program_boot_jtag_win
program_boot_jtag_linux
program_rtos_jtag_win
program_rtos_jtag_linux
To start debugging an application, right-click on the project in the Project Explorer and select Debug As > Debug Configurations.
Open the GDB SEGGER J-Link Debugging entry in the list and select one of the three debugging
modes (reboot
, attach
, attach with RTOS info
) and then select Debug.
There are three debug methods supported by J-Link: "reboot", "attach" and "attach with RTOS info" which are defined as follows:
DA16x_Main_Debug (Reboot)
/ Linux_DA16x_Main_Debug(reboot)
DA16x_Main_Debug (Attach)
/ Linux_DA16x_Main_Debug(attach)
Note: Before using Attach
mode, first turn off the watchdog using the sys.wdog off
command as follows:
[/DA16200] # sys.wdog off
DA16x_Main_Debug (attach_with_rtos_info)
/ Linux_DA16x_Main_Debug(attach_with_rtos_info)
There is a third option, however, it does require that the DA16200MOD module be preprogrammed to update its firmware over the air (OTA). Additionally, the firmware updates
This example will demonstrate how to import and build one of the example projects from the DA16200 FreeRTOS SDK. This example will utilize the GPIO example project from the <sdk_root_directory>/apps/common/examples/Peripheral
folder of the SDK (apps > common > examples > Peripheral > GPIO). The example project is written to read and toggle certain GPIO pins.
projects
folder for the GPIO example, from the Peripheral
examples folder of the DA16200 FreeRTOS SDK. (Click to enlarge)
By default, the example project will:
GPIOA0
and GPIOA4
high and low.GPIOA1
.GPIOA2
and GPIOA3
pins will be configured as interrupts:
GPIOA2
will be active low.GPIOA3
will be active high.Below are the prebuilt images for the GPIO example project, using version 3.2.4.0 of the SDK:
Users with the DA16200 Thing Plus, can blink the STAT
LED by modifying the following lines in the peripheral_sample_gpio.c
file in the <sdk_root_directory>/apps/common/examples/Peripheral/GPIO/src
folder:
GPIO_PIN0
with GPIO_PIN11
on lines: 97, 162-163, 170, and 177GPIOA[0]
with GPIOA[11]
on line: 176Users can also make the print outs in the serial debug interface easier to read by replacing low
with low
(add a extra space) to lines 177-179.
peripheral_sample_gpio.c
file and most of the lines to modified in the Eclipde IDE. (Click to enlarge) Once the peripheral_sample_gpio.c
file has been modified to suit the users needs, the example project can be imported and built in the Eclipse IDE. Users can then use the serial debug interface to upload the new firmware to the board. Once users reboot the DA16200MOD module, the new firmware should run automatically.
Users who have the DA16200 Thing Plus and have modified the code to toggle the STAT
LED will see a blue LED blinking at about 1 second intervals.
In the DA16200 FreeRTOS SDK, there is an I2C example project (apps > common > examples > Peripheral > I2C) that will write to and read from an EEPROM. This project is compatible with the Qwiic EEPROM. Below are the prebuilt images for the I2C
example project, using version 3.2.4.0 of the SDK:
After users have imported and built the project from the SDK, they can connect the Qwiic EEPROM and program their board. (No code modifications are necessary for this example project.)
If connected properly, users should see a success message in the serial debug interface after the FRTOS
image has been uploaded. The DA16200MOD will write 32 bytes to the EEPROM and then read the EEPROM to verify the data. The success message is displayed upon verification of the data.
The Simple Network Time Protocol (SNTP) is as an Internet Protocol (IP) used to synchronize the clocks of networks of computers. In the DA16200 FreeRTOS SDK, there is an example project (apps > common > examples > ETC > Cur_Time) to access the Windows SNTP server and return the current time. Below are the prebuilt images for the Cur_Time
example project, using version 3.2.4.0 of the SDK:
Once uploaded, if the WiFi connection has been provisioned, the board will print out the current time at regular intervals. At longer intervals, the current time will be updated from the Windows STNP server.
To build the project, users should modify the following lines of code from the cur_time_sample.c
file:
TEST_SNTP_RENEW_PERIOD
TEST_TIME_ZONE
(-6 * 3600)
represents GMT-6 or GMT (-6 hrs)CUR_TIME_LOOP_DELAY
cur_time_sample.c
file and the lines to modify in the Eclipde IDE. (Click to enlarge) Once the cur_time_sample.c
file has been modified to suit the users needs, the example project can be imported and built in the Eclipse IDE. Users can then use the serial debug interface to upload the new firmware to the board. After users reboot the DA16200MOD module, the new firmware should run automatically. However, if the WiFi settings haven't been provisioned, users will need to configure the WiFi connection before the firmware starts outputting time stamps.
Cur_Time
example after the WiFi has been provisioned. (Click to enlarge) The OTA (over the air) update example, allows users to update the firmware of the board by hosting the FRTOS
image on a server. Through the WiFi connection, the board performs a simple HTTP request for the new firmware image. If the new image meets certain criteria, the board will download the firmware to a FRTOS slot in the SFlash memory and reboot that board to use that image.
Users can find the OTA update example project in the DA16200 FreeRTOS SDK (apps > common > examples > Network > OTA_Update). Below are the prebuilt images for the OTA_Update
example project, using version 3.2.4.0 of the SDK:
To build the project, users should modify the following lines of code from the ota_update_sample.c
file:
#define SAMPLE_UPDATE_DA16_FW
static char ota_server_uri_rtos[256] = "https://sfecdn.s3.amazonaws.com/DA16200_FRTOS-GEN01-01-48589f13c-005000.img";
g_ota_update_conf->auto_renew = 1;
ota_update_sample.c
file and the lines to modify in the Eclipde IDE. (Click to enlarge) Once the ota_update_sample.c
file has been modified to suit the users needs, the example project can be imported and built in the Eclipse IDE. Users can then use the serial debug interface to upload the new firmware to the board. After users reboot the DA16200MOD module, the new firmware should run automatically. However, if the WiFi settings haven't been provisioned, users will need to configure the WiFi connection before the new firmware can be downloaded and updated. The new firmware that is uploaded to the S3 bucket, toggles the GPIO pins, including GPIOA11
for the status LED.
We have also included some troubleshooting tips, below, for issues that users may come across.
Unfortunately, Renesas does not provide support for their SDK on MacOSX computers. Users will need to use a computer with a Windows or Linux operating system.
We have found that users could accidentally upload code, which may not function properly and potentially bog down the serial terminal; impeding it from taking inputs. If this occurs, users will need to use the J-Link programmer to program the module (with "known good" code) through the JTAG pins.
The reset button on this board doesn't cause the module to restart the firmware operation; it is used to reset the DA16200 module to the factory setting/configuration (when held down for +5 seconds). In order to reset the firmware, users can use the following commands in the serial debug interface:
reboot
- This command will cause the module to restart the firmware execution.reset
/boot
reset
- This command will take users to the MaskROM
mode.boot
- From the MaskROM
command mode, this command will cause the module to restart the firmware execution.To get started with the DA16200MOD on RZ/G2L Linux systems using the DA16200/600's Linux driver source code, please refer to the Linux Driver Getting Started Guide
For users who are having issues importing or building a project for one of the application examples, they may need to delete and re-import the DA16200 SDK into the workspace.
In the Project Explorer
tab of the Eclipse IDE,
To utilize example projects that are dependent on a WiFi connection, users will need to configure the WiFi settings:
setup
command.sample_preconfig.c
file of the SDK.iPerf is an open-source, command-line network diagnostic tool. Users might be interested in this tool to perform a throughput test, which measures packet transfer performance. For more details on operating a throughput test, please refer to Section 6.3 of the Getting Started Guide:
With the OTA firmware update example, users may need to erase the firmware or swap which firmware image is currently running.
When utilizing the OTA example, users may need to erase the firmware. This can be performed through the Net
command mode.
[/DA16200] #
prompt, enter net
to enter the NET command mode.[/DA16200/NET] #
prompt, enter the ota_update info
command to display the firmware information from the SFLASH memoryota_update erase_sflash <start> <size>
command to erase a section of the 4MB SFLASH memory.
RTOS #1
section (0x1e2000) with 117268 bytes of memory, users will use the command ota_update erase_sflash 0x1e2000 117268
There are two slots, in which the main firmware image FRTOS
can be stored in the SFLASH memory. These locations are at RTOS #0
(0x23000) and RTOS #1
(0x1e2000). Through the serial debug interface, users can specify which firmware image that the board boots up with.
boot_idx
command
boot_idx 0
- sets RTOS #0
as the firmware to bootboot_idx 1
- sets RTOS #1
as the firmware to bootboot_idx
command, run the reboot
command to boot the firmware that was
selected.During the development process, there may be times when there is an error in the code or a problem downloading the firmware which could cause the DA16200/600 to fail to boot properly.
Please refer to Appendix D of the DA16200 FreeRTOS Getting Started Guide.
In case users lock-up or break the firmware on their board, they can upload these prebuilt images for the DA16200 FreeRTOS SDK (version 3.2.4.0). If the board is locked up, the only way to recover the board is flash the firmware with a J-Link debug probe. Click on the buttons below to download the prebuilt images:
For more on the FreeRTOS and the DA16200 module, check out the links below:
learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado