Skip to content
Snippets Groups Projects
Unverified Commit c4175d39 authored by CNLohr's avatar CNLohr Committed by GitHub
Browse files

Merge pull request #13 from Community-PIO-CH32V/master

Make project PlatformIO-compatible
parents 25727a36 9584a522
No related branches found
No related tags found
No related merge requests found
name: PlatformIO CI
on: [push, pull_request]
jobs:
# Build using native Makefile buildsystem
makefile-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential make libnewlib-dev gcc-riscv64-unknown-elf libusb-1.0-0-dev
- name: Build Blink Example
run: cd examples/blink && make V=1 -j3 blink.elf && riscv64-unknown-elf-size blink.elf && cd ../..
- name: Build debugprintfdemo Example
run: cd examples/debugprintfdemo && make V=1 -j3 debugprintfdemo.elf && riscv64-unknown-elf-size debugprintfdemo.elf && cd ../..
# currently not compiling: __get_dscratch0() not defined.
#- name: Build sandbox Example
# run: cd examples/sandbox && make V=1 -j3 sandbox.elf && riscv64-unknown-elf-size sandbox.elf && cd ../..
- name: Build uartdemo Example
run: cd examples/uartdemo && make V=1 -j3 uartdemo.elf && riscv64-unknown-elf-size uartdemo.elf && cd ../..
- name: Build ws2812 Example
run: cd examples/ws2812demo && make V=1 -j3 ws2812bdemo.elf && riscv64-unknown-elf-size ws2812bdemo.elf && cd ../..
# Build using PlatformIO
pio-build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: pio run
.pio
.vscode
*.elf
*.hex
*.lst
*.bin
*.map
......@@ -62,6 +62,12 @@ Currently, it ignores all the respone codes, except when querying the chip. But
Anyone who wants to write a good/nice utility should probably look at the code in this folder.
## VSCode + PlatformIO
This project can also be built, uploaded and debugged with VSCode and the PlatformIO extension. Simply clone and open this project in VSCode and have the PlatformIO extension installed.
See [here](https://github.com/Community-PIO-CH32V/platform-ch32v) for further details.
## Quick Reference
* Needed for programming/debugging: `SWIO` is on `PD1`
* Optional (not needed, can be configured as output if fuse set): `NRST` is on `PD7`
......
; see https://docs.platformio.org/en/latest/projectconf/index.html
[platformio]
src_dir = .
include_dir = .
[env]
platform = https://github.com/Community-PIO-CH32V/platform-ch32v.git
; or genericCH32V003A4M6 or whatever, see platform link
board = ch32v003f4p6_evt_r0
monitor_speed = 115200
; use a source filter to only build certain folders / files
; for examples that use ch32v003evt as their base
[evt_base]
board_build.ldscript = ch32v003evt/ch32v003.ld
build_flags = -flto -Ich32v003evt -lgcc
build_src_filter = +<ch32v003evt>
; for examples that use ch32v003fun as their base
[fun_base]
board_build.ldscript = ch32v003fun/ch32v003fun.ld
build_flags = -flto -Ich32v003fun -I/usr/include/newlib -DTINYVECTOR -lgcc
build_src_filter = +<ch32v003fun>
[env:blink]
extends = fun_base
build_src_filter = ${fun_base.build_src_filter} +<examples/blink>
[env:debugprintfdemo]
extends = fun_base
build_src_filter = ${fun_base.build_src_filter} +<examples/debugprintfdemo>
; sandbox demo does currently not compile (undefined reference to `__get_dscratch0')
;[env:sandbox]
;extends = fun_base
;build_src_filter = ${fun_base.build_src_filter} +<examples/sandbox>
[env:uartdemo]
extends = fun_base
build_src_filter = ${fun_base.build_src_filter} +<examples/uartdemo>
[env:ws2812demo]
extends = fun_base
build_src_filter = ${evt_base.build_src_filter} +<examples/ws2812demo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment