A SDK for WinnerMicro W806

Overview

About

This is a SDK for WinnerMicro W806, migrated from W800 SDK.

SDK File Structure

WM_SDK 
├─app              # User application source code
├─bin              # Binary executables, compilaion results
├─demo             # Demos
├─doc              # Release notes, API Docs 
├─include          # API header files 
├─ld               # Link scripts
├─lib              # Libraries
├─Makefile
├─platform         # Chip&Platform related common code
├─src              # Applications, network protocols, OS and 3rd party source code
└─tools            # Compilation scripts, tools for CDS IDE project、CDK project and IMAGE generation

How To

Install Toolchain

Download

  • https://occ.t-head.cn/community/download
  • 导航->工具->工具链-800系列->(For now, it is V3.10.29)
  • Download according to your OS version, e.g. for Ubuntu20.04, download csky-elfabiv2-tools-x86_64-minilibc-20210423.tar

Install

Be careful that the tar ball file use ./ as root path, please move it to a subfolder or specify a target folder for the uncompression

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, and set it read-only

cd /opt/toolchains/
sudo mv ~/Backup/linux/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 PATH variable.

Compile

Checkout this project

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

Run menuconfig, set the toolchain path

cd w806_makefile
make menuconfig

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

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

Leave other settings unchanged, Save and Exit menuconfig

Now, compile the SDK

make

Flash

Check the USB port name of your development board using commands dmesg and lsusb, the USB chip is CH340 so it is easy to find in the list.

Then run menuconfig to set the download port

cd w806_makefile
make menuconfig

In menuconfig, navigate to Download Configuration -> download port, input the USB port name you just got, e.g. ttyUSB0, then save and exit menuconfig

Then download the hex to the development board

make flash

Press the Reset key according to the prompt

