Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/arm-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,18 @@ jobs:
- name: Build LM4F120 (TARGET=LM4)
run: cd arm/mcu/lm4f120 && TARGET=LM4 make all

- name: Build LM4120 (WANT_IGNORECASE)
run: cd arm/mcu/lm4f120 && WANT_IGNORECASE=1 make all

- name: Cache and Install QEMU ARM
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: qemu-system-arm
version: 1 # Change this to manually bust the cache

- name: LM4F120 Core Tests (WANT_ITC)
run: cd arm/mcu/lm4f120 && TIMEOUT=5s make tests

- name: Build QEMU virt (WANT_ITC)
run: cd arm/mcu/qemu && WANT_IGNORECASE=1 WANT_ITC=1 make all

Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/arm-linux-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ jobs:
make segments
make sections

# - name: Cache and Install QEMU USER ARM
# uses: awalsh128/cache-apt-pkgs-action@latest
# with:
# packages: qemu-user-static
# version: 1 # Change this to manually bust the cache
- name: Cache and Install QEMU USER ARM
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: qemu-user-static
version: 1 # Change this to manually bust the cache

# - name: QEMU Core Tests
# run: cd arm/mcu/linux && TIMEOUT=5s make tests
- name: QEMU Core Tests
run: cd arm/mcu/linux && TIMEOUT=5s make tests

- name: Build Linux/RaspPi (WANT_ITC)
run: cd arm/mcu/linux && WANT_ITC=1 make all
run: cd arm/mcu/linux && WANT_IGNORECASE=1 WANT_ITC=1 make all

# - name: QEMU Core Tests (WANT_ITC)
# run: cd arm/mcu/linux && TIMEOUT=5s make tests
- name: QEMU Core Tests (WANT_ITC)
run: cd arm/mcu/linux && TIMEOUT=5s make tests

- name: Update Refcards
if: github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion arm/mcu/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif
# Included after various configuration bits are defined (importantly MCU_LD)
include $(AMFORTH)/arm/dev/Makefile

LDFLAGS += -z max-page-size=4096
LDFLAGS += -no-pie -static -z max-page-size=4096
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These flags don't fix anything but should be there as they indicate to the linker that the code is not meant to be relocated.


# To run amforth in emulated container you can use a container runtime that supports --platform linux/arm/v7
# For MacOS check out https://orbstack.dev/ (Free for personal use)
Expand Down
10 changes: 10 additions & 0 deletions arm/mcu/linux/amforth.s
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ _start:

ldr r0, =PFA_COLD
bx r0 @ Switch to thumb mode

/*
It seems qemu-arm-static really dislikes having a tiny text segment, next to the large forth segment.
The small .text section ends up not loading correctly, it is allocated but filled with zeros, thus segfault.
It seems allocating a page-worth of bytes in the intervening .data section helps the qemu elf loader work correctly.
*/
.data
.space 0x1000
.align 8

.thumb

.section amforth, "awx" @ Everything is writeable and executable
Expand Down
2 changes: 1 addition & 1 deletion arm/mcu/lm4f120/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AMFORTH ?= $(shell git rev-parse --show-toplevel)
include $(AMFORTH)/arm/dev/Makefile

## Upload bin file to the device
upload: build/amforth.elf
upload:
lm4flash build/amforth.bin

# QEMU's lm3s6965evb machine is not the LM4F120H5QR (m3 vs m4), but seems to be close enough.
Expand Down
2 changes: 1 addition & 1 deletion arm/mcu/ra4m1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ OPENOCD ?= openocd
# The touch1200bps often doesn't work, not sure why (check the -boot option maybe?)
# Double pressing the reset button is reliable.
## Upload bin file to the device
upload: build/amforth.bin touch1200bps
upload:
touch1200bps/touch1200bps /dev/$(MODEM)
$(BOSSAC) --debug --port=$(MODEM) --write build/amforth.bin --reset

Expand Down
Loading
Loading