• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created about 3 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A SDK for WinnerMicro W806

English Readme | 中文说明

About

A SDK for WinnerMicro MCU W806.

File Structure

wm-sdk-w806
├─app              # User application code
├─bin              # Compilation results
├─demo             # Demos
├─include          # SDK header files 
├─ld               # Link scripts
├─lib              # Libraries
├─Makefile
├─platform         # SDK source code
└─tools            # Utilities

For Linux Users

Download Toolchains

Installation

Extract the toolchains to proper folder -- be careful that the tar ball use ./ as top level path, move it to a seperate folder or specify a target folder for the uncompressing.

mkdir csky-elfabiv2-tools-x86_64-minilibc-20210423
tar xvf csky-elfabiv2-tools-x86_64-minilibc-20210423.tar.gz  -C csky-elfabiv2-tools-x86_64-minilibc-20210423/

Then move it to somewhere, e.g. /opt/toolchains, set it read-only to normal users

cd /opt/toolchains/
sudo mv ~/Download/csky-elfabiv2-tools-x86_64-minilibc-20210423/ .
sudo chown -R root:root csky-elfabiv2-tools-x86_64-minilibc-20210423/

You don't need to add it to the system PATH variable.

Building

Checkout this project

git clone https://github.com/IOsetting/wm-sdk-w806.git

Run menuconfig, configurate the toolchains path

cd wm-sdk-w806
make menuconfig

In menuconfig, navigate to Toolchain Configuration, In the second line "the toolchain path", input the absolute path of the toolchains executables, e.g.

/opt/toolchains/csky-elfabiv2-tools-x86_64-minilibc-20210423/bin/

Leave other settings unchanged, save and exit menuconfig.

Then build the project

make

More Building Options

  • UART0 printf() output
    In /include/arch/xt804/csi_config.h, option USE_UART0_PRINT controls whether use UART0 to send printf() output, it is turned on by default. Note: This feature will occupy UART0, if any other devices are going to communicate with UART0, please turn it off.
  • Hands-free download
    In /include/arch/xt804/csi_config.h, option USE_UART0_AUTO_DL controls enable/disable automatic download, it is turned off by default. When it is enabled, download tool will reset the board automatically before the downloading. Option USE_UART0_PRINT should be enabled to make this work.

Download To Development Board

Connect the development board to PC, get the USB port name by commands dmesg, lsusb and ls /dev/tty*.

Run menuconfig to set the download port

cd wm-sdk-w806
make menuconfig

In menuconfig, navigate to Download Configuration

  • Download port: Input the USB port name, e.g. ttyUSB0;
  • Down rate: Input the UART baud rate, the higher rate the higher download speed. The availabe options are 115200, 460800, 921600, 1000000 and 2000000.

Then save and exit menuconfig, download the hex file to development board

make flash

Press the Reset key to start the downloading. If previously downloaded hex was built with USE_UART0_AUTO_DL enabled, the board will start downloading automatically.

