AT Attention
PC Personal Computer
SDK Software Development Kit
UART Universal Asynchronous Receiver-Transmitter
USB Universal Serial Bus
WMM Wi-Fi Multimedia
HTTP Hypertext Transfer Protocol
FW Firmware
URL Universal Resource Locator
COM Communication Port
MCU Micro Controller Unit
CMD Command
DPM Dynamic Power Management
NVRAM Non-Volatile RAM
RTC Real Time Clock
MQTT Message Queuing Telemetry Transport
DHCP Dynamic Host Configuration Protocol
TIM Traffic Indicator Map
WLAN Wireless Local Area Network
STA Station
ICMP Internet Control Message Protocol
OTA Over the Air
SNTP Simple Network Time Protocol
IP Internet Protocol
CA Certificate Authority
MAC Medium Access Control
PBC Push Button Connection
WPS Wi-Fi Protected Setup
AP Access Point
SSID Service Set Identifier
WPA Wi-Fi Protected Access
IEEE Institute of Electrical and Electronics Engineers
RTS Request to Send
WEP Wired Equivalent Privacy
QoS Quality of Service
CRC Cyclic Redundancy Check
SLIB System Library
RTOS Real Time Operating System
TCP Transport Control Protocol
UDP User Datagram Protocol
CID Client ID
LMAC Low MAC
RX Receive
TX Transmit
CW Continuous Wave
PER Packet Error Rate
SPI Serial Peripheral Interface
OTP One Time Programmable memory
ASCII American Standard Code for Information Interchange
XTAL Crystal
GPIO General Purpose Input Output
TLS Transport Layer Security
2 References
[1] DA16200 EVK User Manual, Dialog Semiconductor.
The DA16200 AT Command is a command to control smart modem products of Hayes
Microcomputer and other compatible modems. AT Command is applied to almost all standardized
modems that are available at present. The original title is Hayes Command and is also called AT
Command since the command begins mostly with AT. AT is an abbreviation of "attention”, which
means to take note of or fix one's sight upon something. An example of an AT Command is ATZ. With
this command the modem becomes initialized and returns to a state with no command input.
Hayes Command has a quite simple command structure of AT+Command. This is convenient as you
can just put any desired command right after AT, even more than one command in a row.
Most of the Hayes Modem Commands have a command right before AT except “+++”, which is an
independently used command. You may put a series of commands together whether they contain a
capital letter, a small letter, or a blank.
4 AT Command Development Environment Configuration
4.1 How to Connect the DA16200 Board
This section describes the installation procedure for the drivers, the configuration of the serial port,
and all necessary steps to set up and check the connection with the PC.
On first connection to a host PC with Microsoft Windows as operating system, the system will detect
several devices and will automatically install all necessary drivers. If the driver is not automatically
installed, then get the driver from the following URL:
There are two virtual COM ports created by the Windows driver. The first COM port (lower number,
COM35 in Figure 2) provides a UART interface for debugging or firmware download between the PC
and the DA161200. The second (higher number, COM70 in Figure 2) is used for AT COMMAND as
shown in Figure 2.
Figure 2: Check COM Ports on Device Manager
4.2 Configure the Serial Port for UART
On a Windows Host, the utility Tera Term is used to connect to the DA16200 EVK [1].
Tera Term is a free terminal emulator (communication program) that supports multiple
communication including serial port connections.
1. Download Tera Term from https://ttssh2.osdn.jp/.
2. Run the teraterm-x.yy.exe.
3. Follow the installation wizard.
To make sure that the communication between the DA16200 EVK and the host PC is established
correctly, check the UART connection between the two nodes. Do the following steps:
1. Use a USB cable to connect the DA16200 EVK to the PC.
2. Make sure that the PC discovered the two serial ports in Windows Device Manager as shown in
Figure 2. The higher COM port number is connected to UART1.
3. Open Tera Term from the Windows Start menu.
4. In the Tera Term: New connection dialog:
a. Select Serial.
b. Select the COM Port to use.
c. Click OK.
Depending on the application, an MCU may want to be in the SLEEP state while the DA16200 is in
the Sleep mode and wake up when the DA16200 wakes up from DPM Sleep.
To use the MCU wakeup feature, connect pin GPIO_11 of the DA16200 to an MCU PIN that is used
for wakeup. Then, when the DA16200 wakes up, GPIO_11 is put in the Output mode and set to High
(Active High). The wakeup PIN of MCU should be configured to detect the rising edge of GPIO_11
for wakeup.
Basic response gives the command result and is accompanied by a carriage return and a line feed.
<CR><LF>+INIT:WAKEUP,<type><CR><LF>
●Normal response
<CR><LF>OK<CR><LF>
●Error response
<CR><LF>ERROR:<error code><CR><LF>
●Extended response
Extended response gives the command setting values and is followed by basic response.
<CR><LF>+XXX:[value1],[value2],…
<CR><LF>OK<CR><LF>
NOTE
When an MCU (AT-CMD Host) waits for a response of a command (for those commands that give extended
response as well) to take the next action, it should wait for both normal response (OK/ERROR) and extended
response (also known as Operation Result).
Note the following expected operation of DA16200 by running
this command:
● DA16200 is restarted if AT command format is OK
○ +INIT:DONE,0 message is sent when DA16200 boots up
○ If usage of the AT command is not valid, then DA16200
sends ERROR message without restarting
●DA16200 tries to connect to the AP if Wi-Fi connection
information is stored in NVRAM
○+WFJAP:0 or +WFJAP:1,'<SSID>',<IP Address> as
result of Wi-Fi connection
○If Wi-Fi connection information such as SSID and key is
NOT stored correctly in the DA16200 NVRAM, then
+WFJAP:x response is NOT sent
●If MQTT is configured, DA16200 tries to connect to the
MQTT broker after Wi-Fi connection is established. The
Operation Result – +NWMQCL:0 or +NWMQCL:1 – is sent
over UART1 as a result
● DA16200 operates DPM if it is set to 1 (TRUE)
○ If Wi-Fi connection is NOT established, then DA16200
enter an abnormal DPM operation
○** Abnormal DPM: While DA16200 operates in DPM
sleep, DA16200 executes an Abnormal DPM mode if
DA16200 is disconnected from the home AP for some
reason. Abnormal DPM works like this: if DA16200 is
woken up by the Abnormal DPM RTC timer, DA16200
tries to connect to the specified AP within a predefined
period and sleeps again for a predefined time. The
DA16200 library provides default predefined values for
Abnormal DPM, but users can modify the relevant
parameters based on their application
○If the Wi-Fi connection is established and MQTT
connection is NOT established (if MQTT is enabled),
DA16200 tries to connect to the MQTT broker several
times and enters DPM mode (sleep) based on MQTT’s
abnormal DPM operation
AT+DPMKA <period> Set DPM keepalive period.
<period>: Keepalive period (millisecond, 0 ~ 600000).
Response: OK or ERROR
For example: AT+DPMKA=30000
AT+
DPMTIMWU
AT+
DPMUSERWU
AT+
CLRDPMSLPEXT
<count> Set DPM TIM wakeup count.
<count>: TIM wakeup count (1 ~ 65535).
Response: OK or ERROR
For example: AT+DPMTIMWU=10
<time> Set DPM user wakeup time.
<time>: User wakeup period (second, 0 ~ 86400).
Response: OK or ERROR
For example: AT+DPMUSERWU=3600
(none)
Set the user application not to enter DPM sleep in case of
external wakeup. The AT command host system should execute
this command within 200 ms after waking up the DA16200 with
the external wakeup pin, otherwise, the DA16200 will go into
DPM sleep.
Set the user application ready to enter DPM sleep in case of
external wakeup. After an external wakeup pin wakes up the
DA16200, the AT command host system should execute this
command after the jobs are finished.
Response: OK or ERROR
Set the user application ready to enter DPM Sleep 2 mode in
case of external wakeup. After an external wakeup pin wakes up
DA16200, the AT command host system should execute this
command after the jobs are finished.
<period>: wakeup timeout, in second(s)
<retain_dpm_memory>: 1 (retain), 0 (not retain)
Response: OK or ERROR
For example: AT+ SETDPMSLP2EXT=5,1 // wakeup in 5
seconds after DPM Sleep 2. During DPM Sleep2, DPM memory
is retained.
Notify that the MCU wakes up completely. After this command is
received, DA16200 starts to send messages to the MCU (that is,
MCU should send this command immediately after executing
“External wakeup”.)
Response: OK or ERROR
Table 3: Initiation Response List
Response Parameters Description
+INIT DONE,<mode> DA16200 boot is complete.
<mode>: 0 (STA), 1 (Soft-AP)
For example: +INIT:DONE,0
WAKEUP,<type> DA16200 wakeup is complete from DPM SLEEP state.
AT+WFMAC <mac> Write user MAC address in the NVRAM.
?
(none)
AT+WFSPF <mac> Write spoofing MAC address in the NVRAM.
AT+WFOTP <mac>
AT+WFSTAT (none) Get Wi-Fi configuration.
AT+WFPBC (none) Run WPS PBC method.
AT+WFPIN <pin> Run WPS PIN method.
(none)
? Get the current PIN.
Response: +WFMODE:<mode>
The last digit should be an even number.
Response: OK or ERROR
For example: AT+WFMAC=EC:9F:0D:90:00:48
Get the current MAC address of the activated WLAN
interface.
DA16200 provides three types of MAC address (OTP
MAC address, user MAC address, and spoofing MAC
address). The priority is in the following order: Spoofing,
User, OTP.
Response: +WFMAC:<mac>
The last digit should be an even number.
Response: OK or ERROR
For example: AT+WFSPF=EC:9F:0D:90:00:48
Write MAC address in the OTP memory. An old MAC
address in the OTP will be invalidated if it exists. (There
are four MAC address slots available in OTP. So, there
is the possibility to write only four MAC addresses in
total at production.)
Response: OK or ERROR
For example: AT+WFOTP=EC:9F:0D:90:00:48
The last hex of <mac> should be an even number.
The MAC address written in the OTP is used as WLAN0
MAC address and then WLAN’s MAC+1 will be used as
WLAN1 MAC address.
If <key> exists, then security protocol is WPA+WPA2
and encryption is TKIP+AES.
if <key> is omitted, then security protocol is OPEN.
<ssid>: AP SSID.
<key>: Passphrase.
Response: OK or ERROR
For example:
AT+WFJAPA=DA16200_OPEN
AT+WFJAPA=DA16200_WPA,12345678
AT+WFJAPA='SSID,COMMA','pass'phrase'
?
(none)
Get the current AP information. (SSID and Passphrase
only.)
Operation Result:
+WFJAP:1,'<SSID>','<IP_ADDRESS>'
If Wi-Fi connection is established successfully:
<SSID>: The SSID is surrounded by single quotation
mark
<IP_ADDRESS>: The assigned IP address and format is
xxx.xxx.xxx.xxx
+WFJAP:0
If Wi-Fi connection is NOT established, then depending
on the network condition, it may take more time to get an
Operation Result due to internal connection retrials.
The host should wait for both command response OK or
ERROR and for Operation Result.
This means that the host should wait for
+WFJAP:1,'<SSID>',<IP Address> and OK.
No system reboot happens after running this command.
AT+WFCAP (none)
Connect to an AP with the current WLAN0 interface
configuration.
Response: OK or ERROR
AT+WFQAP (none) Disconnect from the currently associated AP.
The result of AP connection in STA mode. (The result of
AT+WFJAP or AT+WFJAPA or AT+WFCAP.)
<result>: 0 (failed), 1 (succeeded).
<ssid>: SSID of the AP when succeeded.
<ip>: IP address of the station when succeeded.
+WFJAP <result>,<ssid>,<ip>
+WFDAP <reserved>
+WFCST <mac>
+WFDST <mac>
For example:
+WFJAP:0
The Wi-Fi connection is not established.
+WFJAP:1,'ap_test',192.168.0.10
The Wi-Fi connection is established, and the assigned IP
address is 192.168.0.10.
Disconnected from the AP.
<reserved>: 0
For example: +WFDAP:0
A Wi-Fi station connected in Soft-AP mode.
<mac>: MAC address of the connected station.
A Wi-Fi station disconnected in Soft-AP mode.
<mac>: MAC address of the disconnected station.
8.1 Wi-Fi Function Commands for WPA3
You can configure DA16200 as WPA3 Station or WPA3 Soft-AP with a special DA16200 SDK where
WPA3 feature is enabled. By default, WPA3 is not enabled in DA16200 Generic SDK. Please ask
Dialog if you need this specific SDK.
Syntax of all the Wi-Fi function commands are the same as described in Table 6apart from the
following commands where you need to specify WPA3 specific parameters.
Table 8: List of WPA3-relevant Wi-Fi Function Commands
<SSID>: The SSID is surrounded by single quotation
mark.
<IP_ADDRESS>: The assigned IP address and format
is xxx.xxx.xxx.xxx
+WFJAP:0
If Wi-Fi connection is NOT established, then depending
on the network condition, it may take more time to get
an Operation Result due to internal connection retrials.
The host should wait for both command response OK or
ERROR and for Operation Result.
This means that the host should wait for
+WFJAP:1,'<SSID>',<IP Address> and OK.
No system reboot happens after running this command.
Run MQTT Client with options. After entering this command,
system will reboot automatically. At reboot, DA16200 tries to
connect to the MQTT broker after the Wi-Fi connection is
successfully established.
+NWMQCL <result> The result of MQTT client connection.
<result>: 0 (disconnected), 1 (connected)
For example:
+NWMQCL:1
If MQTT connection to the MQTT broker is successfully
established.
+NWMQCL:0
If MQTT connection is NOT successfully established.
Until you get an Operation Result, it may take more time if the
DA16200 connection retrial happens depending on your test
network condition.
Expected result after AT+NWMQTT is run or if any MQTT
configuration command is run and then the system is restarted.
1. DA16200 restarts if the AT command format is OK.
a. +INIT:DONE,0 message is sent as DA16200 boots up.
b. If usage of the AT command is not valid, DA16200
sends ERROR message without restarting.
2. DA16200 tries to connect to the AP after the reboot.
a. +WFJAP:0 or +WFJAP:1,'<SSID>',<IP Address> as
result of the Wi-Fi connection.
b. If the Wi-Fi connection information such as SSID or key
is NOT stored correctly in the DA16200 NVRAM,
+WFJAP:x response is NOT sent and the MQTT
connection is NOT attempted as well. Because the
MQTT connection needs successful Wi-Fi connection
first.
3. DA16200 tries to connect to the MQTT broker after the WiFi connection is established. The MQTT broker information
is stored in NVRAM. Connection result – +NWMQCL:0 or
+NWMQCL:1 – is sent over UART1 as a result.
Figure 5: Example Sequence to Initiate MQTT Protocol with DPM
Figure 5is an example sequence to initiate the MQTT protocol with DPM in the DA16200.
In the normal BOOT state, connect to an AP (AT+WFJAPA) and change the DA16200 run mode to
DPM mode (AT+DPM=1). To configure the MQTT connection information, enter command
AT+CLRDPMSLPEXT and type the following as an example:
Figure 6shows the procedure to send an MQTT message in Sleep mode.
When MCU wakes up the DA16200, the response +INIT:WAKEUP,EXT is sent. The MCU sends the
command AT+MCUWUDONE to inform that MCU is ready to operate. To prevent that the DA16200
enters DPM Sleep mode, MCU should send command AT+CLRDPMSLPEXT before an MQTT
PUBLISH is sent. To make the DA16200 enter DPM Sleep mode again, send a PUBLISH with
command AT+NWMQMSG, and then enter command AT+SETDPMSLPEXT.
Figure 7shows the procedure to process an MQTT message received while in Sleep mode.
When the DA16200 wakes up by a PUBLISH message from an MQTT broker, the response
+INIT:WAKEUP,UC is sent. The MCU sends the AT+MCUWUDONE to inform that it is ready to
operate. Next, the DA16200 sends the received PUBLISH to the MCU and enters DPM Sleep mode
again.
9.1.4 MQTT Example: Changing Subscription Topic when Running
Let's assume that the Wi-Fi/MQTT connection is configured properly and DPM is set to 1 (TRUE).
Below is the recommended sequence. Note that the double quotation marks are used.
A. Trigger RTC_WAKE_UP Event (by MCU)
B. Wait for "+INIT:WAKEUP,EXT" Response
C. Run "AT+CLRDPMSLPEXT" command
D. Wait for "OK" response
E. loop running "AT+NWMQCL=?"
E.1 if responses are "+NWMQCL:0" and "OK"
E.2 then, goto E. to run "AT+NWMQCL=?" command
E.3 else if responses are "+NWMQCL:1" and "OK"
E.4 then, goto next, F.
E.5 else if response is "ERROR:x"
E.6 then, Run "AT+SETDPMSLPEXT"
E.7 Wait for "OK" response
E.8 return
F. Run "AT+NWMQCL=0"
G. Wait for "+NWMQCL:0" and "OK" response
H. Run "AT+NWMQTS=<New MQTT Subscription Topic>"
I. Wait for "OK" response
J. Run "AT+RESTART"
K. Wait for "+INIT:DONE,0" response
L. Wait for "+WFJAP:1,'<SSID>',<IP ADDRESS>"
M. Wait for "+NWMQCL:1" response
9.1.5 MQTT Example: Reading Subscription Topic when Running
Let's assume that the Wi-Fi/MQTT connection is configured properly and DPM is set to 1 (TRUE).
The reading of the MQTT publishing topic would be similar.
Below is the recommended sequence. Note that the double quotation marks are used.
A. Trigger RTC_WAKE_UP Event
B. Wait for "+INIT:WAKEUP,EXT" Response
C. Run "AT+CLRDPMSLPEXT" command
D. Wait for "OK" response
H. Run "AT+NWMQTS=?"
I. Wait for "+NWMQTS:<MQTT Subscription Topic>" and "OK" response
NOTE
You need to consider that you can get the ERROR response in case that format of the command may have
some error.
H. Run "AT+SETDPMSLPEXT"
I. Wait for "OK" response
Let's assume that the Wi-Fi/MQTT connection is configured properly and DPM is set to 1 (TRUE).
The reading of the MQTT publishing topic would be similar.
Below is the recommended sequence. Note that the double quotation marks are used.
A. Trigger RTC_WAKE_UP Event
B. Wait for "+INIT:WAKEUP,EXT" Response
C. Run "AT+CLRDPMSLPEXT" command
D. Wait for "OK" response
H. Run "AT+NWMQTS=?"
I. Wait for "+NWMQTS:<MQTT Subscription Topic>" and "OK" response
H. Run "AT+SETDPMSLPEXT"
9.2 HTTP-Client Commands
Table 11: HTTP-Client Command List
Command Parameters Description
AT+NWHTC
<url>,<method>(,
<msg>)
Table 12: HTTP-Client Response List
Response Parameters Description
+ NWHTC <status>
Start HTTP client with options.
<url>: HTTP server address.
<method>: GET, POST or PUT.
<msg>: Request message for POST and PUT methods.
Returns status along with the received payload according to the
requested method.
AT+NWHTC=https://httpbin.org/post,post,HTTP-Client POST method sample test!
PUT method request:
AT+NWHTC=https://httpbin.org/put,put,HTTP-Client PUT method sample test!
9.3 HTTP-Server Commands
Table 13: HTTP-Server Command List
Command Parameters Description
AT+NWHTS <flagt> Start or stop HTTP server depending on your options.
<start>: 1 (start), 0 (stop)
Response: OK or ERROR.
AT+NWHTSS <flag> Start or stop HTTPS server depending on your options.
<start>: 1 (start), 0 (stop)
Response: OK or ERROR.
9.3.1 HTTP/HTTPS-Server Start Example
HTTP start:
AT+NWHTS=1
HTTPS start:
AT+NWHTSS=1
9.4 OTA Commands
Table 14: OTA Command List
Command Parameters Description
AT+NWOTADWSTART
AT+NWOTARENEW (none) Reboot with updated FW.
AT+NWOTADWPROG <fw_type> FW download progress.
<fw_type>,<uri>
(,<fw_name>)
Start downloading firmware from an OTA server.
<fw_type>: Set the type of FW to be downloaded.
<uri>: Server URL where a FW exists.
<fw_name>: Optional. It is available if fw_type is mcu_fw.
Maximum input size is eight bytes. MCU_FW will be stored as
default if there is no fw_name information. (Only for MCU FW)
Response: +NWOTADWSTART:0x00
For example:
AT+NWOTADWSTART=rtos,https://server/DA16200_RTOSGEN01-01-1111-000000.img
Read a name in the header of the MCU firmware. (Only for
MCU FW)
AT+NWOTAFWSIZE (none)
Read a size in the header of the MCU firmware. (Only for MCU
FW)
AT+NWOTAFWCRC (none)
Read a CRC in the header of the MCU firmware. (Only for MCU
FW)
AT+NWOTAREADFW <read addr>,
<read_size>
Read the MCU firmware as much as the read_size from the
read_addr and transmit it. (Only for MCU FW)
<read_addr>: Hexadecimal without “0x” prefix.
<read_size>: Decimal.
AT+NWOTATRANSFW (none)
Transmit an MCU firmware to MCU through UART1.
Transmission will be failed if no header (16 bytes) information
exist. (Only for MCU FW)
AT+NWOTAERASEFW (none)
Erase the MCU firmware stored in serial flash of DA16200.
(Only for MCU FW)
AT+NWOTASETADDR <sflash_addr>
Data to be downloaded can be designated as an address within
the range of User Area and TLS Certificate Key in the SFLASH
area. The default value is 0x003A_D000.
AT+NWOTAGETADDR <fw_type> Returns the value set with NWOTASETADDR.
AT+NWOTAREADFLA
SH
AT+NWOTAERASEFL
ASH
AT+NWOTACOPYFLA
SH
<sflash_addr>,<
size>
<sflash_addr>,<
size>
<dest_sflash_ad
dr>,<src_sflash_
Read as much as size from sflash_addr.
Delete as much as size from sflash_addr.
Copy as much as size from src_sflash_addr to
dest_sflash_addr.
addr>,<size>
Table 15: OTA Response List
Response Parameters Description
+NWOTADWSTART <status> Returns the status of FW download.
<status>: 0x00 is success. See Table 16 for other status
values.
For example: +NWOTADWSTART:0x00
+NWOTARENEW <status> Returns the status for FW RENEW.
<status>: 0x00 is success. See OTA Response Code List
for others.
For example: +NWOTARENEW:0x00
+NWOTADWPROG <progress>
Returns the percentage value (%) of the FW download
progress.
A remote TCP client is connected to the TCP server that was
opened by AT+TRTS.
<cid>: 0 (TCP Server).
<remote_ip>: TCP client IP address.
<remote_port>: TCP client port number.
For example: +TRCTS:0,192.168.0.5,3713
A remote TCP client is disconnected from the TCP server that
was opened by AT+TRTS.
<cid>: 0 (TCP Server).
<remote_ip>: TCP client IP address.
<remote_port>: TCP client port number.
For example: +TRXTS:0,192.168.0.5,3713
The TCP client socket that was opened by AT+TRTC is
disconnected.
<cid>: 1 (TCP Client).
<remote_ip>: TCP server IP address.
<remote_port>: TCP server port number.
For example: +TRXTC:1,192.168.0.5,3713
10.2 Data Transfer Commands
Table 19: Data Transmission Command
Escape Sequence Parameters Description
<ESC>S <cid><length>,
<remote_ip >,
<remote_port >,<data>
Transmit data through a socket with the CID specified.
<ESC>: The escape character (0x1B)
<cid>: 0 (TCP server), 1 (TCP client), 2 (UDP)
<length>: Data length (If this is 0 then read the command
until ‘\r’ or ‘\n’ is met. Max length is 2048 bytes, but data
will be fragmented by MTU).
<remote_ip>: Remote IP address.
<remote_port>: Remote port number.
●For TCP Server, <remote_ip> and <remote_port> of a
TCP Client should be given. Maximum four TCP
Clients can be connected to the TCP Server
●For TCP Client, 0, 0 is given (as the destination is the
server)
●For UDP: if you give 0,0, the data is sent to the
destination that AT+TRUR has specified. if non-0
<remote_ip> and <remote_port> are given, UDP
temporarily sends to the destination <remote_ip> and
<remote_port> specifies
For example:
+TRDTS:0,172.16.7.1,54687,10,DIA_ACT_TS
Receive data through TCP client socket.
<cid>: 1 (TCP Client).
<src_ip>: Source IP address.
<src_port>: Source port number.
<length>: Data length.
<data>: Received data.
For example: +TRDTC:1,192.168.20.1,88,10,
DIA_ACT_TC
Receive data through UDP server socket.
<cid>: 2 (UDP Session).
<src_ip>: Source IP address.
<src_port>: Source port number.
<length>: Data length.
<data>: Received data.
For example:
+TRDUS:0,172.16.7.1.54687,10.DIA_ACT_US
10.3 Data Transfer with DPM
10.3.1 TCP Server
After a connection to an AP is made in the normal BOOT state, open a TCP server socket and save
the config to NVRAM.
AT+TRTS=32000
AT+TRSAVE
Change the DA16200 state to DPM mode (AT+DPM=1). When the DA16200 starts the session on
DPM mode successfully, the following text is shown:
+INIT:DONE,0
+WFJAP:1,'WI-FI_AP',192.168.5.19
+TRPALL:0,TCP,0.0.0.0,0,32000
When a TCP client connects to DA16200, the following text is shown:
+INIT:WAKEUP,UC
+TRCTS:0,192.168.0.1,42000
When the DA16200 receives a message from a client, the following text is shown:
+INIT:WAKEUP,UC
+TRDTS:0,192.168.0.1,42000,10,1234567890
To send a TCP message, enter AT+MCUWUDONE immediately after “external wakeup” is triggered.
To prevent that DA16200 enters DPM Sleep mode, MCU should send AT+CLRDPMSLPEXT before
a message is sent. The DA16200 sends data to a TCP client with command “<ESC>S”. Finally, to
enter DPM sleep mode, enter “AT+SETDPMSLTEXT”.
When a TCP client disconnects from DA16200, the following text is shown:
+INIT:WAKEUP,UC
+TRXTS:0,192.168.0.1,42000
10.3.2 TCP Client
After a connection is made to an AP in the normal BOOT state, connect the TCP client of the
DA16200 to a TCP server and save the config to NVRAM. (To save TCP client config information,
the DA16200 should connect to the server successfully beforehand.)
AT+TRTC=192.168.5.1,34000
AT+TRSAVE
Change the DA16200 state to DPM mode (AT+DPM=1). When the DA16200 starts the session on
DPM mode successfully, the following text is shown:
+INIT:DONE,0
+WFJAP:1,'WI-FI_AP',192.168.5.19
+TRPALL:1,TCP,192.168.5.1,34000,30000
The procedure to exchange TCP data is the same as in Section 10.3.1. When the DA16200 receives
a message from the server, the following text is shown:
+INIT:WAKEUP,UC
+TRDTC:1,192.168.5.1,34000,10,1234567890
10.3.3 UDP Session
After a connection is made to an AP in the normal BOOT state, open a UDP socket and save the
config to NVRAM.
AT+TRUSE=48000
AT+TRSAVE
Change the DA16200 state to DPM mode. When the DA16200 starts the session in DPM mode
successfully, the following text is shown:
+INIT:DONE,0
+WFJAP:1,'WI-FI_AP',192.168.5.19
+TRPALL:2,UDP,0.0.0.0,0,48000
The procedure to exchange UDP data is the same as in Section10.3.1. When the DA16200 receives
a message from the server, the following text is shown:
DA16200’s physical OTP offset range: h0~h7FF; at each
offset, four bytes are stored or read.
For accessing OTP using AT-COMMAND, four-byte aligned
address should be given: For example: h0, h4, h8 ...
<addr>: OTP address to write four-byte aligned.
<cnt>: Bytes to write.
<value>: A string of four-bit HEXA value represented by the
ASCII code
Response: OK or Error
For example:
Writing h12345678 to OTP Address 0x400:
AT+UOTPWRASC=400,4,12345678
OK
AT+UOTPRDASC=400,4
12345678
OK
Important:
For MAC address read or write, AT+WFOTP (write) and
AT+WFMAC (read) must be used. Do not use
AT+UOTPRDASC or AT+UOTPWRASC for this purpose.
OTP offset from 0x00 ~ 0x2b should not be written as this
section is for “secure” boot.
DA16200 provides four slots to store MAC addresses and eight bytes are allocated for each slot.
Table 24: OTP Memory Address for Writing MAC Address
Slot OTP Address Description Size (Byte)
MAC Address #0
MAC Address #1
MAC Address #2
MAC Address #3
0x100 MAC Address Low 4
0x101 MAC Address High 4
0x102 MAC Address Low 4
0x103 MAC Address High 4
0x104 MAC Address Low 4
0x105 MAC Address High 4
0x106 MAC Address Low 4
0x107 MAC Address High 4
DA16200 provides two slots to store XTAL offset in the OTP memory. Slot #0 is the primary slot
while Slot#1 is for back-up, which is used when overriding Slot #0.
Make DA16200 go to Sleep mode 3 and wake up after
<period> milliseconds.
<period>: Wakeup time in milliseconds.
Response: OK or Error
For example: AT+SLEEPMS=5000
13 Examples
13.1 Data Transfer Test
This section describes how to test the transfer function commands with a data terminal emulator.
Some of the terminal applications to use for this purpose are:
● IO Ninja: http://ioninja.com/
○ HEXA data and file transmitting function
● Socket Test: http://sockettest.sourceforge.net/
○ Text data transmittable only
● Script Communicator: http://sourceforge.net/projects/scriptcommunicator
○ Socket communication, UART Rx/Tx data color-distinguished output function and HEXA data
transmission
The following sections describe test procedures for socket communication between the DA16200
and a PC with IO Ninja. You can run DA16200 AT commands on a serial terminal application on your
PC. The terminal must be connected to the UART1 interface of the DA16200.
AT-CMD, depending on user hardware’s configuration, can be running on UART2.
Build SDK with the following change (in bold font) in config_generic_sdk.h, then UART2 is used for
AT-CMD.
...
// AT-CMD features
#define __SUPPORT_ATCMD__ // Support AT-CMD #ifdef __SUPPORT_ATCMD__
#undef __ATCMD_IF_UART1__ // AT-CMD over UART1
#define __ATCMD_IF_UART2__ // AT-CMD over UART2
#undef __USER_UART_CONFIG__ // Support Customer's UART configuration
#undef __ATCMD_IF_SPI__ // AT-CMD over SPI
#undef __ATCMD_IF_SDIO__ // AT-CMD over SDIO
#endif /* __SUPPORT_ATCMD__ */
...
C.2 User UART Configuration
There’s a feature called “User UART Configuration” that is enabled by __USER_UART_CONFIG__
(available in SDK V2.3.4.0 and later version).
If SDK is built with __USER_UART_CONFIG__, a user can configure AT-CMD’s UART Setting
programmatically. (ATB will not be available with __USER_UART_CONFIG__ enabled).
For example, if a user wants to run AT-CMD on UART2 w/ static baud rate as 230400, SDK should
be configured as below (see necessary changes highlighted in bold font) before build.
// config_generic_sdk.h
...
// AT-CMD features
#define __SUPPORT_ATCMD__ // Support AT-CMD #ifdef __SUPPORT_ATCMD__
#undef __ATCMD_IF_UART1__ // AT-CMD over UART1
#define __ATCMD_IF_UART2__ // AT-CMD over UART2
With changes above, when DA16200 boots, AT-CMD is initialized in baud rate 230400 by default and
cannot change at run time.
C.3 Use Case
// __USER_UART_CONFIG__ disabled
● Baud rate (and other parameters) configurable by NVRAM
● ATB available, UART Setting can change at run-time without SDK rebuild
● Example Use case
○ MCU: Run on UART in baud rate 115200
○ MCU: Run ATF
○ DA16200: AT-CMD is initialized in 115200
○ MCU: ATB=230400
○ MCU: Now it should change its UART baud rate to 230400 to communicate with DA16200
// __USER_UART_CONFIG__ enabled
● AT-CMD UART’s baud rate (and other parameters) is configurable statically
● ATB NOT available
● Example Use Case
○ DA16200: DA16200 boots and AT-CMD is initialized in 230400 by default now.
○ MCU: Start on UART in baud rate 230400
○ MCU: AT-CMD operation …
The content of this document is under review and subject to formal approval, which may result in modifications or
additions.
The content of this document has been approved for publication.
Disclaimer
Unless otherwise agreed in writing, the Dialog Semiconductor products (and any associated software) referred to in this document are not
designed, authorized or warranted to be suitable for use in life support, life-critical or safety-critical systems or equipment, nor in applications
where failure or malfunction of a Dialog Semiconductor product (or associated software) can reasonably be expected to result in personal injury,
death or severe property or environmental damage. Dialog Semiconductor and its suppliers accept no liability for inclusion and/or use of Dialog
Semiconductor products (and any associated software) in such equipment or applications and therefore such inclusion and/or use is at the
customer’s own risk.
Information in this document is believed to be accurate and reliable. However, Dialog Semiconductor does not give any representations or
warranties, express or implied, as to the accuracy or completeness of such information. Dialog Semiconductor furthermore takes no
responsibility whatsoever for the content in this document if provided by any information source outside of Dialog Semiconductor.
Dialog Semiconductor reserves the right to change without notice the information published in this document, including, without limitation, the
specification and the design of the related semiconductor products, software and applications. Notwithstanding the foregoing, for any automotive
grade version of the device, Dialog Semiconductor reserves the right to change the information published in this document, including, without
limitation, the specification and the design of the related semiconductor products, software and applications, in accordance with its standard
automotive change notification process.
Applications, software, and semiconductor products described in this document are for illustrative purposes only. Dialog Semiconductor makes
no representation or warranty that such applications, software and semiconductor products will be suitable for the specified use without further
testing or modification. Unless otherwise agreed in writing, such testing or modification is the sole responsibility of the customer and Dialog
Semiconductor excludes all liability in this respect.
Nothing in this document may be construed as a license for customer to use the Dialog Semiconductor products, software and applications
referred to in this document. Such license must be separately sought by customer with Dialog Semiconductor.
All use of Dialog Semiconductor products, software and applications referred to in this document is subject to Dialog Semiconductor’s Standard
Terms and Conditions of Sale, available on the company website (www.dialog-semiconductor.com) unless otherwise stated.
Dialog, Dialog Semiconductor and the Dialog logo are trademarks of Dialog Semiconductor Plc or its subsidiaries. All other product or service
names and marks are the property of their respective owners.
Dialog Semiconductor’s 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.
757700
GmbH
-0
alog Semiconductor Taiwan
+81 3 5769 5100
+852 2607 4271
(Shanghai)
2981 3669
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.