Skip to content

Commit ea721d0

Browse files
committed
Initial skeleton PRU project, with CI/CD
1 parent cdfd278 commit ea721d0

File tree

7 files changed

+65
-0
lines changed

7 files changed

+65
-0
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
- push
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
10+
- name: Install toolchain
11+
run: |
12+
wget https://github.com/dinuxbg/gnupru/releases/download/2025.05/pru-elf-2025.05.amd64.tar.xz
13+
tar xJf pru-elf-2025.05.amd64.tar.xz
14+
echo "$(pwd)/pru-elf/bin" >> $GITHUB_PATH
15+
16+
- name: Compile project
17+
run: make
18+
19+
- uses: actions/upload-artifact@v4
20+
with:
21+
name: pru_ledpwm
22+
path: pru_ledpwm.*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.o
2+
*.elf
3+
*.bin

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CC = pru-gcc
2+
OBJCOPY = pru-objcopy
3+
BUILD_TARGET = pru_ledpwm
4+
5+
ASFLAGS += -g
6+
CFLAGS += -g -Wall -Wno-main -Os
7+
LDFLAGS += -g -nostdlib -mmcu=am1808.pru1.specs
8+
9+
.PHONY: all clean
10+
11+
all: $(BUILD_TARGET).bin
12+
13+
$(BUILD_TARGET).bin: $(BUILD_TARGET).elf
14+
15+
$(BUILD_TARGET).elf: start.o main.o
16+
$(CC) $(LDFLAGS) -o $@ $+
17+
18+
%.bin: %.elf
19+
$(OBJCOPY) -O binary $< $@
20+
21+
clean:
22+
rm -rf *.o *.elf *.bin

device-specs/am1808.pru0.specs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*cpp_device:
2+
-D__AM1808_PRU0__ -D__AM1808__
3+
4+
*link_device:
5+
%{!r:--gc-sections --defsym=__IMEM_SIZE=4K --defsym=__DMEM_SIZE=512 --defsym=__HEAP_SIZE=0 --defsym=__STACK_SIZE=32 -z common-page-size=4 -z max-page-size=8}

device-specs/am1808.pru1.specs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*cpp_device:
2+
-D__AM1808_PRU1__ -D__AM1808__
3+
4+
*link_device:
5+
%{!r:--gc-sections --defsym=__IMEM_SIZE=4K --defsym=__DMEM_SIZE=512 --defsym=__HEAP_SIZE=0 --defsym=__STACK_SIZE=32 -z common-page-size=4 -z max-page-size=8}

main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
void main() {
2+
__halt();
3+
}

start.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.sect ".init0"
2+
.global _start
3+
4+
_start:
5+
jmp main

0 commit comments

Comments
 (0)