build finished!
connecting serial...
serial connected.
wait serial sync.........
please manually reset the device. <--- Press the Reset key
.....
serial sync sucess.
mac CC-CC-CC-CC-CC-CC.
start download.
0% [###] 100%
download completed.
please manually reset the device.

You need to press Reset key again to make it run, or it will stay in download mode (keep bumping CCCCCC).

Issues
  • error libc

    error libc

    CC libc_port.c libc_port.c: In function ‘_ftoa’: libc_port.c:888:3: internal compiler error: Instrucción ilegal if (diff > 0.5) { ^~ csky-elfabiv2-tools-x86_64-minilibc-20210423

    tanks ( git clone repository)

    opened by iotw806 18
  • Timer Demo not working

    Timer Demo not working

    Compiled Timer Demo (/demo/tim) and flashed it to w806.

    In serial monitor it doesn't serial print anything, it displays only "enter main" and then nothing...

    opened by Chandler-Kluser 8
  • w806 CPU exception

    w806 CPU exception

    Hello, Friends. I tried to connect the fatfs library to the SDHC card via SPI on the w806. My card initialization is going well. And when I try to read one block, I get an error on UART monitor: CPU Exception : 7r0: 00000000 r1: 001010a9 r2: 00000001 r3: 001000a9 r4: c08ed88e r5: 7c00befb r6: b90600bf r7: a4f30200 r8: 4de428b3 r9: 4c83600a r10: 4e46aa12 r11: 3384e604 r12: ffffffff r13: 0000002d r14: 20001100 r15: 000621ea epsr: e0000340epc : 4dfa. My question is: what could be the problem? In which files is CPU exceptions processing located? In which file is the stack fnd heap size specified? I also tried to write a library to work with HARD I2C. Did you also fail to get the START command on the bus? Is it a hardware problem in the chip? I will be very grateful for answers to my questions. I would really like to understand the work of this MCU in more detail. My email [email protected] .

    opened by AndrejChoo 5
  • I2S and DMA: Trouble getting Circular to work, and what are differences between Normal Circular vs. Link Circular?

    I2S and DMA: Trouble getting Circular to work, and what are differences between Normal Circular vs. Link Circular?

    Hi there, I am trying to write a simple I2S and DMA example of a circular buffer with only the DMA TX. However, I could not get these "Half Complete" and "Complete" interrupts to be triggered. There is no response after calling HAL_I2S_Transmit_DMA. All it does now is to jump to the while loop in the main.

    In the library, there are two DMA transfer modes: Link and Normal. I am not entirely sure what are the differences between that, so I picked the Normal.

    Here are the parts of the code, which I modified from the i2s example:

    main.c

    int main(void)
    {
        SystemClock_Config(CPU_CLK_160M);
        printf("enter main\r\n");
        
        HAL_Init();
        DMA_Init();
        I2S_Init();
        
        // I2S_BUFFER_SIZE is 512 in my modified example:
        memset(tx_buf, 0x00, I2S_BUFFER_SIZE);
    
        HAL_I2S_Transmit_DMA(&hi2s, (uint32_t*)tx_buf, I2S_BUFFER_SIZE);
    
        while (1)
        {
            printf(".");
            HAL_Delay(1000);
        }
    }
    
    static void DMA_Init(void)
    {
        __HAL_RCC_DMA_CLK_ENABLE();
        
        HAL_NVIC_SetPriority(DMA_Channel0_IRQn, 0);
        HAL_NVIC_EnableIRQ(DMA_Channel0_IRQn);
        
    }
    
    void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s)
    {
        printf("tx halfcplt\r\n");
    }
    
    void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s)
    {
        printf("tx cplt\r\n");
    }
    

    wm_hal_msp.c:

    void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s)
    {
        if (hi2s->Instance == I2S)
        {
            __HAL_RCC_I2S_CLK_ENABLE();
            __HAL_RCC_GPIO_CLK_ENABLE();
            
            __HAL_AFIO_REMAP_I2S_MCK(GPIOA, GPIO_PIN_7);
            __HAL_AFIO_REMAP_I2S_WS(GPIOB, GPIO_PIN_9);
            __HAL_AFIO_REMAP_I2S_CK(GPIOB, GPIO_PIN_8);
            __HAL_AFIO_REMAP_I2S_MOSI(GPIOB, GPIO_PIN_11);
            __HAL_AFIO_REMAP_I2S_MISO(GPIOB, GPIO_PIN_10);
            
            hdma_i2s_tx.Instance = DMA_Channel0;
            hdma_i2s_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
            hdma_i2s_tx.Init.DestInc = DMA_DINC_DISABLE;
            hdma_i2s_tx.Init.SrcInc = DMA_SINC_CIRCULAR;
            hdma_i2s_tx.Init.DataAlignment = DMA_DATAALIGN_WORD;
            hdma_i2s_tx.Init.Mode = DMA_MODE_NORMAL_CIRCULAR;
            hdma_i2s_tx.Init.RequestSourceSel = DMA_REQUEST_SOURCE_I2S_TX;
            
            hdma_i2s_tx.LinkDesc = tx_desc;
            
            if (HAL_DMA_Init(&hdma_i2s_tx) != HAL_OK)
            {
                Error_Handler();
            }
            __HAL_LINKDMA(hi2s, hdmatx, hdma_i2s_tx);   
    
            HAL_NVIC_SetPriority(I2S_IRQn, 1);
            HAL_NVIC_EnableIRQ(I2S_IRQn);
        }
    }
    

    Is the Circular mode, when running, should trigger both the Half-Transfer Complete and Transfer Complete interrupts continuously?

    opened by nyh-workshop 4
  • Windows msys2 $make menuconfig gives Permission denied

    Windows msys2 $make menuconfig gives Permission denied

    Error: running msys2 build system gives the following error, while attempting to change toolchain executables path $ make menuconfig make: ./tools/W806/mconfig.sh: Permission denied make: *** [tools/W806/rules.mk:141: menuconfig] Error 127

    system: msys2 is running onto windows 11, all necessary packages updated/installed msys2 (run as admin) did not work

    opened by ramymagdy-rm 3
  • ld: error: no memory region specified for loadable section `.eh_frame_hdr'

    ld: error: no memory region specified for loadable section `.eh_frame_hdr'

    ok ... ld: error: no memory region specified for loadable section `.eh_frame_hdr'

    text of config ... `# Automatically generated file; DO NOT EDIT. WinnerMicro W800 Configuration

    Firmware Configuration

    CONFIG_W800_TARGET_NAME="W806" CONFIG_W800_IMAGE_TYPE=1 CONFIG_W800_IMAGE_HEADER=8010000 CONFIG_W800_RUN_ADDRESS=8010400 CONFIG_W800_UPDATE_ADDRESS=8010000 CONFIG_W800_PRIKEY_SEL=0 CONFIG_W800_IMAGE_SIGNATURE=0 CONFIG_W800_CODE_ENCRYPT=0 CONFIG_W800_SIGN_PUBKEY_SRC=0

    Download Configuration

    CONFIG_W800_DOWNLOAD_PORT="ttyUSB0" CONFIG_W800_DOWNLOAD_RATE=2000000

    Compile Configuration

    CONFIG_W800_USE_LIB is not set CONFIG_W800_FIRMWARE_DEBUG is not set

    Toolchain Configuration

    CONFIG_W800_TOOLCHAIN_PREFIX="csky-abiv2-linux" CONFIG_W800_TOOLCHAIN_PATH="/opt/toolchains/csky-linux-gnuabiv2-tools-x86_64-glibc-linux-4.9.56-20210423/bin/"`

    opened by gitmun 3
  • How to make own custom app / Project template

    How to make own custom app / Project template

    Hi there, I managed to compile and flash the W806 kit successfully using the guides provided.

    However, I'm not sure which app it uploads to the board. It said "W806.bin" in the "make flash" output - but I couldn't locate that sample app that is associated with the W806.bin. Is it in the "demo" folder, or one of the apps in the "app" folder?

    Also, it could be easy if there's an empty project template which I can work on different things. Is it possible to just reuse that whole "WM-SDK-W806" folder and add my custom app inside (possibly passing a parameter to the make command?), or I have to create another separate copy of "WM-SDK-W806" if I need to have my own app inside?

    opened by nyh-workshop 2
  • sky-linux-gnuabiv2/bin/ld: error: no memory region specified for loadable section `.eh_frame_hdr' collect2: error: ld returned 1 exit status

    sky-linux-gnuabiv2/bin/ld: error: no memory region specified for loadable section `.eh_frame_hdr' collect2: error: ld returned 1 exit status

    /opt/toolchains/csky-linux-gnuabiv2-tools-x86_64-glibc-linux-4.9.56-20210423/bin/../lib/gcc/csky-linux-gnuabiv2/6.3.0/../../../../csky-linux-gnuabiv2/bin/ld: warning: file /opt/toolchains/csky-linux-gnuabiv2-tools-x86_64-glibc-linux-4.9.56-20210423/bin/../lib/gcc/csky-linux-gnuabiv2/6.3.0/hard-fp/libgcc.a(_fixunsdfsi.o)'s arch flag ck810 conflict with target ck803,set target arch flag to ck810 /opt/toolchains/csky-linux-gnuabiv2-tools-x86_64-glibc-linux-4.9.56-20210423/bin/../lib/gcc/csky-linux-gnuabiv2/6.3.0/../../../../csky-linux-gnuabiv2/bin/ld: error: no memory region specified for loadable section `.eh_frame_hdr' collect2: error: ld returned 1 exit status make: *** [tools/W806/rules.mk:206: bin/build/W806/image/W806.elf] Error 1

    opened by gitmun 2
  • download location for the toolchain

    download location for the toolchain

    I found some URL where you can download the toolchains and documentation without an account (and that work, unlike ipfs.io that currently times out) in a AUR package: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=csky-toolchain-bin

    opened by minirop 1
  • small fixes to run with generic gcc/binutils and BSD environment

    small fixes to run with generic gcc/binutils and BSD environment

    I want to run wm-sdk-w806 on OpenBSD. Different from Linux, we do not have any compilier binary package so need to build gcc/binutils/newlib tar ball. I use binutils-2.34, gcc-9.4.0 and newlib-4.1.0 and make some modification to this SDK.

    The goal is make a small hook for skilled-user who want to use generic (not customized for W806) toolchain or non-Linux user.

    Currently menuconfig is not working and -ckmap option of ld is kept.

    opened by jg1uaa 1
  • add use_csky_toolchain internal option to select C-SKY/generic toolchain

    add use_csky_toolchain internal option to select C-SKY/generic toolchain

    added internal option and required settings, for those who want to use generic (not C-SKY) toolchain.

    Note: -lsemi (instead of -lnosys) does not work. -mistack required.

    opened by jg1uaa 0
  • "Enable Use Lib" does not work correctly in SDK and CDK project.

    Hello there, I have just compiled a simple C++14 app with a number of constexpr and static declarations. However, it could not compile with reasons of undefined reference to __cxa_guard_acquire in the compilation.

    From the static compilation guides in C++, it is noticed that some form of stdlib needed to be enabled to be successfully compiled, or disabling the thread safety mechanism. However, since this app will be also used with a FreeRTOS, I will have to use the libc ("Enable Use Lib"?) provided.

    After enabling the "Enable Use Lib" in menuconfig, and compiling it, I got a warning:

    0/../../../../csky-elfabiv2/bin/ld.exe: warning: cannot find entry symbol Reset_Handler; defaulting to 08010400
    OBJCOPY  W806.bin
    generate normal image completed.
    generate normal image completed.
    compress binary completed.
    generate compressed image completed.
    build finished!
    connecting serial...
    

    and I could not get the program to run, and I'm suspecting it's just waiting for the user to upload binary in the terminal: MMMCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC It is possible too that it's not jumping to the intended program location.

    opened by nyh-workshop 1
  • not programing ??????????????

    not programing ??????????????

    first of all thank you for the answer and the project ...

    well .... I bought the product from aliexpress and programmed the gpio example to see if it loaded ... now I have made a program for a greenhouse control and what is my surprise that when I save it (without compilation errors) I get it says that it is recorded (without errors) but instead there is still the led program, since my program does not use leds

    opened by iotw806 3