build finished!
connecting serial...
serial connected.
wait serial sync.........         <--- Press the Reset key here
please manually reset the device. <--- (Or here)
.....
serial sync sucess.
mac CC-CC-CC-CC-CC-CC.
start download.
0% [###] 100%
download completed.
reset command has been sent.

When downloding finishes, the board will be reset automatically to run the new program. In case the auto-reset fails, you need to press the reset key manually to make it run.

More Download Options

Show serial ports

make list

Build, download and start serial monitor

make run

Start serial monitor only

make monitor

For Windows Users

Download Toolchains

Installation

  • Run msys2-x86_64-yyyymmdd.exe to install MSYS2
  • When the installation finishes, install necessary tools in MSYS2 console
# Update all packages
pacman -Syu
# Install make
pacman -S msys/make
# Install automake
pacman -S msys/automake
# Install autoconf
pacman -S msys/autoconf
# Install gcc
pacman -S msys/gcc
# Install git
pacman -S msys/git
# Install dependencies
pacman -S msys/ncurses-devel
pacman -S msys/gettext-devel

Extract toolchains to specified folder

mkdir csky-elfabiv2-tools-mingw-minilibc-20210423
tar xvf csky-elfabiv2-tools-mingw-minilibc-20210423.tar.gz -C csky-elfabiv2-tools-mingw-minilibc-20210423/

Note down the full path of toolchain executables, e.g. /d/w806/csky-elfabiv2-tools-mingw-minilibc-20210423/bin/.

Building

Check out this SDK

git clone https://github.com/IOsetting/wm-sdk-w806.git

Configurate toolchains path in menuconfig

cd wm-sdk-w806
make menuconfig

In menuconfig, navigate to Toolchain Configuration -> toolchain path, input the path (including the tail slash '/'), e.g.

/d/w806/csky-elfabiv2-tools-mingw-minilibc-20210423/bin/

Leave other settings unchanged, save and exit menuconfig.

Then build the project

make

The result files are under bin/W806.

Download To Development Board

Option 1: Upgrade_Tools

  • Connect the development board to your PC
  • Run flash tool Upgrade_Tools_V1.4.8.exe
  • Select the correct COM port, and use the default baud rate 115200, Click 打开串口
  • Select bin file 'W806.fls' from bin/W806
  • Click 下载 to start download
  • Press Reset key to reset board, then it will start downloading.
  • When downloading finishes, press Reset key again to make it run.

Option 2: wm_tool

Find the port name of connected board in Device Manager, e.g. COM5.

Run menuconfig to set the download port

cd wm-sdk-w806
make menuconfig

In menuconfig, navigate to Download Configuration

  • Download port: Input the USB port name, e.g. COM5;
  • Down rate: The higher rate the higher download speed, the availabe options are 115200, 460800, 921600, 1000000 and 2000000.

The rest are the same as operations in Linux, please refer to Linux - Download To Development Board.

Problems

  1. Download Failed
    When it shows can not open serial make: *** [tools/w806/rules.mk:158: flash] Error 255, check if any other applications are occupying the USB port, if yes, close it and retry.
  2. Delay function failed in FreeRTOS
    In /include/arch/xt804/csi_config.h, please comment out #define CONFIG_KERNEL_NONE 1
  3. Hex is not updated
    If the compilation doesn't reflect your code changes, please clean the workspace withmake clean or make distclean
  4. Auto-reset failed
    In some cases the auto-reset may fail, you need to press the Reset key to reset the board manually.

License

The code of WM-SDK-W806 is licensed under the Apache-2.0 license.

As WM-SDK-W806 includes code from many upstream projects it includes many copyright owners. WM-SDK-W806 makes NO claim of copyright on any upstream code. Patches to upstream code have the same license as the upstream project, unless specified otherwise. For a complete copyright list please checkout the source code to examine license headers.

Unless expressly stated otherwise all code submitted to the WM-SDK-W806 project (in any form) will be licensed under Apache-2.0 license. You are absolutely free to retain copyright. To retain copyright simply add a copyright header to each submitted code page. If you submit code that is not your own work it is your responsibility to resolve the conflicts and place a header stating the copyright.

More Repositories

1

py32f0-template

Puya PY32F002A PY32F003 PY32F030 GNU GCC SDK, template and examples
C
155
star
2

FwLib_STC8

A lite firmware library for STC8G/STC8H series MCU
C
113
star
3

v2rock

V2ray GUI client for Ubuntu and Debian
C++
76
star
4

stc8prog

Open Source STC8G/STC8H ISP flash tool
C
61
star
5

hk32f030m-template

HSXP HK32F030M template project for GNU Arm Embedded Toolchain
C
29
star
6

air32f103-template

AIR32F103 template project for GNU Arm Embedded Toolchain
C
27
star
7

HML_FwLib_STC12

A lite firmware library for STC12 series MCU
C
27
star
8

stm32f103-esp8266

A working demo of ESP8266 ESP-01S UART WiFi module running on STM32F103C8T6
C
22
star
9

stm32f103-w5500

A working demo of W5500 Ethernet module running on STM32F103C8T6
C
21
star
10

ipfs-gateway-selector

An IPFS site displaying public IPFS gateways and their connection latency to user.
HTML
21
star
11

hc32l110-template

HDSC HC32L110 GNU GCC SDK, template and examples
C
16
star
12

StdPeriphLib_CH32F1

A StdPeriph Library for CH32F103 series MCU
C
14
star
13

stm32f103-nrf24l01

A working demo of nRF24L01 WiFi module running on STM32F103C8T6
C
10
star
14

at32f403a_407-template

Artery AT32F403A AT32F407 template project for GNU Arm Embedded Toolchain
C
8
star
15

libopencm3-freertos-template

Project template of libopencm3 + FreeRTOS
Makefile
6
star
16

ch32v103-template

Project template of WCH CH32V103
C
6
star
17

stcmx

stcmx is a command-line tool that allows a very easy generation of the corresponding initialization C code for STC8 MCUs through a step-by-step process.
Python
6
star
18

redinav

RediNav is a GUI management tool for Redis
C++
5
star
19

stm32f401-esp8266

A working demo of ESP8266-S01 UART module running on STM32F401CCU6 (Black Pill)
C
5
star
20

stm32f103-enc28j60

A working demo of ENC28J60 Ethernet module running on STM32F103C8T6.
C
5
star
21

ch32v208-template

Project template of WCH CH32V208
C
4
star
22

stm32f401-wireless-car

C
4
star
23

stm32f4-hal-projects

STM32F4 HAL Demo Projects
C
4
star
24

stm32f401-nrf24l01

A working demo of nRF24L01 WiFi module running on STM32F401CCU6
C
3
star
25

at32f421-template

Artery AT32F421 template project for GNU Arm Embedded Toolchain
C
2
star
26

py32f002a-remote-control

PY32F002A XL2400 6+1CH Remote Control
C
1
star
27

ch583-template

WCH CH582/CH583 GNU GCC project template and examples
C
1
star