UM-WI-046 Abstract The DA16200 (DA16600) is a highly integrated ultra-low power Wi-Fi system on chip (SoC) that allows users to develop the Wi-Fi solution on a single chip. This document is an SDK guide document intended for developers who want to program using the DA16200 (DA16600) chipset and...
: version files to include when Image created The DA16200 (DA16600) SDK may be provided with different features per customer or per certain applications and Customer/Developer can change the features easily in SDK. All generic features are defined in ~/FreeRTOS_SDK/apps/da16200/get_started/include/user_main/config_generic_sdk.h (the file name...
DA16200 DA16600 FreeRTOS SDK Programmer Guide Figure 1: Eclipse Project Configuration Development Environment The DA16200 (DA16600) FreeRTOS SDK needs the Eclipse IDE . See Section 5.4 and 5.5 of Eclipse installation and Getting Started Guide. Startup Main() After system reboot, the system library invokes function main(). The following steps are run: ●...
Page 10
/* Configure Pin-Mux of DA16200 */ config_pin_mux(); /* Initialize WLAN interface */ wlaninit(); /* Start DA16200 IoT system layer */ user_main(ramlib_ptim_init_status); // USER main The following system initialization is done before applications start: ● Configure H/W and S/W features ●...
DA16200 DA16600 FreeRTOS SDK Programmer Guide Startup System Applications After running the main function, the DA16200 (DA16600) SDK runs applications provided by the system and user defined. Each system application is started by the customer-define features. Figure 3: Applications on Eclipse Project [ ~/FreeRTOS_SDK/core/system/src/common/main/sys_apps.c ]...
If the user wants to modify the system application table, then that is possible but only with the support of a Renesas Electronics engineer. Startup User Applications After running the main function, the DA16200 (DA16600) SDK can run user-written applications. The user applications also run in two parts: ●...
Figure 4: Results of Running the ‘Hello World’ Applications Write User Application The user can add new application codes in the folder ~/FreeRTOS_SDK/apps/da16200/get_started/src/apps and can add a newly written application file in the project such as hello_world.c. See Figure Revision 1.9...
DA16200 DA16600 FreeRTOS SDK Programmer Guide Figure 5: Customer Project in Eclipse IDE The DA16200 (DA16600) SDK provides an interface to add a user application. The interface is designed to create a user thread. For this purpose, define your application with this interface and then a user thread is automatically created and run when the DA16200 (DA16600) starts.
● net_chk_flag [DA16200 (DA16600) feature] Indicate if the software must wait until the network interface is up and running before the user thread runs. If set to 1, the user thread waits until the network interface is up and running. You must set the value to 1 if your program is a network application ●...
Figure 7: Add User Files to the Eclipse Project SDK Compilation After an application is written, right-click on the project DA16200 (DA16600), and then click Build Project. If you compile for the first time, it is recommended to run command Clean first. See...
DA16200 (DA16600) SDK, the QFN-type RTOS image with filename DA16200_FRTOS- GEN01-01-XXXXX-000000.img is created in folder ~/SDK/apps/da16200/get_started/img/. To create a RTOS image for the fcCSP type package with the DA16200 (DA16600) SDK, change the files as shown below, and then follow the SDK Compilation instructions given in Section 1.7.
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide ○ ~/FreeRTOS_SDK/library/liblmac.a.fcCSP_NP → ~/FreeRTOS_SDK/library/liblmac.a ● Compile feature: ○ ~/FreeRTOS_SDK/apps/da16200/get_started/include/user_main/sys_common_features.h #undef __FOR_FCCSP_SDK__ → #define __FOR_FCCSP_SDK__ – – In case of Low-Power: #define __FCCSP_LOW_POWER__ – In case of Normal-Power: #undef __FCCSP_LOW_POWER__ After the compilation and download (see Section 4.5 of for the firmware download), it shows SDK Version information as "V3.2.x.0 CSP LP"...
OTP, and Serial Flash memory. Mask ROM boots the system and starts the Main image. Retention memory is a special memory to preserve the contents when in power save mode. The DA16200 (DA16600) SoC contains 512 kB SRAM. OTP is used to store some permanent information and its size is 8 kB.
The end address shown as 0x000F_DF80 can be changed by the variable size of DATA/BSS but less than 0x0010_0000 (512 kB). Serial Flash Memory Map The DA16200 and the DA16600 FreeRTOS SDK support 4 MB SFLASH only. 2.3.1 DA16200 Table 1: 4 MB SFLASH Map for the DA16200...
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide Peripheral Driver NOTE This document may be updated later with more detailed descriptions when the DA16200 (DA16600) SLR SoC is available. SPI Master 3.1.1 Introduction The SPI master communicates in full duplex mode that uses a master-slave architecture with a single master.
Page 25
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide int SPI_IOCTL(HANDLE handler, UINT32 cmd, VOID *data) Parameter Handler SPI Driver (HANDLE) IOCTL command data IOCTL parameters Return TRUE / FALSE (int) Description SPI_SET_SPEED ● set the target SPI clock SPI_GET_SPEED ● get the current value of SPI clock SPI_SET_FORMAT ●...
3.2.1 Introduction The SPI slave interface enables support to control the DA16200 (DA16600) from an external host. The range of the SPI clock speed is the same as that of the internal bus clock speed. The SPI slave supports both burst mode and non-burst mode. In the burst mode, SPI_CSB remains active from the start to the end of communication.
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide int SDIO_READ_BYTE(HANDLE handler, UINT32 func_num, UINT32 addr, UINT8 *data) data Data pointer count Count of blocks blksz Block size Return If succeeded, return ERR_NONE. 3.3.3 Example Code See Ref. [3]. SDIO Slave 3.4.1 Introduction The GPIO4 and GPIO5 pins are set to SDIO CMD and CLK by default.
3.5.1 I2C Master The DA16200 (DA16600) includes an I2C master module. There are two supportable clock speeds for I2C in the DA16200 (DA16600); standard is 100 kbps and fast mode is 400 kbps. Table 10 shows the pin definition of the I2C master interface in GPIO Pin Configuration.
3.6.1 Introduction The SD/eMMC host interface of the DA16200 (DA16600) provides access to SD or eMMC cards. The SD/eMMC host interface supports a 4-bit data bus with a maximum clock rate of 48 MHz giving a maximum data rate of 24 MB/s (192 Mbps). The SD/eMMC pin mux condition is defined in...
3.8.1 Introduction The DA16200 (DA16600) has Analog-to-Digital Converters (ADC): a four-channel single-end ADC of 12-bit resolution. Analog input is measured by means of 4 pins from GPIO0 to GPIO3, and the pin selection is changed through the register setting. See...
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide 3.8.2 Application Programming Interface Table 18: ADC Interface API Elements HANDLE DRV_ADC_CREATE(UINT32 dev_id) Parameter dev_id Device number to create a handle Return If succeeded, return handle for such device. If failed, return NULL.
Page 39
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide HANDLE DRV_ADC_CREATE(UINT32 dev_id) channel Channel number to read *p_data Buffer block to read p_dlen Number of samples to read with DMA, not buffer length Return If succeeded, return TRUE. If failed, return FALSE.
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide int DRV_ADC_WAIT_INTERRUPT(HANDLE handler, UNSIGNED *mask_evt); *mask_evt Mask for waiting interrupt bit[19] : Interrupt status for Threshold Difference of CHANNEL 3 bit[18] : Interrupt status for Threshold Difference of CHANNEL 2 bit[17] : Interrupt status for Threshold Difference of CHANNEL 1...
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide ● Address-masked byte writes to facilitate quick bit set and clear operations ● Address-based byte reads to facilitate quick bit test operations ● Make a GPIO pin to an interrupt pin possible to be the output signal of PWM [3:0], external Interrupt, SPI_CSB [3:1], RF_SW [1:0] and UART_TXDOE [1:0] on any GPIO pin It provides special functions for GPIO pin use.
HANDLE GPIO_CREATE(UINT32 dev_type) Parameter dev_type Device index Return If succeeded, return handle for the device. If failed return NULL. Description The DA16200 (DA16600) can set GPIO_UNIT_A and GPIO_UNIT_C int GPIO_INIT (HANDLE handler) Parameter handler Device handle Return If succeeded, return ERR_NONE.
Page 43
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide HANDLE GPIO_CREATE(UINT32 dev_type) Description The necessary configuration of GPIO can be set with this function. Commands are as below: ● GPIO_GET_DEVREG = 1, ● GPIO_SET_OUTPUT, // set gpio as an output ● GPIO_SET_INPUT, // set gpio as an input ●...
Sample Code See Ref. [3]. 3.10 UART 3.10.1 Introduction The DA16200 (DA16600) has two UARTs (Universal Asynchronous Receiver-Transmitter), which have the following features: ● Programmable use of UART ● Compliance to the AMBA AHB bus specification for easy integration into SoC implementation ●...
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide ● Supports both RS-232 and RS-485 ● Separate 32x8 bit transmit and 32x12 bit receive FIFO memory buffers to reduce CPU interrupts ● Programmable FIFO disabling for 1-byte depth ● Programmable baud rate generator ●...
This function changes the baud rate of UART during UART operation int UART_IOCTL(HANDLE handler, UINT32 cmd, VOID *data) Parameter handler Device handle Commands are defined in <UART.h> in the DA16200 (DA16600) SDK data Data pointer Return If succeeded, return ERR_NONE.
Page 47
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide int UART_IOCTL(HANDLE handler, UINT32 cmd, VOID *data) Description The user can set the configuration of UART with this function Configurations of UART should be called before the UART_INIT() function. Commands are as below: ●...
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide int UART_READ (HANDLE handler, VOID *p_data, UINT32 p_dlen) Description User can use the UART_SET_RX_SUSPEND ioctl command to set the UART READ operation to suspend or not int UART_WRITE (HANDLE handler, VOID *p_data, UINT32 p_dlen)
3.11 OTP 3.11.1 Introduction The DA16200 (DA16600) includes a one-time electrically field programmable non-volatile CMOS memory. This memory is to protect and manage major information essential for mass production and management of products, such as booting information, MAC address, serial number, and others.
Page 50
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide void otp_mem_close(void) Parameter void void Return void Close the OTP HW Description int otp_mem_read(UINT32 offset, UINT32 *data) offset OTP memory offset (0x00 ~ 0x1FE) Parameter data [out] data pointer of buffer Return OTP_OK if successes...
DA16200 (DA16600) that determines which has the priority over the other. When the priority of the DA16200 (DA16600) is set to be higher than BT/Bluetooth® LE, it ignores iBtAct signal and transmits its packet anyway. When the priority of the DA16200 (DA16600) is set to be lower than BT/Bluetooth®...
_da16x_io_pinmux(PIN_EMUX, EMUX_BT); #endif _da16x_io_pinmux(PIN_FMUX, FMUX_GPIOBT); 3.12.3 SDK Feature Definition The Bluetooth ® LE coexistence feature can be enabled in the DA16200 (DA16600) SDK in the “config_generic_sdk.h” file as following: ● ® 3-Pin Bluetooth LE Coexistence #define __SUPPORT_BTCOEX__ // BT Coexistences ●...
NVRAM The DA16200 (DA16600) has an NVRAM area on the flash memory to store system data and user data. NVRAM has various system configuration parameters to control the Wi-Fi function. Application Programming Interface There are NVRAM items of datatype integer and string.
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide HW Accelerators Set SRAM to Zero 5.1.1 Application Programming Interface Table 30: HW Acc API Elements void da16x_memset32(UINT32 *data, UINT32 seed, UINT32 length) Parameter data Buffer pointer to set seed value to fill...
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide Pseudo Random Number Generator (PRNG) 5.3.1 Application Programming Interface Table 32: PRNG API Elements UINT32 da16x_random(void) Parameter void Return 32 bits random value Description Generates 32 bits random value via HW accelerator 5.3.2 Sample Code #include <hal.h>...
Wi-Fi Interface Configuration The DA16200 (DA16600) SDK defines various parameters for Wi-Fi interface configuration, and they are saved as profiles in the NVRAM. After system reset, the DA16200 (DA16600) reads an existing profile and sets the Wi-Fi interface based on that profile.
Soft-AP PSK to operate (~ 63 letters) DA16X_CONF_STR_COUNTRY Country code (2 or 3 letters, for example KR, US, JP, CH, etc.) defined by ISO 3166-1 alpha-2 standard DA16X_CONF_STR_DEVICE_NAME DA16200 (DA16600) device name (for WPS or Wi-Fi Direct) DA16X_CONF_STR_IP_0 STA interface IP address DA16X_CONF_STR_NETMASK_0 STA interface netmask...
Soft-AP Configuration by Factory Reset Many IoT devices start as a Soft-AP device to operate AP provisioning. The DA16200 (DA16600) has a Factory Reset function to change to Soft-AP mode after the Factory Reset button is clicked. This button is described in the section 4.2 and 4.3 in Ref.
DA16200 DA16600 FreeRTOS SDK Programmer Guide 7.2.2 How to Configure the Soft-AP Interface The DA16200 (DA16600) SDK has the function shown in Table 40 to configure the Soft-AP interface. You can write your own values. This function is invoked when a factory reset is done.
DA16200 DA16600 FreeRTOS SDK Programmer Guide Soft-AP Provisioning Protocol The DA16200 (DA16600) supports the Soft-AP mode for a Wi-Fi interface setup. The provisioning thread automatically runs when the DA16200 (DA16600) starts in Soft-AP mode. See DA16200 (DA16600) Provisioning the Mobile App in Ref. [5].
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide TX Power Table Edit The DA16200 (DA16600) SDK allows users to tune and edit TX Power (per channel) for FCC or country-dependent product customization/optimization. The country code and channels describe in Table Figure 15: TX Power Table NOTE The 2.4 GHz band is divided into 14 channels at 5 MHz intervals centered at 2.412 GHz, starting with channel...
DA16200 DA16600 FreeRTOS SDK Programmer Guide Apply Tuned TX Power to Main Image The following procedure describes how to set the tuned TX power indices to your Main image. 1. In the DA16200 (DA16600) SDK, open ~/FreeRTOS_SDK/core/system/src/common/main/sys_user_feature.c. Figure 16: TX Power Table Source Code The array cc_power_level contains the default values customized for FCC.
Tips Find/Optimize Stack Size for Your Application To check the stack size of the application, the DA16200 (DA16600) has a tool (a console command) called ps that shows the list of threads and the status of each application stack. is a snapshot of command ps when tcp_client_sample.c is run.
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide Appendix A Open-Source License ------------------------------------------------------------------------------------------------------------------- ------------------- Mosquitto 1.4.14 License Eclipse Distribution License 1.0 Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. All rights reserved. Redistribution and use in source and binary forms, with or without modification,...
DA16200 DA16600 FreeRTOS SDK Programmer Guide Appendix B Country Code and TX Power This section lists the country codes that the DA16200 (DA16600) supports and the supported channels of 2.4 GHz bandwidth in the STA and the Soft-AP mode. Country Code and Channels...
Page 70
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide Country Country STA Channels Soft-AP Channels Code “CH” Switzerland 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “CI” Ivory Coast 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “CL” Chile 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “CN” China 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “CO” Colombia 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “CR” Costa Rica 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “CU”...
Page 71
UM-WI-046 DA16200 DA16600 FreeRTOS SDK Programmer Guide Country Country STA Channels Soft-AP Channels Code “HN” Honduras 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “HT” Haiti 1,2,3,4,5,6,7,8,9,10,11 1,2,3,4,5,6,7,8,9,10,11 “HU” Hungary 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “ID” Indonesia 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “IE” Ireland 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “IL” Israel 1,2,3,4,5,6,7,8,9,10,11,12,13 1,2,3,4,5,6,7,8,9,10,11,12,13 “IN” India...
The power table consists of two types, one is for OFDM and the other is for DSSS. DA16200 (DA16600) will refer to the levels either of the cc_power_level table for OFDM mode or the cc_power_level_dsss for DSSS mode.
: #0, #1, #2, #3 → #1, #2, #3, #4 in section 14-Jun-2022 Updated company name of Reference documents Update SFLASH memory map for the DA16200/DA16600in section Updated TX power table programming in Appendix B.2 28-Mar-2022 Updated logo, disclaimer, and copyright.
Page 78
RoHS Compliance Renesas Electronics’ suppliers certify that its products are in compliance with the requirements of Directive 2011/65/EU of the European Parliament on the restriction of the use of certain hazardous substances in electrical and electronic equipment. RoHS certificates from our suppliers are available on request.
Page 79
Renesas disclaims responsibility for, and you will fully indemnify Renesas and its representatives against, any claims, damages, costs, losses, or liabilities arising out of your use of these resources. Renesas' products are provided only subject to Renesas' Terms and Conditions of Sale or other applicable terms agreed to in writing.
Need help?
Do you have a question about the DA16200 and is the answer not in the manual?
Questions and answers