summaryrefslogtreecommitdiff
path: root/prototype/fw/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'prototype/fw/Makefile')
-rw-r--r--prototype/fw/Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/prototype/fw/Makefile b/prototype/fw/Makefile
index db7952b..3fbd029 100644
--- a/prototype/fw/Makefile
+++ b/prototype/fw/Makefile
@@ -23,9 +23,9 @@ DEBUG ?= 1
OPT ?= 0
BUILDDIR ?= build
-BINARY := safetyreset.elf
+BINARY := rotohsm_proto_rotor.elf
LDSCRIPT := generic_stm32.ld
-DEVICE := STM32F302C8
+DEVICE := STM32F302CB
########################################################################################################################
@@ -53,6 +53,7 @@ C_SOURCES += $(MUSL_SOURCES)
PREFIX ?= arm-none-eabi-
+HOSTCC := gcc
CC := $(PREFIX)gcc
CPP := $(PREFIX)cpp
CXX := $(PREFIX)g++
@@ -102,6 +103,8 @@ COMMON_CFLAGS += -O$(OPT) -std=gnu11 -g
COMMON_CFLAGS += $(DEVICE_DEFINES)
COMMON_CFLAGS += -DDEBUG=$(DEBUG)
+HOST_CFLAGS += $(COMMON_CFLAGS)
+
# for musl
CFLAGS += -Dhidden=
@@ -193,6 +196,13 @@ $(BUILDDIR)/%.o: %.s
mkdir -p $(@D)
$(CC) $(COMMON_CFLAGS) $(CFLAGS) $(EXT_CFLAGS) -o $@ -c $<
+$(BUILDDIR)/crc32_test: src/crc32_test.c src/crc32.c
+ $(HOSTCC) $(HOST_CFLAGS) -o $@ $^
+
+.PHONY: run_tests
+run_tests: $(BUILDDIR)/crc32_test
+ $(PYTHON3) -m unittest test.crc32_ref
+
venv:
test -d venv || python3 -m venv --system-site-packages venv
source venv/bin/activate && pip install cxxfilt pyelftools libarchive matplotlib