Skip to content

Commit

Permalink
Adjust GitHub Action and fix broken release
Browse files Browse the repository at this point in the history
  • Loading branch information
aw committed Jan 10, 2023
1 parent 0e84ac6 commit 4c0bb52
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 16 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ jobs:
- name: Build the FiveForths firmware binary for ${{matrix.device}}
run: make ${{matrix.device}}

- name: Obtain SHA256 hash of the firmware ${{matrix.device}}.bin
run: sha256sum fiveforths.bin > fiveforths.bin.sha256
- name: Rename firmware binary file
run: mv fiveforths.bin fiveforths-${{matrix.device}}.bin

- name: Obtain SHA256 hash of the firmware
run: sha256sum fiveforths-${{matrix.device}}.bin > fiveforths-${{matrix.device}}.bin.sha256

- uses: actions/upload-artifact@v3
with:
name: fiveforths-firmware-${{matrix.device}}
path: fiveforths.bin*
path: fiveforths-${{matrix.device}}.bin*
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Alexander Williams, On-Prem <[email protected]>
Copyright (c) 2021~ Alexander Williams, https://a1w.ca

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Makefile for building and testing

PROGNAME = fiveforths
FIRMWARE ?= $(PROGNAME).bin
DEVICE ?= /dev/ttyUSB0
CFLAGS := -g
CROSS ?= /usr/bin/riscv64-unknown-elf-
AS := $(CROSS)as
Expand Down Expand Up @@ -48,6 +50,9 @@ openocd:
debug:
/opt/riscv/bin/riscv64-unknown-elf-gdb -command=debug.gdb -q fiveforths.elf

flash:
stm32loader -p $(DEVICE) -ewv $(FIRMWARE)

longan-nano:
$(MAKE) build BOARD=longan-nano

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 32-bit RISC-V Forth for microcontrollers
# FiveForths: 32-bit RISC-V Forth for microcontrollers

[![GitHub release](https://img.shields.io/github/release/aw/fiveforths.svg)](https://github.com/aw/fiveforths)

Expand Down Expand Up @@ -139,6 +139,7 @@ Please create a pull-request or [open an issue](https://github.com/aw/picolisp-k
* Fix issue #9 - Handling of carriage return
* Fix issue #11 - Ignore non-printable characters
* Re-organize code to support different boards and MCUs
* Add boot message when the device is reset
* Add GitHub action to automatically build and publish the firmware binaries

## 0.1 2023-01-09 - First release
Expand All @@ -160,4 +161,4 @@ This document would be incomplete without listing other Forths which inspired me

[MIT License](LICENSE)

Copyright (c) 2021~ Alexander Williams, On-Prem <[email protected]>
Copyright (c) 2021~ [Alexander Williams](https://a1w.ca)
8 changes: 7 additions & 1 deletion fiveforths.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FiveForths - https://github.com/aw/FiveForths
RISC-V Forth implementation
The MIT License (MIT)
Copyright (c) 2021 Alexander Williams, On-Prem <[email protected]>
Copyright (c) 2021~ Alexander Williams, https://a1w.ca
*/

##
Expand All @@ -19,6 +19,12 @@ Copyright (c) 2021 Alexander Williams, On-Prem <[email protected]>
# s1 = IP = instruction pointer
# s2 = RSP = return stack pointer

# Ensure the _start entry label is defined first
.text
.global _start
_start:
j boot

# include board-specific functions and constants from src/boards/<board>/
.include "board.s"

Expand Down
2 changes: 1 addition & 1 deletion src/01-variables-constants.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Variables and constants
##

.equ FORTH_VERSION, 1
.equ FORTH_VERSION, 2

##
# Memory map
Expand Down
5 changes: 0 additions & 5 deletions src/03-interrupts.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
# Interrupts
##

.text
.global _start
_start:
j boot

.balign CELL
.global interrupt_handler
.type interrupt_handler, @function
Expand Down
11 changes: 8 additions & 3 deletions src/06-initialization.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# Initialization
##

.text
.global _start

# board boot initializations
boot:
call interrupt_init # RISC-V interrupt CSR initialization
Expand All @@ -21,6 +18,12 @@ boot:
li t1, LATEST # load LATEST variable
sw t0, 0(t1) # initialize LATEST variable to contain word_SEMI memory address

# display boot message
la a1, msg_boot # load string message
addi a2, a1, 74 # load string length
call uart_print # call uart print function
j reset

# reset the Forth stack pointers, registers, variables, and state
reset:
# initialize stack pointers
Expand Down Expand Up @@ -53,3 +56,5 @@ tib_zerofill:
j tib_zerofill # repeat
tib_done:
j interpreter_start # jump to the main interpreter REPL

msg_boot: .ascii "FiveForths v0.2, Copyright (c) 2021~ Alexander Williams, https://a1w.ca \n\n"

0 comments on commit 4c0bb52

Please sign in to comment.