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
- Hardware
- LCSC Boards "
LCKFB-DWX-CW32F030C8T6" CW32F030 development board - SEGGER J-Link debug probe (see also: islandcontroller/jtag-wire-adapter)
- LCSC Boards "
- Software
- Linux OS or WSL installation
- Docker Engine (running within WSL if applicable)
- VSCode Dev Containers extension
- (WSL only) usbipd-win
-
Clone this repository using the following command. Note the use of the
--recursivetag.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.
- (WSL only) attach to WSL using
-
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-devcontainerinside the container. -
Re-open the workspace on your host and run the
install-rulesscript inside the.vscode/setupfolder.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
CW32F030flashloader 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.
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
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
