Environment Setup on Windows

Environment Setup on Windows#

This section provides a step-by-step guide to setting up the SDCC compiler on Windows operating systems. It also includes instructions for installing the necessary tools and configuring the environment variables. Additionally, it covers the installation of the pyusb library and updating the driver using Zadig.

Compiler Installation#

Follow these steps to install the necessary tools and files:

  1. Download or Clone the Repository

    You can either download the repository as a ZIP file or clone it using Git.

    1. Clone via Git

      Install Git for Windows from the official Git website. Then open a command prompt and run:

      git clone https://github.com/UNIT-Electronics-MX/unit_ch55x_sdk.git
      
    2. Download as ZIP

      Download the ZIP file from the GitHub repository and extract it to a desired location on your computer.

  2. Install CH372 Driver Download the latest version of the CH372 driver from the CH372 driver website.

  3. Install Python Download and install the latest version of Python from the official Python website.

  4. Install Editor Code Download and install the latest version of your preferred text editor. Some popular choices include Visual Studio Code, Sublime Text, and Notepad++.

  5. Install PlatformIO IDE Download and install the latest version of Platformio IDE from the visual studio code extensions like in the next image:

Installing PlatformIO IDE.

Fig. 4 Installing PlatformIO IDE#

You can also install PlatformIO IDE from the official Platformio website.

Tip

It is recommended to install the tools in the order listed above.

Caution

Remember to restart your computer after installing the tools.

Alternative Functionality#

WCHISPTool#

The WCHISPTool is an official programming tool provided by WCH. It is a Windows-based tool that allows users to flash firmware onto CH55x microcontrollers. To use the WCHISPTool, follow these steps:

  1. Download the WCHISPTool

    Download the WCHISPTool from the official WCH website.

  2. Install the WCHISPTool

    Install the WCHISPTool on your Windows computer by following the on-screen instructions.

  3. Connect the Device

    Connect your CH55x device to your computer using a USB cable. Ensure that the BOOT button is pressed while connecting the device.

  4. Flash the Program

    Open the WCHISPTool and select the appropriate firmware file. Click the “Download” button to flash the program onto the microcontroller.

Note

The WCHISPTool is a Windows-based tool and may not be compatible with other operating systems.

WCHISPTool interface

Fig. 5 WCHISPTool interface#

Warning

The WCHISPTool is an official tool provided by WCH and may have limitations compared to other flashing methods.

Note

Requires the ch372 driver to be installed.