shibosoftwaredev/f1c100s-linux-nema17-stepper-controller
A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.
- Version
- 0.4.56
- License
- unset
- Stars
- 0
firmware/stm32/Makefile
ARM_PREFIX ?= arm-none-eabi-
CC = $(ARM_PREFIX)gcc
HOST_CC ?= cc
CFLAGS = -std=c11 -Os -g -mcpu=cortex-m0plus -mthumb -ffreestanding -ffunction-sections -fdata-sections -Wall -Wextra -Werror -Ivendor
LDFLAGS = -nostartfiles -Wl,--gc-sections,-Map=build/motion.map -Tlinker.ld --specs=nosys.specs
.PHONY: all test clean
all: build/motion.bin
build/motion.elf: main.c motion.c motion.h current.c current.h limit.c limit.h linker.ld
mkdir -p build
$(CC) $(CFLAGS) main.c motion.c current.c limit.c $(LDFLAGS) -o $@
$(ARM_PREFIX)size $@
build/motion.bin: build/motion.elf
$(ARM_PREFIX)objcopy -O binary $< $@
test:
mkdir -p build
$(HOST_CC) -std=c11 -Wall -Wextra -Werror -fsanitize=address,undefined motion.c limit.c test_motion.c -o build/test_motion
./build/test_motion
$(HOST_CC) -std=c11 -Wall -Wextra -Werror -fsanitize=address,undefined current.c test_current.c -o build/test_current
./build/test_current
$(HOST_CC) -std=c11 -Wall -Wextra -Werror -fsanitize=address,undefined limit.c test_limit.c -o build/test_limit
./build/test_limit
clean:
$(RM) build/motion.elf build/motion.bin build/motion.map build/test_motion build/test_current build/test_limit