Intended to use with Xuantie-800-gcc-elf-newlib,
which have gcc-13
support. (I guess old toolchain should work fine...)
Derived from wm-sdk-w806.
I'm not a fan of Makefile, and it makes me headache when debugging it
There are two API styles for W806/Air103
- one comes from WinnerMicro W806 which appears to be an old
one (v0.6.0), started with
HAL
(I would call itHAL
driver) - the other from WinnerMicro W80X
(v1.00.10) which is used in luatos-soc-air101, started with
tls
(I would call ittls
driver)
The tls
one has more features like Bluetooth and Wi-Fi but W806/Air103 doesn't have RF module.
The OSAL
abstraction layer comes from tls
driver is bloated and less flexible than HAL
driver.
I never plan to use tls
driver, tls
branch
did some experiments, but it's not usable. (You must be kidding that most of the header files are
without #ifdef __cplusplus
some even don't have "include guards", makes it hard to use in C++ project)
Anyway, enough complaining, let's see what we have here.
See csi_config.h and FreeRTOSConfig.h to configure the environment. I personally don't like to use fancy Kconfig but define them directly in the header file.
- FreeRTOS
See make_firmware.sh.in, which is
almost equivalent
to rules.mk
from wm-sdk-w806
.
See
also sdk.conf.
If you don't care about encryption and signature stuff, things are pretty simple.
csky-unknown-elf-objcopy -Obinary demo.elf demo.bin
wm_tool -b demo.bin -o demo -it 1 -fc 0 -ra 0x080D0400 -ih 0x080D0000 -ua 0x08010000 -nh 0 -un 0
-b demo.bin
: Specifies the input binary file (demo.bin
) to be packaged.-o demo
: Specifies the output firmware file name prefix (demo
).-it 1
: Sets the firmware image layout type to 1 (user image).-fc 0
: Disables firmware compression.-ra 0x080D0400
: Sets the runtime position (address) of the firmware to0x080D0400
.-ih 0x080D0000
: Sets the image header storage location to0x080D0000
.-ua 0x08010000
: Sets the upgrade storage location (OTA address) to0x08010000
.-nh 0
: Sets the next image header storage location to 0 (not used).-un 0
: Sets the upd no version number to 0 (not used).
See crosstyan/wm_tool_rs.
You can also use the original wm_tool.
Following commands are stolen from github0null/w800_cmake_sdk
wm_tool -dl "$firmware" -ws 2M -ds 2M -rs rts -c $port -sl str -ws 115200
Here's the explanation generated by AI. Take it with a grain of salt.
-dl "$firmware"
: Specifies the firmware file to be downloaded. The$firmware
variable should contain the path to the firmware file.-ws 2M
: Sets the serial port speed during normal work (after firmware download) to 2 Mbps.-ds 2M
: Sets the serial port speed during firmware download to 2 Mbps.-rs rts
: Sets the device reset method to use the serial port's RTS (Request to Send) pin to control the device reset.-c $port
: Specifies the serial port to connect to for downloading the firmware. The$port
variable should contain the name of the serial port (e.g., COM3, /dev/ttyUSB0).-sl str
: Sets the display format for the log information output from the serial port to string mode.-ws 115200
: Sets the serial port speed during normal work (after firmware download) to 115200 bps. This option overrides the previous-ws 2M
setting.In summary, this command does the following:
- Connects to the specified serial port (
$port
) to communicate with the W800 device.- Sets the serial port speed to 2 Mbps during firmware download.
- Uses the RTS pin to control the device reset.
- Downloads the specified firmware file (
$firmware
) to the W800 device.- Sets the serial port speed to 115200 bps for normal operation after the firmware download.
- Displays the log information output from the serial port in string format.
wm_tool -c ttyUSB0 -sl str -ws 115200
wm_tool -c ttyUSB0 -rs rts -eo all
Not available yet. See W806 debugging (part 1).
- 联盛德 HLK-W806 (七): 兼容开发板 LuatOS Air103
- Air103 at LuatOS
- github0null/w800_cmake_sdk
- crosstyan/wm_tool
- W806 debugging (part 1)
- Air103 资料汇总(软硬件资料,固件下载,技术支持)
- About AT mode when download firmware
- 联盛德微W806芯片移植RTthread-Nano
- OpenHarmony LiteOS指令集移植指南(C-SKY)
- E804 at XuanTie
- 联盛德·W800 at XuanTie
- WinnerMicro W800