# (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.
#
# MARK 4 with different chip and layout
#

BOARD = COLDCARD_MK4
FIRMWARE_BASE   = 0x08020000
BOOTLOADER_BASE = 0x08000000
HW_MODEL = mk4
PARENT_MKFILE = MK4-Makefile

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

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

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

# 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
