element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog CH32V003 RISC-V MCU and Embeetle IDE
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 21 Nov 2023 5:19 AM Date Created
  • Views 8040 views
  • Likes 13 likes
  • Comments 4 comments
  • ch32v003
  • embeetle
  • risc-v
Related
Recommended

CH32V003 RISC-V MCU and Embeetle IDE

ralphjy
ralphjy
21 Nov 2023

I was watching the Electromaker show on their YouTube channel last week and Ian mentioned the Electromaker Educator Blog "Embeetle IDE: The Best IDE for Coding RISC-V Microcontrollers?" where Robin Mitchell describes using the Embeetle IDE to program low cost CH32V RISC-V MCUs.

I wanted to try out the CH32V parts when they were introduced last year, but it was yet another low cost Chinese part with yet another development platform to learn (MounRiver Studio IDE).  I've heard some good things about Embeetle, so the blog inspired me to give it a try with the CH32V.  The CH32V is a series of RISC-V MCUs made by WCH (NanjingQinhengMicroelectronics).  The parts and evaluation boards are available at AliExpress for under $5 including shipping.  Of course, I don't have the patience to wait 3 weeks for a shipment from China so I bought a CH32V003 Development Kit on Amazon for quite a bit more.

image

This particular development board requires a debugger/programmer to flash the MCU, so I bought the kit that included the WCH-LinkE programmer.  Guess since it also came with 5 individual ICs that I may have to do a PCB in the future Smile.

 This is a low end IC, but it has enough memory, IO, and peripherals for simple projects.

image

image

Embeetle IDE

The good news and bad news about the Embeetle IDE is that projects are all self-contained, i.e. all the necessary files, configurations, and dependencies are bundled within the project directories.  That should improve the portability of projects.  To that end, I decided that I would put the IDE and all the projects on a 16GB USB stick so that I can test how portable this really is.

The IDE itself isn't that large to download ~300MB for a zip file.  It expands to a bit over 4GB when extracted and updated.

image

image

When the Embeetle IDE is started, the Homepage allows you to create or import new projects or open existing projects:

image

There are currently 4 WCH boards supported representing 4 of their MCU types:

image

I created a project for my board that I called ch32v003-test.  That created a template with the requisite "blinky" code.  It identified that I was missing some of the required riscv toolchain elements and downloaded them for me:

image

image

/********************************** (C) COPYRIGHT *******************************
 * File Name          : main.c
 * Author             : WCH
 * Version            : V1.0.0
 * Date               : 2022/08/08
 * Description        : Main program body.
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for 
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/

/*
 *@Note
 GPIO routine:
 PD0 push-pull output.

*/

#include "debug.h"

/* Global define */

/* Global Variable */

/*********************************************************************
 * @fn      GPIO_Toggle_INIT
 *
 * @brief   Initializes GPIOA.0
 *
 * @return  none
 */
void GPIO_Toggle_INIT(void)
{
    GPIO_InitTypeDef GPIO_InitStructure = {0};

    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOD, &GPIO_InitStructure);
}

/*********************************************************************
 * @fn      main
 *
 * @brief   Main program.
 *
 * @return  none
 */
int main(void)
{
    u8 i = 0;

    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
    Delay_Init();
    USART_Printf_Init(115200);
    printf("SystemClk:%d\r\n", SystemCoreClock);

    printf("GPIO Toggle TEST\r\n");
    GPIO_Toggle_INIT();

    while(1)
    {
        Delay_Ms(250);
        GPIO_WriteBit(GPIOD, GPIO_Pin_0, (i == 0) ? (i = Bit_SET) : (i = Bit_RESET));
    }
}

Then you just need to build the project, hook up the the board and programmer and flash the code.  That's where I was impressed by the IDE documentation.  

I could drill down to wch/boards/ch32v003f4p6-evt-r0-1v1 and find a detailed hardware description of the board and even see a connection diagram for the debugger/programmer link.

 image

Here's my test setup:

image

And the blinking LED:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

The Embeetle IDE supports the core peripheral functions UART, I2C, SPI, and ADC for this part.  I found some sample code that was used with the MounRiverStudio IDE and I modified the I2C example to see if my setup would work with an SSD1306 OLED display and that was successful:

image

I'll need to think up a good project and try adding some sensors.

The Embeetle IDE has worked well so far.  I need to learn a bit more and also test its portability.  I want to try it with a few of the NXP and STmicro boards that it supports and of course, the RPi Pico.  Unfortunately, it does not currently support the majority of boards that I use.

  • Sign in to reply
  • kmulier
    kmulier over 1 year ago

    Hi ralphjy ,

    I'm one of the Embeetle IDE co-founders.

    Great article you wrote here!

    You're welcome on our forum: https://forum.embeetle.com/

    And let's connect on LinkedIn: https://www.linkedin.com/in/kristof-mulier-686919109/

    Kind regards,

    Kristof

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 1 year ago

    Nice post, interesting little device.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 1 year ago

    Very interesting tool kit and parts! Thanks for sharing.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • javagoza
    javagoza over 1 year ago

    Thanks for sharing. We will see if what they promise is true: "make programming microcontrollers fun again!"

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube