Skip to content

A simple "Hello World"-like project for the WHXY CW32F030 MCU

License

Notifications You must be signed in to change notification settings

islandcontroller/hello-cw32f030

Repository files navigation

hello-cw32f030 GitHub license

A simple "Hello World"-like project for the WHXY CW32F030 MCU.

This project contains a simple set of modules to get the MCU running in a minimal configuration:

  • LED blinky on pin PC13
  • Serial console via UART on pins PA9/PA8

Requirements

Usage

  • Clone this repository using the following command. Note the use of the --recursive tag.

    git clone --recursive https://github.com/islandcontroller/hello-cw32f030
    
  • Open the folder in VSCode

  • Connect debug probe

    • (WSL only) attach to WSL using usbipd attach --wsl --busid <...>. This needs to be completed before starting the Dev Container.
  • Run the command "Dev Containers: Reopen in Container"

    • Check if the debug probe is recognised as a connected USB device by running lsusb.

    • On first launch, you may need to install some udev rules on your host machine. Copy the files to your workspace by running setup-devcontainer inside the container.

    • Re-open the workspace on your host and run the install-rules script inside the .vscode/setup folder.

      cd .vscode/setup
      sudo ./install-rules
      
    • Afterwards, restart the devcontainer.

  • If prompted, select the "Arm GNU Toolchain x.x" CMake Kit.

  • Run "CMake: Configure"

  • Build using "CMake: Build [F7]"

  • Start debugging using "Debug: Start Debugging [F5]"

    • If you are using a SEGGER J-Link debug probe, run the following commands in the "Terminal" tab, in order to install the CW32F030 flashloader and the missing device definitions. Then, re-try programming the device.

      cd Controller/CW32F030/Tools
      ./install_jlink.sh
      
  • Continue execution once the breakpoint in main() is reached.

Serial console

Connect a USB-to-UART interface (e.g. FTDI) as follows:

Interface Board
RX A08 (PA8, UART1_TX)
TX A09 (PA9, UART1_RX)
GND GND

Then start a serial console in a "Terminal" tab (9600 Baud, 8N1):

cu -l /dev/ttyUSB0

Licensing

If not stated otherwise in the specific file, the contents of this project are licensed under the MIT License. The full license text is provided in the LICENSE file.

SPDX-License-Identifier: MIT

About

A simple "Hello World"-like project for the WHXY CW32F030 MCU

Topics

Resources

License

Stars

Watchers

Forks