# (c) Copyright 2021 by Coinkite Inc. This file is covered by license found in COPYING-CC.
#
# Build micropython for stm32 (an ARM processor). Also handles signing of resulting firmware images.
#
# COLDCARD Mk4 and Mk5 -- OLED display, calculator style.
#

BOARD = COLDCARD_MK4
FIRMWARE_BASE   = 0x08020000
BOOTLOADER_BASE = 0x08000000
HW_MODEL = mk
PARENT_MKFILE = MK-Makefile

# This is release of the bootloader that will be built into the factory.dfu
BOOTLOADER_VERSION = 3.3.0
BOOTLOADER_DIR = mk4-bootloader

LATEST_RELEASE = $(shell ls -t1 ../releases/*-mk-*.dfu ../releases/*-mk4-*.dfu | head -1) 

# Our version for this release.
# - caution, the bootrom will not accept version < 3.0.0
VERSION_STRING = 6.5.0X

# keep near top, because defined default target (all)
include shared.mk


# In another window: 
#
#		openocd -f openocd-mk4.cfg
#
# Can do:
# - "load" which writes the flash (medium speed, lots of output on st-util)
# - "cont" starts/continues system
# - "br main" sets breakpoints
# - "mon reset" to reset micro
# - and so on
#
debug:
	arm-none-eabi-gdb $(BUILD_DIR)/firmware.elf -x gogo-mk4.gdb

# EOF