Owner
IOsetting
Have fun!
IOsetting
The Gecko SDK (GSDK) combines all Silicon Labs 32-bit IoT product software development kits (SDKs) based on Gecko Platform into a single, integrated SDK.

Silicon Labs Gecko SDK (GSDK) The Gecko SDK (GSDK) combines Silicon Labs wireless software development kits (SDKs) and Gecko Platform into a single, i

Silicon Labs 104 Aug 3, 2022
The old Windows NT OpenGL samples/SDK from an MSDN CD.

The OpenGL API is supported on a variety of graphics hardware; the software in this release provides support for graphics hardware including basic emulation on any video adapter that is supported with the operating system, and accelerated graphics hardware that is supported by an OpenGL mini-client driver (MCD) or an OpenGL installable client driver (ICD).

Ian Hanschen 18 Jan 9, 2022
Poc to test my little friend features without any sdk

poc.vic-hack POC to test my little friend "vector" features without any sdk Ultimate goal - being able to write own firmware components without propri

Oleg Lytvynenko 8 Feb 26, 2022
A SDK with a built-in cheat for Garry's Mod.

GMod-SDK This is a module for Garry's Mod that works based on a SDK. I've spent the past few days reversing a few modules of the game, in order to get

null 57 Jul 26, 2022
Portal 2/Portal Reloaded internal cheat sdk with imgui-based menu

