1 Commits
v1.00 ... main

Author SHA1 Message Date
Philip Smart
c0d33737e1 Fix K64F build: make heap overrides ZPU-only for tbasic, kilo, ed
The tbasic, kilo, and ed apps unconditionally overrode HEAPADDR/HEAPSIZE
with ZPU BRAM addresses (0x1FFF5000+0x33000=0x20028000) that exceed the
K64F app CODE region. Wrapped overrides in ifeq ($(__ZPU__),1) so K64F
builds use the default heap/stack calculated by build.sh.

Also disabled mbasic K64F build (heap overrides + code size exceed CODE
region) — mbasic was already disabled for ZPU.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 12:18:55 +00:00
4 changed files with 23 additions and 1 deletions

View File

@@ -41,10 +41,14 @@ APP_COMMON_DIR = $(CURDIR)/../common
BASEDIR = ../../.. BASEDIR = ../../..
# Override values given by parent make for this application as its memory usage differs from the standard app. # Override values given by parent make for this application as its memory usage differs from the standard app.
# Only apply for ZPU builds - these addresses are within the ZPU's unified BRAM address space.
# K64F uses the default heap/stack calculated by build.sh which fits within the Cortex-M4 SRAM regions.
ifeq ($(__ZPU__),1)
override HEAPADDR = 0x1FFF5000 override HEAPADDR = 0x1FFF5000
override HEAPSIZE = 0x00033000 override HEAPSIZE = 0x00033000
override STACKADDR = 0x20028000 override STACKADDR = 0x20028000
override STACKSIZE = 0x00000000 override STACKSIZE = 0x00000000
endif
# Modules making up Kilo. # Modules making up Kilo.
APP_C_SRC = $(APP_COMMON_DIR)/sysutils.c $(APP_COMMON_DIR)/ctypelocal.c APP_C_SRC = $(APP_COMMON_DIR)/sysutils.c $(APP_COMMON_DIR)/ctypelocal.c

View File

@@ -41,10 +41,14 @@ APP_COMMON_DIR = $(CURDIR)/../common
BASEDIR = ../../.. BASEDIR = ../../..
# Override values given by parent make for this application as its memory usage differs from the standard app. # Override values given by parent make for this application as its memory usage differs from the standard app.
# Only apply for ZPU builds - these addresses are within the ZPU's unified BRAM address space.
# K64F uses the default heap/stack calculated by build.sh which fits within the Cortex-M4 SRAM regions.
ifeq ($(__ZPU__),1)
override HEAPADDR = 0x1FFF5000 override HEAPADDR = 0x1FFF5000
override HEAPSIZE = 0x00033000 override HEAPSIZE = 0x00033000
override STACKADDR = 0x20028000 override STACKADDR = 0x20028000
override STACKSIZE = 0x00000000 override STACKSIZE = 0x00000000
endif
# Modules making up Kilo. # Modules making up Kilo.
APP_C_SRC = $(APP_COMMON_DIR)/sysutils.c $(APP_COMMON_DIR)/ctypelocal.c APP_C_SRC = $(APP_COMMON_DIR)/sysutils.c $(APP_COMMON_DIR)/ctypelocal.c

View File

@@ -43,6 +43,8 @@ COMMON_DIR = $(CURDIR)../../common
BASEDIR = ../../.. BASEDIR = ../../..
# Override values given by parent make for this application as its memory usage differs from the standard app. # Override values given by parent make for this application as its memory usage differs from the standard app.
# mbasic only builds on K64F (ZPU build disabled due to missing maths libraries).
# These overrides extend the CODE region to encompass the larger heap needed by the BASIC interpreter.
override HEAPADDR = 0x2000C000 override HEAPADDR = 0x2000C000
override HEAPSIZE = 0x0001BC00 override HEAPSIZE = 0x0001BC00
override STACKADDR = 0x20027C00 override STACKADDR = 0x20027C00
@@ -62,7 +64,15 @@ FILTER2 = $(filter-out $(filter HEAPSIZE=%,$(FILTER1)), $(FILTER1))
NEWMAKEFLAGS = $(FILTER2) HEAPADDR=$(HEADADDR) HEAPSIZE=$(HEAPSIZE) NEWMAKEFLAGS = $(FILTER2) HEAPADDR=$(HEADADDR) HEAPSIZE=$(HEAPSIZE)
ifeq ($(__K64F__),1) ifeq ($(__K64F__),1)
include $(APP_DIR)/Makefile.k64f # Currently mbasic doesnt build on K64F - heap/stack overrides exceed the app CODE region.
# TODO: Rework memory layout to fit within K64F SRAM constraints.
#include $(APP_DIR)/Makefile.k64f
clean:
all:
install:
else else
# Currently mbasic doesnt build on the ZPU due to missing maths libraries. Once I can source them it should build. # Currently mbasic doesnt build on the ZPU due to missing maths libraries. Once I can source them it should build.
#include $(APP_DIR)/Makefile.zpu #include $(APP_DIR)/Makefile.zpu

View File

@@ -41,10 +41,14 @@ APP_COMMON_DIR = $(CURDIR)/../common
BASEDIR = ../../.. BASEDIR = ../../..
# Override values given by parent make for this application as its memory usage differs from the standard app. # Override values given by parent make for this application as its memory usage differs from the standard app.
# Only apply for ZPU builds - these addresses are within the ZPU's unified BRAM address space.
# K64F uses the default heap/stack calculated by build.sh which fits within the Cortex-M4 SRAM regions.
ifeq ($(__ZPU__),1)
override HEAPADDR = 0x1FFF5000 override HEAPADDR = 0x1FFF5000
override HEAPSIZE = 0x00033000 override HEAPSIZE = 0x00033000
override STACKADDR = 0x20028000 override STACKADDR = 0x20028000
override STACKSIZE = 0x00000000 override STACKSIZE = 0x00000000
endif
# Modules making up Kilo. # Modules making up Kilo.
APP_C_SRC = basic_main.c basic_editor.c basic_exectoks.c basic_expr.c basic_tokens.c basic_utils.c $(APP_COMMON_DIR)/sysutils.c APP_C_SRC = basic_main.c basic_editor.c basic_exectoks.c basic_expr.c basic_tokens.c basic_utils.c $(APP_COMMON_DIR)/sysutils.c