Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Select the board to build for: if not given on the command line,
  2. # then default to WIPY
  3. BOARD ?= WIPY
  4. ifeq ($(wildcard boards/$(BOARD)/.),)
  5. $(error Invalid BOARD specified)
  6. endif
  7. # Make 'release' the default build type
  8. BTYPE ?= release
  9. # Port for flashing firmware
  10. PORT ?= /dev/ttyUSB1
  11. # If the build directory is not given, make it reflect the board name.
  12. BUILD ?= build/$(BOARD)/$(BTYPE)
  13. include ../../py/mkenv.mk
  14. -include ../../localconfig.mk
  15. CROSS_COMPILE ?= arm-none-eabi-
  16. 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
  17. CFLAGS = -Wall -Wpointer-arith -Werror -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) -Os
  18. CFLAGS += -g -ffunction-sections -fdata-sections -fno-common -fsigned-char -mno-unaligned-access
  19. CFLAGS += -Iboards/$(BOARD)
  20. CFLAGS += $(CFLAGS_MOD)
  21. LDFLAGS = -Wl,-nostdlib -Wl,--gc-sections -Wl,-Map=$@.map
  22. FLASH_SIZE_WIPY = 2M
  23. FLASH_SIZE_LAUNCHXL = 1M
  24. ifeq ($(BTARGET), application)
  25. # qstr definitions (must come before including py.mk)
  26. QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h
  27. # include MicroPython make definitions
  28. include $(TOP)/py/py.mk
  29. include application.mk
  30. else
  31. ifeq ($(BTARGET), bootloader)
  32. include bootmgr/bootloader.mk
  33. else
  34. $(error Invalid BTARGET specified)
  35. endif
  36. endif
  37. # always include MicroPython make rules
  38. include $(TOP)/py/mkrules.mk
  39. erase:
  40. cc3200tool -p $(PORT) format_flash --size $(FLASH_SIZE_$(BOARD))
  41. deploy:
  42. cc3200tool -p $(PORT) \
  43. write_file bootmgr/build/$(BOARD)/$(BTYPE)/bootloader.bin /sys/mcuimg.bin \
  44. write_file build/$(BOARD)/$(BTYPE)/mcuimg.bin /sys/factimg.bin
  45. # Files *.ucf and *ucf.signed.bin come from CC3200SDK-SERVICEPACK
  46. # package from http://www.ti.com/tool/cc3200sdk
  47. servicepack:
  48. cc3200tool -p $(PORT) \
  49. write_file --file-size=0x20000 --signature ota_1.0.1.6-2.7.0.0.ucf.signed.bin \
  50. ota_1.0.1.6-2.7.0.0.ucf /sys/servicepack.ucf