portal2-internal A simple Portal 2/Portal Reloaded internal cheat base with imgui-based menu coded in a few days because why not Features: simple menu

es3n1n 23 Aug 2, 2022
Playground app for ZNN Dart SDK

Prerequisites Flutter SDK VS Code IDE recommended Installation Clone the repo git clone https://github.com/nemoryoliver/znn_playground.git Install pa

Oliver Martinez 9 Feb 16, 2022
32blit SDK boilerplate for the PicoSystem RP2040-based handheld

PicoSystem 32blit Boilerplate This is a basic template for starting 32blit projects for the Pimoroni PicoSystem. It shows a minimal code layout and as

32blit 14 Jul 27, 2022
MinIO C++ Client SDK for Amazon S3 Compatible Cloud Storage

The MinIO C++ Client SDK provides simple APIs to access any Amazon S3 compatible object storage.

Multi-Cloud Object Storage 28 Jul 27, 2022
First open-source Geometry Dash cross-platform Modding SDK

BoolkaSDK First open-source Geometry Dash cross-platform Modding SDK Requirements CMake 3.21 Android NDK r23 LLVM x86 Java and ApkTool Building Open C

null 6 Jun 9, 2022
Polaris-SDK for PHP

polaris-php Polaris is an operation centre that supports multiple programming languages, with high compatibility to different application framework. P

liaochuntao 0 Dec 10, 2021
This repository contains the source for the ANARI API SDK

ANARI-SDK This repository contains the source for the ANARI API SDK. This includes: Front-end library API utilties and helpers (mostly for implementat

The Khronos Group 64 Jul 28, 2022
A bare metal SDK for the ESP32 & ESP32C3

MDK (Minimal Development Kit) - a baremetal ESP32/ESP32C3 SDK An bare metal, make-based SDK for the ESP32, ESP32C3 chips. It is written from scratch u

Sergey Lyubka 68 Jul 31, 2022
Korg logue SDK port of Freeverb

Freeverb reverberator for logue SDK This is a logue SDK port of Freeverb reverberator by Jezar at Dreampoint. See readme.txt for the original readme.

null 6 May 7, 2022
SDK for creating GTA IV .asi plugins

iv-sdk "SDK" for creating GTA IV .asi plugins Supports 1.0.7.0 and 1.0.8.0 (EFIGS only) The majority of the project has been created for 1.0.8.0 and t

null 23 Jun 12, 2022
SDK for building cross-platform desktop apps in ANSI-C

NAppGUI Cross-Platform C SDK. Build portable desktop applications for Windows, macOS and Linux, using just C. Quick start in Windows Prerequisites Vis

Francisco García Collado 211 Aug 5, 2022
Raspberry Pi Pico SDK Examples

Raspberry Pi Pico SDK Examples Getting started See Getting Started with the Raspberry Pi Pico and the README in the pico-sdk for information on gettin

Raspberry Pi 1.4k Aug 6, 2022
Simple C++ sample showing how to use OpenCL v1.2 on Windows/Linux/OSX with no 3rd party SDK installs

simple_opencl This is a simple and practical C++ sample showing how to use OpenCL v1.2 on Windows/Linux/OSX with no 3rd party SDK installs required un

Rich Geldreich 29 Jun 16, 2022
This is the development repo of Moai SDK.

Moai SDK is an embeddable cross-platform game development SDK written in C++ and scriptable in Lua. You can use Moai to write games or apps, or you ca

Zipline Games, Inc. 892 Jul 18, 2022
Sensory Cloud C++ SDK

Sensory Cloud C++ SDK This repository contains the source code for the Sensory Cloud C++ SDK. Requirements This project uses CMake as the primary buil

SensoryCloud 2 Jan 10, 2022