WM - W800 - SDK User Manual - v11
WM - W800 - SDK User Manual - v11
WM - W800 - SDK User Manual - v11
V1.1
Address: 18th Floor, Yindu Building, No. 67 Fucheng Road, Haidian District, Beijing
Tel: +86-10-62161900
1
Machine Translated by Google
2
Machine Translated by Google
Table of contents
3
Machine Translated by Google
1 Introduction
1.1 Overview
This article mainly describes the functions and usage of the W800 software development kit (SDK), which integrates the W800 hardware driver (BSP),
Real-time operating system, TCP/IP protocol stack, WiFi protocol stack, BT protocol stack and other public modules can satisfy most application software
needs.
4
Machine Translated by Google
ÿ Chip appearance
ÿ MCU Features
ÿ Integrated 32-bit XT804 processor, operating frequency 240MHz, built-in DSP, floating point operation unit and security engine
5
Machine Translated by Google
ÿ Integrated 1 I 2C controller
ÿ Security Features
ÿ The MCU has a built-in Tee security engine, and the code can distinguish between the secure world and the non-secure world.
ÿ Integrated SASC/TIPC, memory and internal modules/interfaces can be configured with security attributes to prevent non-security code access
ÿ Firmware encryption keys are distributed using asymmetric algorithms to enhance key security
ÿ Hardware encryption module: RC4256, AES128, DES/3DES, SHA1/MD5, CRC32, 2048 RSA, true random number
generator
ÿ Wi-Fi characteristics
ÿ ÿÿ Wi-Fi WMM/WMM-PS/WPA/WPA2/WPS
6
Machine Translated by Google
ÿ Supports IEEE802.11n MCS 0~7 and MCS32 physical layer transmission rate levels, with the transmission rate up to 150Mbps
ÿ Supports HT-immediate Compressed Block Ack, Normal Ack, and No Ack response methods
ÿ Bluetooth features
ÿ Integrated Bluetooth baseband processor/protocol processor, supports BT/BLE dual-mode working mode, and supports BT/BLE4.2 protocol
ÿ Power management
W800 SDK is a collection of RTOS kernel, hardware driver, Wi-Fi protocol stack, Bluetooth protocol stack, TCP/IP protocol stack, network application protocol,
7
Machine Translated by Google
An embedded Wi-Fi and Bluetooth application development platform integrating AT command set, multiple application layer protocols and corresponding sample codes.
wireless
ÿ Support BT/BLE4.2
ÿ Support soft AP
drive
8
Machine Translated by Google
networking
ÿ ONESHOT
ÿ WPS
ÿ WEB page
ÿ AIRKISS
ÿ Bluetooth
9
Machine Translated by Google
TCP/IP protocol
ÿ Support IPERF
other
ÿ Support m-DNS
ÿ Support OS replacement
10
Machine Translated by Google
AT Command(For AT User)
OS API Driver API Wlan API Socket BT/BLE API Memory API
Driver
WLAN Supplicant LWIP STACK BT STACK
Other RTOS (I2C, I2S, PWM,
Memory
Free RTOS ÿRTTÿLiteOSÿ GPIOÿRTCÿTimerÿ
Management
AliOS) WDGÿ7816ÿinner
W i-Fi Driver BT Driver
FlashÿADCÿLSPIÿ
BSP
WM_SDK
11
Machine Translated by Google
ÿÿsrc Applications, network protocol stacks, OS and third-party open source code sets
ÿÿtools Compile scripts, CDS IDE projects, CDK projects, and IMAGE generation tools
Open the CDS integrated compilation environment and import the project file.
When importing project files, set the root path of the sdk to be imported. Then, the project files to be imported will be displayed. Just follow the operation.
When compiling, after selecting the sdk project, click build or rebuild on the toolbar to start compilation. The files generated by compilation are placed in bin
Under contents.
Go to tools\w800\projects\SDK_Project\project\CDK_WS, open the CDK project by opening the file with the .cdkws suffix, and then
12
Machine Translated by Google
Install the specified compilation tool and set it according to the compilation tool requirements. After decompressing the SDK, open the tool and jump to the root directory of the SDK and execute
Just make.
w800_ota.img Only supports OTA downloaded compressed firmware (save OTA space)
13
Machine Translated by Google
If the factory W800 development module has not been programmed with firmware, when it is powered on, the module will enter the ROM (UART0) and print information such as
Down:
If the development module of W800 leads to the BOOTMODE pin, and when powering on, the BOOTMODE pin is pulled down for more than 30ms, then
The module will also enter the ROM (UART0 only) and print the following information:
ROM According to the different stages of XMODEM download, the results of command execution and the abnormal conditions encountered at different stages of startup will be passed
W800 SECBOOT is a functional program that implements user firmware migration, firmware startup verification, startup jump, and jump to ROM
When the development module based on W800 is powered on/reset, if UART0 receives the ESC key, the module will detect when SECBOOT starts.
Test the ESC key and jump to ROM, then enter the serial port XMODEM download mode, (UART0) prints the following information:
14
Machine Translated by Google
In different XMODEM upgrade stages, if an exception is encountered, different characters will be output through UART0 to represent the error code.
The SDK supports the printf debugging function of standard C and outputs it to the physical serial port UART0. Users can perform debugging in the debugging stage according to their own needs.
The existing LOG information output of the SDK can be set through the following macro definition in the wm_debug.h file:
Wi-Fi debugging information requires a separate Wi-Fi Lib to support, and the user needs to implement the wm_printf and wm_vprintf interfaces.
15
Machine Translated by Google
Target Firmware
4 TCP/IP Tools
5 9
11
7
8
W800.fls (in
ROM)
W800's SDK supports the command line GCC development and compilation environment, and installs a Linux virtual machine (the compilation environment has been integrated).
16
Machine Translated by Google
After the W800 SDK target file is compiled, it needs to be packaged to generate the target upgrade file. The SDK comes with its own source code tools.
W800 supports serial port XMODEM protocol upgrade, and SecureCRT is recommended.
3Development Guide
The running mode of WM_SDK is based on the XIP mode implemented by the 32KB Cache integrated inside the W800 chip, and runs on QFLASH.
The startup process of W800 jumps to SECBOOT through ROM, and then jumps to user code space through SECBOOT.
ROM is responsible for initializing the basic functions of the chip and is solidified in the chip.
SECBOOT is responsible for verifying and upgrading the user space code and placing it in a section of QFLASH.
The W800's CACHE space size is 32KB. When the running code size is less than 32K, the CPU will not need to read instructions from QFLASH.
17
Machine Translated by Google
wm_main.c (OS
(exception vector table and interrupt handling function) driver interface initialization, Wi-Fi initialization, BT initialization, (user program entry)
TCP/IP initialization)
After the W800 module is started and run through the ROM and SECBOOT programs, it will eventually run to startup.S to start execution, and then jump
Go to the wm_main.c file to perform some initialization functions. Finally, enter main.c to print the user task.
The starting entry of the user program (main.c) of WM_SDK is: UserMain(void). Users can use this file based on
Create your own Task in the CreateDemoTask function to complete the customized function. Currently DEMO CODE provides a
CreateDemoTask is used to test the API provided by the SDK, and customers can modify it according to actual needs.
void UserMain(void)
#if WM_DEMO
CreateDemoTask();
#endif
W800 has a total of 160K Byte SRAM+128K Byte (configurable space), and the address space is [0x20000000 – 0x2048000].
System heap size setting, located in the gcc_csky.ld file, is defined as follows:
18
Machine Translated by Google
__min_heap_size = 0x10000;
To configure the system heap size, __heap_end determines the actual heap size after linking. You can actually confirm it after the image is started.
W800 uses built-in 2M Byte QFlash space by default, and the specific allocation is as follows (X=1 in the picture):
0x8XFFFFF
OTA Param (4KB)
0x8XFF000
0x81C0000
0x8010000
The user-available parameter area is 240Kbyte, which can be adjusted according to the IMAGE size of the running area and upgrade area.
W800 users wish to store customized parameters or run logs. The space available to users of the current SDK’s QFLASH layout is
19
Machine Translated by Google
If the user's code space is redundant, the user can re-adjust the QFLASH code area and user parameter area space according to their own needs.
System parameters refer to the networking, interface configuration, mode configuration, etc. parameters required when the W800 module is running, as follows:
1) Wi-Fi related (SSID, BSSID, KEY, channel list, power saving flag, rate setting, area code, working mode)
2) IP information (static IP, DHCP enabling information, NTP server, DNS server)
The system parameter area is located at: 0x81FC000-0x81FEFFF. Users cannot use this parameter area for other purposes.
20