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

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

Better Makefile CI, fix Run from RAM assembly, update platformio.ini
parents a4a05688 a5a53e08
No related branches found
No related tags found
No related merge requests found
name: PlatformIO CI
name: Build CI
on: [push, pull_request]
jobs:
find-examples: # Job that list subdirectories
runs-on: ubuntu-latest
outputs:
dir: ${{ steps.set-dirs.outputs.dir }} # generate output name dir by using inner step output
steps:
- uses: actions/checkout@v3
- id: set-dirs # Give it an id to handle to get step outputs in the outputs key above
run: echo "::set-output name=dir::$(find examples -name Makefile -print0 |xargs -0 -n 1 dirname | jq -R -s -c 'split("\n")[:-1]')"
# Define step output named dir base on ls command transformed to JSON thanks to jq
# Build using native Makefile buildsystem
makefile-build:
needs: [find-examples] # Depends on previous job
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: ${{fromJson(needs.find-examples.outputs.dir)}}
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 ../..
- name: Build ${{ matrix.example }}
run: cd ${{ matrix.example }} && make V=1 -j3 $(basename ${{ matrix.example }}.elf) && riscv64-unknown-elf-size $(basename ${{ matrix.example }}.elf)
# Build using PlatformIO
pio-build:
strategy:
......
......@@ -39,6 +39,7 @@ void RamFunction()
// But we turbo through twiddling a pin.
asm volatile("\n\
.option rvc\n\
li a0, 1 | (1<<4)\n\
li a1, (1<<16) | (1<<(16+4))\n\
la a2, 0x40011410 /* GPIO D*/ \n\
......
File moved
File moved
......@@ -8,13 +8,9 @@ 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>
; all environments use ch32v003 fun as base, no more ch32v003evt
extends = fun_base
; use a source filter to only build certain folders / files in later environments
; for examples that use ch32v003fun as their base
[fun_base]
......@@ -23,22 +19,31 @@ 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:bootload]
build_src_filter = ${fun_base.build_src_filter} +<examples/bootload>
[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:external_crystal]
build_src_filter = ${fun_base.build_src_filter} +<examples/external_crystal>
[env:optionbytes]
build_src_filter = ${fun_base.build_src_filter} +<examples/optionbytes>
[env:run_from_ram]
build_src_filter = ${fun_base.build_src_filter} +<examples/run_from_ram>
[env:sandbox]
build_src_filter = ${fun_base.build_src_filter} +<examples/sandbox>
[env:self_modify_code]
build_src_filter = ${fun_base.build_src_filter} +<examples/self_modify_code>
[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>
[env:ws2812bdemo]
build_src_filter = ${fun_base.build_src_filter} +<examples/ws2812bdemo>
\ No newline at end of file
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