2015-02-06 09:35:48 -05:00
|
|
|
# Select the board to build for: if not given on the command line,
|
2015-05-28 07:22:26 -04:00
|
|
|
# then default to WIPY
|
|
|
|
BOARD ?= WIPY
|
2015-02-06 09:35:48 -05:00
|
|
|
ifeq ($(wildcard boards/$(BOARD)/.),)
|
|
|
|
$(error Invalid BOARD specified)
|
|
|
|
endif
|
|
|
|
|
2015-05-28 07:22:26 -04:00
|
|
|
# Make 'release' the default build type
|
2015-02-28 06:20:04 -05:00
|
|
|
BTYPE ?= release
|
|
|
|
|
2016-12-29 08:57:00 -05:00
|
|
|
# Port for flashing firmware
|
|
|
|
PORT ?= /dev/ttyUSB1
|
|
|
|
|
2015-02-06 09:35:48 -05:00
|
|
|
# If the build directory is not given, make it reflect the board name.
|
2015-02-28 06:20:04 -05:00
|
|
|
BUILD ?= build/$(BOARD)/$(BTYPE)
|
2015-02-06 09:35:48 -05:00
|
|
|
|
2017-09-06 00:09:13 -04:00
|
|
|
include ../../py/mkenv.mk
|
2015-02-06 09:35:48 -05:00
|
|
|
-include ../../localconfig.mk
|
|
|
|
|
|
|
|
CROSS_COMPILE ?= arm-none-eabi-
|
|
|
|
|
|
|
|
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -march=armv7e-m -mabi=aapcs -mcpu=cortex-m4 -msoft-float -mfloat-abi=soft -fsingle-precision-constant -Wdouble-promotion
|
2022-10-08 08:08:53 -04:00
|
|
|
CFLAGS += -Wall -Wpointer-arith -Werror -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) -Os
|
2015-02-06 09:35:48 -05:00
|
|
|
CFLAGS += -g -ffunction-sections -fdata-sections -fno-common -fsigned-char -mno-unaligned-access
|
|
|
|
CFLAGS += -Iboards/$(BOARD)
|
|
|
|
|
2022-07-20 03:30:16 -04:00
|
|
|
# Workaround gcc 12.1 bug.
|
|
|
|
CFLAGS += -Wno-array-bounds
|
|
|
|
|
2022-10-08 08:08:53 -04:00
|
|
|
LDFLAGS += -Wl,-nostdlib -Wl,--gc-sections -Wl,-Map=$@.map
|
2015-02-06 09:35:48 -05:00
|
|
|
|
2016-12-29 08:57:00 -05:00
|
|
|
FLASH_SIZE_WIPY = 2M
|
|
|
|
FLASH_SIZE_LAUNCHXL = 1M
|
|
|
|
|
2015-02-06 09:35:48 -05:00
|
|
|
ifeq ($(BTARGET), application)
|
|
|
|
# qstr definitions (must come before including py.mk)
|
|
|
|
QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h
|
ports: Enable error text compression for various ports, but not all.
Enabled on: bare-arm, minimal, unix coverage/dev/minimal, stm32, esp32,
esp8266, cc3200, teensy, qemu-arm, nrf. Not enabled on others to be able
to test the code when the feature is disabled (the default case).
Code size change for this commit:
bare-arm: -600 -0.906%
minimal x86: -308 -0.208%
unix x64: +0 +0.000%
unix nanbox: +0 +0.000%
stm32: -3368 -0.869% PYBV10
cc3200: -1024 -0.558%
esp8266: -2512 -0.368% GENERIC
esp32: -2876 -0.205% GENERIC[incl -3168(data)]
nrf: -1708 -1.173% pca10040
samd: +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
2020-03-04 05:56:44 -05:00
|
|
|
|
|
|
|
# MicroPython feature configurations
|
|
|
|
MICROPY_ROM_TEXT_COMPRESSION ?= 1
|
|
|
|
|
2015-02-06 09:35:48 -05:00
|
|
|
# include MicroPython make definitions
|
2017-08-10 22:22:19 -04:00
|
|
|
include $(TOP)/py/py.mk
|
2022-06-17 12:11:30 -04:00
|
|
|
include $(TOP)/extmod/extmod.mk
|
2015-02-06 09:35:48 -05:00
|
|
|
include application.mk
|
|
|
|
else
|
|
|
|
ifeq ($(BTARGET), bootloader)
|
|
|
|
include bootmgr/bootloader.mk
|
|
|
|
else
|
|
|
|
$(error Invalid BTARGET specified)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# always include MicroPython make rules
|
2017-08-10 22:22:19 -04:00
|
|
|
include $(TOP)/py/mkrules.mk
|
2016-12-29 08:57:00 -05:00
|
|
|
|
|
|
|
erase:
|
|
|
|
cc3200tool -p $(PORT) format_flash --size $(FLASH_SIZE_$(BOARD))
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
cc3200tool -p $(PORT) \
|
|
|
|
write_file bootmgr/build/$(BOARD)/$(BTYPE)/bootloader.bin /sys/mcuimg.bin \
|
|
|
|
write_file build/$(BOARD)/$(BTYPE)/mcuimg.bin /sys/factimg.bin
|
|
|
|
|
|
|
|
# Files *.ucf and *ucf.signed.bin come from CC3200SDK-SERVICEPACK
|
|
|
|
# package from http://www.ti.com/tool/cc3200sdk
|
|
|
|
servicepack:
|
|
|
|
cc3200tool -p $(PORT) \
|
|
|
|
write_file --file-size=0x20000 --signature ota_1.0.1.6-2.7.0.0.ucf.signed.bin \
|
|
|
|
ota_1.0.1.6-2.7.0.0.ucf /sys/servicepack.ucf
|