2018-07-02 17:51:06 -04:00
|
|
|
# Select the board to build for.
|
2018-06-29 15:22:31 -04:00
|
|
|
ifeq ($(BOARD),)
|
|
|
|
$(error You must provide a BOARD parameter)
|
|
|
|
else
|
|
|
|
ifeq ($(wildcard boards/$(BOARD)/.),)
|
|
|
|
$(error Invalid BOARD specified)
|
|
|
|
endif
|
2016-08-23 02:48:09 -04:00
|
|
|
endif
|
2016-08-19 23:24:04 -04:00
|
|
|
|
2016-08-23 02:48:09 -04:00
|
|
|
|
|
|
|
# If the build directory is not given, make it reflect the board name.
|
|
|
|
BUILD ?= build-$(BOARD)
|
|
|
|
|
2017-10-25 01:31:16 -04:00
|
|
|
include ../../py/mkenv.mk
|
2016-08-23 02:48:09 -04:00
|
|
|
include boards/$(BOARD)/mpconfigboard.mk
|
2017-11-01 14:01:34 -04:00
|
|
|
-include mpconfigport.mk
|
2016-08-19 23:24:04 -04:00
|
|
|
|
|
|
|
# qstr definitions (must come before including py.mk)
|
|
|
|
QSTR_DEFS = qstrdefsport.h
|
|
|
|
|
|
|
|
# include py core make definitions
|
2017-08-27 15:02:50 -04:00
|
|
|
include $(TOP)/py/py.mk
|
2016-08-19 23:24:04 -04:00
|
|
|
|
2017-09-22 21:05:51 -04:00
|
|
|
include $(TOP)/supervisor/supervisor.mk
|
|
|
|
|
2016-08-19 23:24:04 -04:00
|
|
|
CROSS_COMPILE = arm-none-eabi-
|
|
|
|
|
2016-09-20 18:16:12 -04:00
|
|
|
BOSSAC := tools/bossac_osx
|
2016-08-19 23:24:04 -04:00
|
|
|
|
2016-08-23 02:48:09 -04:00
|
|
|
HAL_DIR=hal/$(MCU_SERIES)
|
|
|
|
|
2017-09-22 21:05:51 -04:00
|
|
|
INC += -I. \
|
2017-10-25 01:31:16 -04:00
|
|
|
-I../.. \
|
2017-09-22 21:05:51 -04:00
|
|
|
-I../lib/mp-readline \
|
|
|
|
-I../lib/timeutils \
|
|
|
|
-Iasf4/$(CHIP_FAMILY) \
|
|
|
|
-Iasf4/$(CHIP_FAMILY)/hal/include \
|
|
|
|
-Iasf4/$(CHIP_FAMILY)/hal/utils/include \
|
|
|
|
-Iasf4/$(CHIP_FAMILY)/hri \
|
|
|
|
-Iasf4/$(CHIP_FAMILY)/hpl/core \
|
2018-02-21 16:30:26 -05:00
|
|
|
-Iasf4/$(CHIP_FAMILY)/hpl/gclk \
|
2017-09-22 21:05:51 -04:00
|
|
|
-Iasf4/$(CHIP_FAMILY)/hpl/pm \
|
|
|
|
-Iasf4/$(CHIP_FAMILY)/hpl/port \
|
2018-04-07 09:10:39 -04:00
|
|
|
-Iasf4/$(CHIP_FAMILY)/hpl/rtc \
|
2017-09-22 21:05:51 -04:00
|
|
|
-Iasf4/$(CHIP_FAMILY)/hpl/tc \
|
|
|
|
-Iasf4/$(CHIP_FAMILY)/include \
|
|
|
|
-Iasf4/$(CHIP_FAMILY)/CMSIS/Include \
|
|
|
|
-Iasf4_conf/$(CHIP_FAMILY) \
|
|
|
|
-Iboards/$(BOARD) \
|
|
|
|
-Iboards/ \
|
2018-06-15 19:16:21 -04:00
|
|
|
-Iperipherals/ \
|
2017-09-22 21:05:51 -04:00
|
|
|
-Ifreetouch \
|
2018-10-19 21:46:22 -04:00
|
|
|
-I../../lib/tinyusb/src \
|
|
|
|
-I../../supervisor/shared/usb \
|
2017-09-22 21:05:51 -04:00
|
|
|
-I$(BUILD)
|
|
|
|
|
|
|
|
BASE_CFLAGS = \
|
2016-08-31 16:37:43 -04:00
|
|
|
-fsingle-precision-constant \
|
2016-11-03 18:50:59 -04:00
|
|
|
-fno-strict-aliasing \
|
2016-08-31 16:37:43 -04:00
|
|
|
-Wdouble-promotion \
|
2016-11-03 18:50:59 -04:00
|
|
|
-Wno-endif-labels \
|
|
|
|
-Wstrict-prototypes \
|
|
|
|
-Werror-implicit-function-declaration \
|
|
|
|
-Wfloat-equal \
|
|
|
|
-Wundef \
|
|
|
|
-Wshadow \
|
|
|
|
-Wwrite-strings \
|
|
|
|
-Wsign-compare \
|
|
|
|
-Wmissing-format-attribute \
|
|
|
|
-Wno-deprecated-declarations \
|
|
|
|
-Wnested-externs \
|
|
|
|
-Wunreachable-code \
|
|
|
|
-Wcast-align \
|
2018-04-02 21:37:44 -04:00
|
|
|
-Wno-error=lto-type-mismatch \
|
2016-11-22 15:03:42 -05:00
|
|
|
-D__$(CHIP_VARIANT)__ \
|
2016-08-31 16:37:43 -04:00
|
|
|
-ffunction-sections \
|
|
|
|
-fdata-sections \
|
|
|
|
-fshort-enums \
|
2018-01-02 21:25:41 -05:00
|
|
|
-DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \
|
|
|
|
-DCIRCUITPY_CANARY_WORD=0xADAF00 \
|
|
|
|
-DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \
|
2016-11-03 18:50:59 -04:00
|
|
|
--param max-inline-insns-single=500
|
2016-08-19 23:24:04 -04:00
|
|
|
|
2018-12-04 21:22:23 -05:00
|
|
|
# Use these flags to debug build times and header includes.
|
2018-12-01 04:54:18 -05:00
|
|
|
# -ftime-report
|
|
|
|
# -H
|
2017-10-10 14:36:00 -04:00
|
|
|
# NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt.
|
2017-10-12 20:10:31 -04:00
|
|
|
|
2017-10-10 14:36:00 -04:00
|
|
|
ifeq ($(CHIP_FAMILY), samd21)
|
2018-10-19 21:46:22 -04:00
|
|
|
CFLAGS += -Os -DNDEBUG
|
|
|
|
# TinyUSB defines
|
2018-11-16 20:04:42 -05:00
|
|
|
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512
|
2017-10-10 14:36:00 -04:00
|
|
|
endif
|
2017-10-12 20:10:31 -04:00
|
|
|
|
2017-10-10 14:36:00 -04:00
|
|
|
ifeq ($(CHIP_FAMILY), samd51)
|
2018-11-13 13:43:18 -05:00
|
|
|
CFLAGS += -Os -DNDEBUG
|
2018-10-19 21:46:22 -04:00
|
|
|
# TinyUSB defines
|
2018-11-16 20:04:42 -05:00
|
|
|
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=256 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=256 -DCFG_TUD_MSC_BUFSIZE=1024
|
2017-10-10 14:36:00 -04:00
|
|
|
endif
|
|
|
|
|
2016-08-19 23:24:04 -04:00
|
|
|
#Debugging/Optimization
|
|
|
|
ifeq ($(DEBUG), 1)
|
2017-10-12 20:10:31 -04:00
|
|
|
# Turn on Python modules useful for debugging (e.g. uheap, ustack).
|
|
|
|
CFLAGS += -ggdb
|
2018-06-14 18:47:40 -04:00
|
|
|
# You may want to disable -flto if it interferes with debugging.
|
2018-11-16 20:04:42 -05:00
|
|
|
# CFLAGS += -flto
|
2018-06-14 18:47:40 -04:00
|
|
|
# You may want to enable these flags to make setting breakpoints easier.
|
2018-11-16 20:04:42 -05:00
|
|
|
CFLAGS += -fno-inline -fno-ipa-sra
|
2017-10-12 20:10:31 -04:00
|
|
|
ifeq ($(CHIP_FAMILY), samd21)
|
|
|
|
CFLAGS += -DENABLE_MICRO_TRACE_BUFFER
|
|
|
|
endif
|
2016-08-19 23:24:04 -04:00
|
|
|
else
|
2017-10-12 20:10:31 -04:00
|
|
|
# -finline-limit can shrink the image size.
|
|
|
|
# -finline-limit=80 or so is similar to not having it on.
|
|
|
|
# There is no simple default value, though.
|
2017-10-23 12:29:17 -04:00
|
|
|
ifdef INTERNAL_FLASH_FILESYSTEM
|
2018-09-12 17:19:43 -04:00
|
|
|
CFLAGS += -finline-limit=50
|
2017-10-12 20:10:31 -04:00
|
|
|
endif
|
2018-07-16 09:01:46 -04:00
|
|
|
ifdef CFLAGS_INLINE_LIMIT
|
|
|
|
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
|
|
|
|
endif
|
2017-10-12 20:10:31 -04:00
|
|
|
CFLAGS += -flto
|
2017-09-22 21:05:51 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)
|
|
|
|
|
|
|
|
ifeq ($(CHIP_FAMILY), samd21)
|
|
|
|
CFLAGS += \
|
|
|
|
-mthumb \
|
|
|
|
-mabi=aapcs-linux \
|
|
|
|
-mcpu=cortex-m0plus \
|
|
|
|
-msoft-float \
|
|
|
|
-mfloat-abi=soft \
|
|
|
|
-DSAMD21
|
|
|
|
endif
|
|
|
|
ifeq ($(CHIP_FAMILY), samd51)
|
|
|
|
CFLAGS += \
|
|
|
|
-mthumb \
|
|
|
|
-mabi=aapcs-linux \
|
|
|
|
-mcpu=cortex-m4 \
|
2017-10-10 14:36:00 -04:00
|
|
|
-mfloat-abi=hard \
|
2017-09-22 21:05:51 -04:00
|
|
|
-mfpu=fpv4-sp-d16 \
|
|
|
|
-DSAMD51
|
2016-08-19 23:24:04 -04:00
|
|
|
endif
|
|
|
|
|
Merge tag 'v1.8.6'
ESP8266 port uses SDK 2.0, has more heap, has support for 512k devices
This release brings some code size reductions to the core as well as
more tests and improved coverage which is now at 94.3%.
The time.ticks_diff(a, b) function has changed: the order of the arguments
has been swapped so that it behaves like "a - b", and it can now return a
negative number if "a" came before "b" (modulo the period of the ticks
functions).
For the ESP8266 port the Espressif SDK has been updated to 2.0.0, the
heap has been increased from 28k to 36k, and there is support for 512k
devices via "make 512k". upip is included by default as frozen bytecode.
The network module now allows access-point reconnection without WiFi
credentials, and exposes configuration for the station DHCP hostname. The
DS18B20 driver now handles negative temperatures, and NeoPixel and APA102
drivers handle 4 bytes-per-pixel LEDs.
For the CC3200 port there is now support for loading of precompiled .mpy
files and threading now works properly with interrupts.
A detailed list of changes follows.
py core:
- py.mk: automatically add frozen.c to source list if FROZEN_DIR is defined
- be more specific with MP_DECLARE_CONST_FUN_OBJ macros
- specialise builtin funcs to use separate type for fixed arg count
- {modbuiltins,obj}: use MP_PYTHON_PRINTER where possible
- modbuiltins: add builtin "slice", pointing to existing slice type
- add "delattr" builtin, conditional on MICROPY_CPYTHON_COMPAT
- sequence: fix reverse slicing of lists
- fix null pointer dereference in mpz.c, fix missing va_end in warning.c
- remove asserts that are always true in emitbc.c
- fix wrong assumption that m_renew will not move if shrinking
- change config default so m_malloc0 uses memset if GC not enabled
- add MICROPY_FLOAT_CONST macro for defining float constants
- move frozen bytecode Makefile rules from ports to common mk files
- strip leading dirs from frozen mpy files, so any path can be used
extmod:
- vfs_fat_file: check fatfs f_sync() and f_close() returns for errors
- vfs_fat_file: make file.close() a no-op if file already closed
- utime_mphal: ticks_diff(): switch arg order, return signed value
- utime_mphal: add MP_THREAD_GIL_EXIT/ENTER warppers for sleep functions
- utime_mphal: implement ticks_add(), add to all maintained ports
- utime_mphal: allow ticks functions period be configurable by a port
lib:
- utils/pyhelp.c: use mp_printf() instead of printf()
- utils/pyexec: add mp_hal_set_interrupt_char() prototype
- libm: move Thumb-specific sqrtf function to separate file
drivers:
- add "from micropython import const" when const is used
tools:
- upgrade upip to 1.1.4: fix error on unix when installing to non-existing
absolute path
- pip-micropython: remove deprecated wrapper tool
- check_code_size.sh: code size validation script for CI
- replace upip tarball with just source file, to make its inclusion as
frozen modules in multiple ports less magic
tests:
- extmod/vfs_fat: improve VFS test coverage
- basics/builtin_slice: add test for "slice" builtin name
- basics: add test for builtin "delattr"
- extmod/vfs_fat_fsusermount: improve fsusermount test coverage
- extmod/vfs_fat_oldproto: test old block device protocol
- basics/gc1: garbage collector threshold() coverage
- extmod/uhashlib_sha1: coverage for SHA1 algorithm
- extmod/uhashlib_sha256: rename sha256.py test
- btree1: fix out of memory error running on esp8266
- extmod/ticks_diff: test for new semantics of ticks_diff()
- extmod/framebuf1: test framebuffer pixel clear, and text function
minimal port:
- Makefile: split rule for firmware.bin generation
unix port:
- Makefile: remove references to deprecated pip-micropython
- modtime: use ticks_diff() implementation from extmod/utime_mphal.c
- mphalport.h: add warning of mp_hal_delay_ms() implementation
- modtime: switch ticks/sleep_ms/us() to utime_mphal
- fix symbol references for x86 Mac
- replace upip tarball with just source file
windows port:
- enable utime_mphal following unix, define mp_hal_ticks_*
- fix utime_mphal compilation for msvc
- implement mp_hal_ticks_cpu in terms of QueryPerformanceCounter
qemu-arm port:
- exclude ticks_diff test for qemu-arm port
- exclude extmod/vfs_fat_fileio.py test
- exclude new vfs_fat tests
- enable software floating point support, and float tests
stmhal port:
- modutime: refactor to use extmod's version of ticks_cpu
- refactor pin usage to use mp_hal_pin API
- led: refactor LED to use mp_hal_pin_output() init function
- Makefile: use standard rules for frozen module generation
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- enable SD power save (disable CLK on idle)
cc3200 port:
- use mp_raise_XXX helper functions to reduce code size
- mods/pybspi: allow "write" arg of read/readinto to be positional
- enable loading of precompiled .mpy files
- fix thread mutex's so threading works with interrupts
teensy port:
- update to provide new mp_hal_pin_XXX functions following stmhal
esp8266 port:
- Makefile: use latest esptool.py flash size auto-detection
- esp_init_data: auto-initialize system params with vendor SDK 2.0.0
- esp8266.ld: move help.o to iROM
- esp8266.ld: move modmachine.o to iROM
- esp8266.ld: move main.o to iROM
- add MP_FASTCODE modifier to put a function to iRAM
- main: mark nlr_jump_fail() as MP_FASTCODE
- modules/webrepl: enforce only one concurrent WebREPL connection
- etshal.h: add few more ESP8266 vendor lib prototypes
- modesp: add flash_user_start() function
- add support for building firmware version for 512K modules
- scripts: make neopixel/apa102 handle 4bpp LEDs with common code
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- modnetwork: config(): fix copy-paste error in setting "mac"
- scripts/port_diag: add descriptions for esf_buf types
- modnetwork.c: allows AP reconnection without WiFi credentials
- main: bump heap size to 36K
- etshal.h: add prototypes for SPIRead/SPIWrite/SPIEraseSector
- etshal.h: adjust size of MD5_CTX structure
- modules: fix negative temperature in ds18x20 driver
- rename "machine" module implementation to use contemporary naming
- rework webrepl_setup to run over wired REPL
- espneopixel.c: solve glitching LED issues with cpu at 80MHz
- include upip as a standard frozen bytecode module
- update docs for esptool 1.2.1/SDK 2.0 (--flash_size=detect)
- modnetwork.c: expose configuration for station DHCP hostname
zephyr port:
- implement utime module
- use board/SoC values for startup banner based on Zephyr config
- initial implementation of machine.Pin
- zephyr_getchar: update for recent Zephyr refactor of console hooks
- support time -> utime module "weaklink"
- README: update for the current featureset, add more info
- mpconfigport.h: move less important params to the bottom
- Makefile: allow to adjust heap size from make command line
- Makefile: update comments to the current state of affairs
- Makefile: allow to override Zephyr config from make command line
- Makefile: add minimal port
- Makefile: add -fomit-frame-pointer to reduce code size
- mphalport.h: update for new "unified" kernal API (sleep functions)
docs:
- machine.SPI: bring up to date with Hardware API, make vendor-neutral
- machine.SPI: improve descriptions of xfer methods
- library/builtins: add docs for delattr and slice
- library/network: reword intro paragraph
- library/network: typo fixes, consistent acronym capitalization
- library/index: update TOCs so builtins sorted before modules
- utime: document ticks_cpu() in more detail
- utime: describe new semantics of ticks_diff() (signed ring arithmetics)
- utime: add docs for ticks_add(), improvements for other ticks_*()
- esp8266: update for new WebREPL setup procedure
- */quickref.rst: use new semantics of ticks_diff()
- library/machine.Pin: update Pin docs to align with new HW API
travis:
- integrate tools/check_code_size.sh
- minimal: Use CROSS=1, for binary size check
examples:
- http_server_simplistic: add "not suitable for real use" note
- hwapi: example showing best practices for HW API usage in apps
- hwapi: add hwconfig for DragonBoard 410c
2016-11-14 13:20:16 -05:00
|
|
|
ifneq ($(FROZEN_DIR),)
|
|
|
|
# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
|
|
|
|
# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
|
|
|
|
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
|
2017-07-15 17:03:24 -04:00
|
|
|
CFLAGS += -Wno-error=lto-type-mismatch
|
Merge tag 'v1.8.6'
ESP8266 port uses SDK 2.0, has more heap, has support for 512k devices
This release brings some code size reductions to the core as well as
more tests and improved coverage which is now at 94.3%.
The time.ticks_diff(a, b) function has changed: the order of the arguments
has been swapped so that it behaves like "a - b", and it can now return a
negative number if "a" came before "b" (modulo the period of the ticks
functions).
For the ESP8266 port the Espressif SDK has been updated to 2.0.0, the
heap has been increased from 28k to 36k, and there is support for 512k
devices via "make 512k". upip is included by default as frozen bytecode.
The network module now allows access-point reconnection without WiFi
credentials, and exposes configuration for the station DHCP hostname. The
DS18B20 driver now handles negative temperatures, and NeoPixel and APA102
drivers handle 4 bytes-per-pixel LEDs.
For the CC3200 port there is now support for loading of precompiled .mpy
files and threading now works properly with interrupts.
A detailed list of changes follows.
py core:
- py.mk: automatically add frozen.c to source list if FROZEN_DIR is defined
- be more specific with MP_DECLARE_CONST_FUN_OBJ macros
- specialise builtin funcs to use separate type for fixed arg count
- {modbuiltins,obj}: use MP_PYTHON_PRINTER where possible
- modbuiltins: add builtin "slice", pointing to existing slice type
- add "delattr" builtin, conditional on MICROPY_CPYTHON_COMPAT
- sequence: fix reverse slicing of lists
- fix null pointer dereference in mpz.c, fix missing va_end in warning.c
- remove asserts that are always true in emitbc.c
- fix wrong assumption that m_renew will not move if shrinking
- change config default so m_malloc0 uses memset if GC not enabled
- add MICROPY_FLOAT_CONST macro for defining float constants
- move frozen bytecode Makefile rules from ports to common mk files
- strip leading dirs from frozen mpy files, so any path can be used
extmod:
- vfs_fat_file: check fatfs f_sync() and f_close() returns for errors
- vfs_fat_file: make file.close() a no-op if file already closed
- utime_mphal: ticks_diff(): switch arg order, return signed value
- utime_mphal: add MP_THREAD_GIL_EXIT/ENTER warppers for sleep functions
- utime_mphal: implement ticks_add(), add to all maintained ports
- utime_mphal: allow ticks functions period be configurable by a port
lib:
- utils/pyhelp.c: use mp_printf() instead of printf()
- utils/pyexec: add mp_hal_set_interrupt_char() prototype
- libm: move Thumb-specific sqrtf function to separate file
drivers:
- add "from micropython import const" when const is used
tools:
- upgrade upip to 1.1.4: fix error on unix when installing to non-existing
absolute path
- pip-micropython: remove deprecated wrapper tool
- check_code_size.sh: code size validation script for CI
- replace upip tarball with just source file, to make its inclusion as
frozen modules in multiple ports less magic
tests:
- extmod/vfs_fat: improve VFS test coverage
- basics/builtin_slice: add test for "slice" builtin name
- basics: add test for builtin "delattr"
- extmod/vfs_fat_fsusermount: improve fsusermount test coverage
- extmod/vfs_fat_oldproto: test old block device protocol
- basics/gc1: garbage collector threshold() coverage
- extmod/uhashlib_sha1: coverage for SHA1 algorithm
- extmod/uhashlib_sha256: rename sha256.py test
- btree1: fix out of memory error running on esp8266
- extmod/ticks_diff: test for new semantics of ticks_diff()
- extmod/framebuf1: test framebuffer pixel clear, and text function
minimal port:
- Makefile: split rule for firmware.bin generation
unix port:
- Makefile: remove references to deprecated pip-micropython
- modtime: use ticks_diff() implementation from extmod/utime_mphal.c
- mphalport.h: add warning of mp_hal_delay_ms() implementation
- modtime: switch ticks/sleep_ms/us() to utime_mphal
- fix symbol references for x86 Mac
- replace upip tarball with just source file
windows port:
- enable utime_mphal following unix, define mp_hal_ticks_*
- fix utime_mphal compilation for msvc
- implement mp_hal_ticks_cpu in terms of QueryPerformanceCounter
qemu-arm port:
- exclude ticks_diff test for qemu-arm port
- exclude extmod/vfs_fat_fileio.py test
- exclude new vfs_fat tests
- enable software floating point support, and float tests
stmhal port:
- modutime: refactor to use extmod's version of ticks_cpu
- refactor pin usage to use mp_hal_pin API
- led: refactor LED to use mp_hal_pin_output() init function
- Makefile: use standard rules for frozen module generation
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- enable SD power save (disable CLK on idle)
cc3200 port:
- use mp_raise_XXX helper functions to reduce code size
- mods/pybspi: allow "write" arg of read/readinto to be positional
- enable loading of precompiled .mpy files
- fix thread mutex's so threading works with interrupts
teensy port:
- update to provide new mp_hal_pin_XXX functions following stmhal
esp8266 port:
- Makefile: use latest esptool.py flash size auto-detection
- esp_init_data: auto-initialize system params with vendor SDK 2.0.0
- esp8266.ld: move help.o to iROM
- esp8266.ld: move modmachine.o to iROM
- esp8266.ld: move main.o to iROM
- add MP_FASTCODE modifier to put a function to iRAM
- main: mark nlr_jump_fail() as MP_FASTCODE
- modules/webrepl: enforce only one concurrent WebREPL connection
- etshal.h: add few more ESP8266 vendor lib prototypes
- modesp: add flash_user_start() function
- add support for building firmware version for 512K modules
- scripts: make neopixel/apa102 handle 4bpp LEDs with common code
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- modnetwork: config(): fix copy-paste error in setting "mac"
- scripts/port_diag: add descriptions for esf_buf types
- modnetwork.c: allows AP reconnection without WiFi credentials
- main: bump heap size to 36K
- etshal.h: add prototypes for SPIRead/SPIWrite/SPIEraseSector
- etshal.h: adjust size of MD5_CTX structure
- modules: fix negative temperature in ds18x20 driver
- rename "machine" module implementation to use contemporary naming
- rework webrepl_setup to run over wired REPL
- espneopixel.c: solve glitching LED issues with cpu at 80MHz
- include upip as a standard frozen bytecode module
- update docs for esptool 1.2.1/SDK 2.0 (--flash_size=detect)
- modnetwork.c: expose configuration for station DHCP hostname
zephyr port:
- implement utime module
- use board/SoC values for startup banner based on Zephyr config
- initial implementation of machine.Pin
- zephyr_getchar: update for recent Zephyr refactor of console hooks
- support time -> utime module "weaklink"
- README: update for the current featureset, add more info
- mpconfigport.h: move less important params to the bottom
- Makefile: allow to adjust heap size from make command line
- Makefile: update comments to the current state of affairs
- Makefile: allow to override Zephyr config from make command line
- Makefile: add minimal port
- Makefile: add -fomit-frame-pointer to reduce code size
- mphalport.h: update for new "unified" kernal API (sleep functions)
docs:
- machine.SPI: bring up to date with Hardware API, make vendor-neutral
- machine.SPI: improve descriptions of xfer methods
- library/builtins: add docs for delattr and slice
- library/network: reword intro paragraph
- library/network: typo fixes, consistent acronym capitalization
- library/index: update TOCs so builtins sorted before modules
- utime: document ticks_cpu() in more detail
- utime: describe new semantics of ticks_diff() (signed ring arithmetics)
- utime: add docs for ticks_add(), improvements for other ticks_*()
- esp8266: update for new WebREPL setup procedure
- */quickref.rst: use new semantics of ticks_diff()
- library/machine.Pin: update Pin docs to align with new HW API
travis:
- integrate tools/check_code_size.sh
- minimal: Use CROSS=1, for binary size check
examples:
- http_server_simplistic: add "not suitable for real use" note
- hwapi: example showing best practices for HW API usage in apps
- hwapi: add hwconfig for DragonBoard 410c
2016-11-14 13:20:16 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
|
2017-08-23 14:05:59 -04:00
|
|
|
# then invoke make with FROZEN_MPY_DIR=frozen or FROZEN_MPY_DIRS="dir1 dir2"
|
|
|
|
# (be sure to build from scratch).
|
|
|
|
|
|
|
|
ifneq ($(FROZEN_MPY_DIRS),)
|
Merge tag 'v1.8.6'
ESP8266 port uses SDK 2.0, has more heap, has support for 512k devices
This release brings some code size reductions to the core as well as
more tests and improved coverage which is now at 94.3%.
The time.ticks_diff(a, b) function has changed: the order of the arguments
has been swapped so that it behaves like "a - b", and it can now return a
negative number if "a" came before "b" (modulo the period of the ticks
functions).
For the ESP8266 port the Espressif SDK has been updated to 2.0.0, the
heap has been increased from 28k to 36k, and there is support for 512k
devices via "make 512k". upip is included by default as frozen bytecode.
The network module now allows access-point reconnection without WiFi
credentials, and exposes configuration for the station DHCP hostname. The
DS18B20 driver now handles negative temperatures, and NeoPixel and APA102
drivers handle 4 bytes-per-pixel LEDs.
For the CC3200 port there is now support for loading of precompiled .mpy
files and threading now works properly with interrupts.
A detailed list of changes follows.
py core:
- py.mk: automatically add frozen.c to source list if FROZEN_DIR is defined
- be more specific with MP_DECLARE_CONST_FUN_OBJ macros
- specialise builtin funcs to use separate type for fixed arg count
- {modbuiltins,obj}: use MP_PYTHON_PRINTER where possible
- modbuiltins: add builtin "slice", pointing to existing slice type
- add "delattr" builtin, conditional on MICROPY_CPYTHON_COMPAT
- sequence: fix reverse slicing of lists
- fix null pointer dereference in mpz.c, fix missing va_end in warning.c
- remove asserts that are always true in emitbc.c
- fix wrong assumption that m_renew will not move if shrinking
- change config default so m_malloc0 uses memset if GC not enabled
- add MICROPY_FLOAT_CONST macro for defining float constants
- move frozen bytecode Makefile rules from ports to common mk files
- strip leading dirs from frozen mpy files, so any path can be used
extmod:
- vfs_fat_file: check fatfs f_sync() and f_close() returns for errors
- vfs_fat_file: make file.close() a no-op if file already closed
- utime_mphal: ticks_diff(): switch arg order, return signed value
- utime_mphal: add MP_THREAD_GIL_EXIT/ENTER warppers for sleep functions
- utime_mphal: implement ticks_add(), add to all maintained ports
- utime_mphal: allow ticks functions period be configurable by a port
lib:
- utils/pyhelp.c: use mp_printf() instead of printf()
- utils/pyexec: add mp_hal_set_interrupt_char() prototype
- libm: move Thumb-specific sqrtf function to separate file
drivers:
- add "from micropython import const" when const is used
tools:
- upgrade upip to 1.1.4: fix error on unix when installing to non-existing
absolute path
- pip-micropython: remove deprecated wrapper tool
- check_code_size.sh: code size validation script for CI
- replace upip tarball with just source file, to make its inclusion as
frozen modules in multiple ports less magic
tests:
- extmod/vfs_fat: improve VFS test coverage
- basics/builtin_slice: add test for "slice" builtin name
- basics: add test for builtin "delattr"
- extmod/vfs_fat_fsusermount: improve fsusermount test coverage
- extmod/vfs_fat_oldproto: test old block device protocol
- basics/gc1: garbage collector threshold() coverage
- extmod/uhashlib_sha1: coverage for SHA1 algorithm
- extmod/uhashlib_sha256: rename sha256.py test
- btree1: fix out of memory error running on esp8266
- extmod/ticks_diff: test for new semantics of ticks_diff()
- extmod/framebuf1: test framebuffer pixel clear, and text function
minimal port:
- Makefile: split rule for firmware.bin generation
unix port:
- Makefile: remove references to deprecated pip-micropython
- modtime: use ticks_diff() implementation from extmod/utime_mphal.c
- mphalport.h: add warning of mp_hal_delay_ms() implementation
- modtime: switch ticks/sleep_ms/us() to utime_mphal
- fix symbol references for x86 Mac
- replace upip tarball with just source file
windows port:
- enable utime_mphal following unix, define mp_hal_ticks_*
- fix utime_mphal compilation for msvc
- implement mp_hal_ticks_cpu in terms of QueryPerformanceCounter
qemu-arm port:
- exclude ticks_diff test for qemu-arm port
- exclude extmod/vfs_fat_fileio.py test
- exclude new vfs_fat tests
- enable software floating point support, and float tests
stmhal port:
- modutime: refactor to use extmod's version of ticks_cpu
- refactor pin usage to use mp_hal_pin API
- led: refactor LED to use mp_hal_pin_output() init function
- Makefile: use standard rules for frozen module generation
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- enable SD power save (disable CLK on idle)
cc3200 port:
- use mp_raise_XXX helper functions to reduce code size
- mods/pybspi: allow "write" arg of read/readinto to be positional
- enable loading of precompiled .mpy files
- fix thread mutex's so threading works with interrupts
teensy port:
- update to provide new mp_hal_pin_XXX functions following stmhal
esp8266 port:
- Makefile: use latest esptool.py flash size auto-detection
- esp_init_data: auto-initialize system params with vendor SDK 2.0.0
- esp8266.ld: move help.o to iROM
- esp8266.ld: move modmachine.o to iROM
- esp8266.ld: move main.o to iROM
- add MP_FASTCODE modifier to put a function to iRAM
- main: mark nlr_jump_fail() as MP_FASTCODE
- modules/webrepl: enforce only one concurrent WebREPL connection
- etshal.h: add few more ESP8266 vendor lib prototypes
- modesp: add flash_user_start() function
- add support for building firmware version for 512K modules
- scripts: make neopixel/apa102 handle 4bpp LEDs with common code
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- modnetwork: config(): fix copy-paste error in setting "mac"
- scripts/port_diag: add descriptions for esf_buf types
- modnetwork.c: allows AP reconnection without WiFi credentials
- main: bump heap size to 36K
- etshal.h: add prototypes for SPIRead/SPIWrite/SPIEraseSector
- etshal.h: adjust size of MD5_CTX structure
- modules: fix negative temperature in ds18x20 driver
- rename "machine" module implementation to use contemporary naming
- rework webrepl_setup to run over wired REPL
- espneopixel.c: solve glitching LED issues with cpu at 80MHz
- include upip as a standard frozen bytecode module
- update docs for esptool 1.2.1/SDK 2.0 (--flash_size=detect)
- modnetwork.c: expose configuration for station DHCP hostname
zephyr port:
- implement utime module
- use board/SoC values for startup banner based on Zephyr config
- initial implementation of machine.Pin
- zephyr_getchar: update for recent Zephyr refactor of console hooks
- support time -> utime module "weaklink"
- README: update for the current featureset, add more info
- mpconfigport.h: move less important params to the bottom
- Makefile: allow to adjust heap size from make command line
- Makefile: update comments to the current state of affairs
- Makefile: allow to override Zephyr config from make command line
- Makefile: add minimal port
- Makefile: add -fomit-frame-pointer to reduce code size
- mphalport.h: update for new "unified" kernal API (sleep functions)
docs:
- machine.SPI: bring up to date with Hardware API, make vendor-neutral
- machine.SPI: improve descriptions of xfer methods
- library/builtins: add docs for delattr and slice
- library/network: reword intro paragraph
- library/network: typo fixes, consistent acronym capitalization
- library/index: update TOCs so builtins sorted before modules
- utime: document ticks_cpu() in more detail
- utime: describe new semantics of ticks_diff() (signed ring arithmetics)
- utime: add docs for ticks_add(), improvements for other ticks_*()
- esp8266: update for new WebREPL setup procedure
- */quickref.rst: use new semantics of ticks_diff()
- library/machine.Pin: update Pin docs to align with new HW API
travis:
- integrate tools/check_code_size.sh
- minimal: Use CROSS=1, for binary size check
examples:
- http_server_simplistic: add "not suitable for real use" note
- hwapi: example showing best practices for HW API usage in apps
- hwapi: add hwconfig for DragonBoard 410c
2016-11-14 13:20:16 -05:00
|
|
|
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
|
|
|
|
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
|
2017-07-15 17:03:24 -04:00
|
|
|
CFLAGS += -Wno-error=lto-type-mismatch
|
Merge tag 'v1.8.6'
ESP8266 port uses SDK 2.0, has more heap, has support for 512k devices
This release brings some code size reductions to the core as well as
more tests and improved coverage which is now at 94.3%.
The time.ticks_diff(a, b) function has changed: the order of the arguments
has been swapped so that it behaves like "a - b", and it can now return a
negative number if "a" came before "b" (modulo the period of the ticks
functions).
For the ESP8266 port the Espressif SDK has been updated to 2.0.0, the
heap has been increased from 28k to 36k, and there is support for 512k
devices via "make 512k". upip is included by default as frozen bytecode.
The network module now allows access-point reconnection without WiFi
credentials, and exposes configuration for the station DHCP hostname. The
DS18B20 driver now handles negative temperatures, and NeoPixel and APA102
drivers handle 4 bytes-per-pixel LEDs.
For the CC3200 port there is now support for loading of precompiled .mpy
files and threading now works properly with interrupts.
A detailed list of changes follows.
py core:
- py.mk: automatically add frozen.c to source list if FROZEN_DIR is defined
- be more specific with MP_DECLARE_CONST_FUN_OBJ macros
- specialise builtin funcs to use separate type for fixed arg count
- {modbuiltins,obj}: use MP_PYTHON_PRINTER where possible
- modbuiltins: add builtin "slice", pointing to existing slice type
- add "delattr" builtin, conditional on MICROPY_CPYTHON_COMPAT
- sequence: fix reverse slicing of lists
- fix null pointer dereference in mpz.c, fix missing va_end in warning.c
- remove asserts that are always true in emitbc.c
- fix wrong assumption that m_renew will not move if shrinking
- change config default so m_malloc0 uses memset if GC not enabled
- add MICROPY_FLOAT_CONST macro for defining float constants
- move frozen bytecode Makefile rules from ports to common mk files
- strip leading dirs from frozen mpy files, so any path can be used
extmod:
- vfs_fat_file: check fatfs f_sync() and f_close() returns for errors
- vfs_fat_file: make file.close() a no-op if file already closed
- utime_mphal: ticks_diff(): switch arg order, return signed value
- utime_mphal: add MP_THREAD_GIL_EXIT/ENTER warppers for sleep functions
- utime_mphal: implement ticks_add(), add to all maintained ports
- utime_mphal: allow ticks functions period be configurable by a port
lib:
- utils/pyhelp.c: use mp_printf() instead of printf()
- utils/pyexec: add mp_hal_set_interrupt_char() prototype
- libm: move Thumb-specific sqrtf function to separate file
drivers:
- add "from micropython import const" when const is used
tools:
- upgrade upip to 1.1.4: fix error on unix when installing to non-existing
absolute path
- pip-micropython: remove deprecated wrapper tool
- check_code_size.sh: code size validation script for CI
- replace upip tarball with just source file, to make its inclusion as
frozen modules in multiple ports less magic
tests:
- extmod/vfs_fat: improve VFS test coverage
- basics/builtin_slice: add test for "slice" builtin name
- basics: add test for builtin "delattr"
- extmod/vfs_fat_fsusermount: improve fsusermount test coverage
- extmod/vfs_fat_oldproto: test old block device protocol
- basics/gc1: garbage collector threshold() coverage
- extmod/uhashlib_sha1: coverage for SHA1 algorithm
- extmod/uhashlib_sha256: rename sha256.py test
- btree1: fix out of memory error running on esp8266
- extmod/ticks_diff: test for new semantics of ticks_diff()
- extmod/framebuf1: test framebuffer pixel clear, and text function
minimal port:
- Makefile: split rule for firmware.bin generation
unix port:
- Makefile: remove references to deprecated pip-micropython
- modtime: use ticks_diff() implementation from extmod/utime_mphal.c
- mphalport.h: add warning of mp_hal_delay_ms() implementation
- modtime: switch ticks/sleep_ms/us() to utime_mphal
- fix symbol references for x86 Mac
- replace upip tarball with just source file
windows port:
- enable utime_mphal following unix, define mp_hal_ticks_*
- fix utime_mphal compilation for msvc
- implement mp_hal_ticks_cpu in terms of QueryPerformanceCounter
qemu-arm port:
- exclude ticks_diff test for qemu-arm port
- exclude extmod/vfs_fat_fileio.py test
- exclude new vfs_fat tests
- enable software floating point support, and float tests
stmhal port:
- modutime: refactor to use extmod's version of ticks_cpu
- refactor pin usage to use mp_hal_pin API
- led: refactor LED to use mp_hal_pin_output() init function
- Makefile: use standard rules for frozen module generation
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- enable SD power save (disable CLK on idle)
cc3200 port:
- use mp_raise_XXX helper functions to reduce code size
- mods/pybspi: allow "write" arg of read/readinto to be positional
- enable loading of precompiled .mpy files
- fix thread mutex's so threading works with interrupts
teensy port:
- update to provide new mp_hal_pin_XXX functions following stmhal
esp8266 port:
- Makefile: use latest esptool.py flash size auto-detection
- esp_init_data: auto-initialize system params with vendor SDK 2.0.0
- esp8266.ld: move help.o to iROM
- esp8266.ld: move modmachine.o to iROM
- esp8266.ld: move main.o to iROM
- add MP_FASTCODE modifier to put a function to iRAM
- main: mark nlr_jump_fail() as MP_FASTCODE
- modules/webrepl: enforce only one concurrent WebREPL connection
- etshal.h: add few more ESP8266 vendor lib prototypes
- modesp: add flash_user_start() function
- add support for building firmware version for 512K modules
- scripts: make neopixel/apa102 handle 4bpp LEDs with common code
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- modnetwork: config(): fix copy-paste error in setting "mac"
- scripts/port_diag: add descriptions for esf_buf types
- modnetwork.c: allows AP reconnection without WiFi credentials
- main: bump heap size to 36K
- etshal.h: add prototypes for SPIRead/SPIWrite/SPIEraseSector
- etshal.h: adjust size of MD5_CTX structure
- modules: fix negative temperature in ds18x20 driver
- rename "machine" module implementation to use contemporary naming
- rework webrepl_setup to run over wired REPL
- espneopixel.c: solve glitching LED issues with cpu at 80MHz
- include upip as a standard frozen bytecode module
- update docs for esptool 1.2.1/SDK 2.0 (--flash_size=detect)
- modnetwork.c: expose configuration for station DHCP hostname
zephyr port:
- implement utime module
- use board/SoC values for startup banner based on Zephyr config
- initial implementation of machine.Pin
- zephyr_getchar: update for recent Zephyr refactor of console hooks
- support time -> utime module "weaklink"
- README: update for the current featureset, add more info
- mpconfigport.h: move less important params to the bottom
- Makefile: allow to adjust heap size from make command line
- Makefile: update comments to the current state of affairs
- Makefile: allow to override Zephyr config from make command line
- Makefile: add minimal port
- Makefile: add -fomit-frame-pointer to reduce code size
- mphalport.h: update for new "unified" kernal API (sleep functions)
docs:
- machine.SPI: bring up to date with Hardware API, make vendor-neutral
- machine.SPI: improve descriptions of xfer methods
- library/builtins: add docs for delattr and slice
- library/network: reword intro paragraph
- library/network: typo fixes, consistent acronym capitalization
- library/index: update TOCs so builtins sorted before modules
- utime: document ticks_cpu() in more detail
- utime: describe new semantics of ticks_diff() (signed ring arithmetics)
- utime: add docs for ticks_add(), improvements for other ticks_*()
- esp8266: update for new WebREPL setup procedure
- */quickref.rst: use new semantics of ticks_diff()
- library/machine.Pin: update Pin docs to align with new HW API
travis:
- integrate tools/check_code_size.sh
- minimal: Use CROSS=1, for binary size check
examples:
- http_server_simplistic: add "not suitable for real use" note
- hwapi: example showing best practices for HW API usage in apps
- hwapi: add hwconfig for DragonBoard 410c
2016-11-14 13:20:16 -05:00
|
|
|
endif
|
|
|
|
|
2017-09-22 21:05:51 -04:00
|
|
|
LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
|
|
|
|
LIBS := -lgcc -lc
|
|
|
|
|
2017-10-23 12:29:17 -04:00
|
|
|
# Use toolchain libm if we're not using our own.
|
|
|
|
ifndef INTERNAL_LIBM
|
|
|
|
LIBS += -lm
|
|
|
|
endif
|
2017-09-22 21:05:51 -04:00
|
|
|
|
2018-05-22 08:04:14 -04:00
|
|
|
# Propagate longint choice from .mk to C. There's no easy string comparison
|
|
|
|
# in cpp coniditionals, so we #define separate names for each.
|
|
|
|
ifeq ($(LONGINT_IMPL),NONE)
|
2018-05-21 23:58:03 -04:00
|
|
|
CFLAGS += -DLONGINT_IMPL_NONE
|
|
|
|
endif
|
|
|
|
|
2018-05-22 08:04:14 -04:00
|
|
|
ifeq ($(LONGINT_IMPL),MPZ)
|
2018-05-21 23:58:03 -04:00
|
|
|
CFLAGS += -DLONGINT_IMPL_MPZ
|
|
|
|
endif
|
|
|
|
|
2018-05-22 08:04:14 -04:00
|
|
|
ifeq ($(LONGINT_IMPL),LONGLONG)
|
2018-05-21 23:58:03 -04:00
|
|
|
CFLAGS += -DLONGINT_IMPL_LONGLONG
|
|
|
|
endif
|
|
|
|
|
2017-09-22 21:05:51 -04:00
|
|
|
ifeq ($(CHIP_FAMILY), samd21)
|
|
|
|
LDFLAGS += -mthumb -mcpu=cortex-m0plus -Lasf/thirdparty/CMSIS/Lib/GCC/
|
2017-10-22 14:59:33 -04:00
|
|
|
BOOTLOADER_SIZE := 0x2000
|
2017-09-22 21:05:51 -04:00
|
|
|
else ifeq ($(CHIP_FAMILY), samd51)
|
|
|
|
LDFLAGS += -mthumb -mcpu=cortex-m4
|
2017-10-22 14:59:33 -04:00
|
|
|
BOOTLOADER_SIZE := 0x4000
|
2017-09-22 21:05:51 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
SRC_ASF := \
|
|
|
|
gcc/gcc/startup_$(CHIP_FAMILY).c \
|
|
|
|
gcc/system_$(CHIP_FAMILY).c \
|
2017-11-14 21:22:16 -05:00
|
|
|
hal/src/hal_adc_sync.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hal/src/hal_atomic.c \
|
2018-04-07 09:10:39 -04:00
|
|
|
hal/src/hal_calendar.c \
|
2017-11-14 21:22:16 -05:00
|
|
|
hal/src/hal_dac_sync.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hal/src/hal_delay.c \
|
2017-10-10 14:36:00 -04:00
|
|
|
hal/src/hal_flash.c \
|
2017-11-06 18:35:23 -05:00
|
|
|
hal/src/hal_i2c_m_sync.c \
|
|
|
|
hal/src/hal_io.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hal/src/hal_sleep.c \
|
2017-11-14 20:00:29 -05:00
|
|
|
hal/src/hal_spi_m_sync.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hal/src/hal_timer.c \
|
2018-02-21 16:30:26 -05:00
|
|
|
hal/src/hal_usart_async.c \
|
2017-11-14 21:22:16 -05:00
|
|
|
hpl/adc/hpl_adc.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hpl/core/hpl_init.c \
|
2017-11-14 21:22:16 -05:00
|
|
|
hpl/dac/hpl_dac.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hpl/gclk/hpl_gclk.c \
|
2017-10-10 14:36:00 -04:00
|
|
|
hpl/nvmctrl/hpl_nvmctrl.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hpl/pm/hpl_pm.c \
|
|
|
|
hpl/rtc/hpl_rtc.c \
|
2017-11-06 18:35:23 -05:00
|
|
|
hpl/sercom/hpl_sercom.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hpl/systick/hpl_systick.c \
|
|
|
|
hal/utils/src/utils_list.c \
|
2018-02-21 16:30:26 -05:00
|
|
|
hal/utils/src/utils_ringbuffer.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
|
|
|
|
ifeq ($(CHIP_FAMILY), samd21)
|
|
|
|
SRC_ASF += \
|
|
|
|
hpl/core/hpl_core_m0plus_base.c \
|
|
|
|
hpl/sysctrl/hpl_sysctrl.c \
|
|
|
|
|
|
|
|
else ifeq ($(CHIP_FAMILY), samd51)
|
|
|
|
SRC_ASF += \
|
2017-10-10 14:36:00 -04:00
|
|
|
hal/src/hal_rand_sync.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
hpl/core/hpl_core_m4.c \
|
|
|
|
hpl/mclk/hpl_mclk.c \
|
|
|
|
hpl/osc32kctrl/hpl_osc32kctrl.c \
|
|
|
|
hpl/oscctrl/hpl_oscctrl.c \
|
2017-10-10 14:36:00 -04:00
|
|
|
hpl/trng/hpl_trng.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF))
|
|
|
|
|
2016-08-19 23:24:04 -04:00
|
|
|
SRC_C = \
|
2018-03-12 19:09:13 -04:00
|
|
|
audio_dma.c \
|
2018-05-15 13:53:53 -04:00
|
|
|
board_busses.c \
|
2017-05-10 21:21:02 -04:00
|
|
|
background.c \
|
2016-09-02 20:00:30 -04:00
|
|
|
fatfs_port.c \
|
2016-08-23 02:48:09 -04:00
|
|
|
mphalport.c \
|
2017-07-06 16:41:13 -04:00
|
|
|
reset.c \
|
2018-06-15 19:16:21 -04:00
|
|
|
peripherals/samd/clocks.c \
|
|
|
|
peripherals/samd/dma.c \
|
|
|
|
peripherals/samd/events.c \
|
|
|
|
peripherals/samd/external_interrupts.c \
|
|
|
|
peripherals/samd/sercom.c \
|
|
|
|
peripherals/samd/timers.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/adc.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/cache.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/clocks.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/dma.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/events.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/external_interrupts.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/pins.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/sercom.c \
|
|
|
|
peripherals/samd/$(CHIP_FAMILY)/timers.c \
|
2016-10-28 23:16:39 -04:00
|
|
|
tick.c \
|
2018-05-04 07:13:44 -04:00
|
|
|
bindings/samd/__init__.c \
|
|
|
|
bindings/samd/Clock.c \
|
2017-06-16 17:55:53 -04:00
|
|
|
boards/$(BOARD)/board.c \
|
2016-08-24 20:38:08 -04:00
|
|
|
boards/$(BOARD)/pins.c \
|
2017-06-20 13:56:05 -04:00
|
|
|
lib/oofatfs/ff.c \
|
|
|
|
lib/oofatfs/option/ccsbcs.c \
|
2016-09-02 20:00:30 -04:00
|
|
|
lib/timeutils/timeutils.c \
|
2018-11-23 15:51:11 -05:00
|
|
|
lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c \
|
2017-04-20 14:24:05 -04:00
|
|
|
lib/utils/buffer_helper.c \
|
2017-02-19 10:11:33 -05:00
|
|
|
lib/utils/context_manager_helpers.c \
|
2017-01-10 18:57:04 -05:00
|
|
|
lib/utils/interrupt_char.c \
|
2016-08-19 23:24:04 -04:00
|
|
|
lib/utils/pyexec.c \
|
2016-12-19 19:38:35 -05:00
|
|
|
lib/utils/stdout_helpers.c \
|
2017-08-25 22:17:07 -04:00
|
|
|
lib/utils/sys_stdio_mphal.c \
|
2016-08-19 23:24:04 -04:00
|
|
|
lib/libc/string0.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
lib/mp-readline/readline.c \
|
2018-08-02 17:35:46 -04:00
|
|
|
freetouch/adafruit_ptc.c \
|
|
|
|
supervisor/shared/memory.c
|
2017-10-23 12:29:17 -04:00
|
|
|
|
2018-10-04 07:59:25 -04:00
|
|
|
ifeq ($(MICROPY_PY_NETWORK),1)
|
|
|
|
CFLAGS += -DMICROPY_PY_NETWORK=1
|
|
|
|
|
|
|
|
SRC_MOD += lib/netutils/netutils.c
|
|
|
|
|
|
|
|
ifneq ($(MICROPY_PY_WIZNET5K),0)
|
|
|
|
WIZNET5K_DIR=drivers/wiznet5k
|
|
|
|
INC += -I$(TOP)/$(WIZNET5K_DIR)
|
|
|
|
CFLAGS_MOD += -DMICROPY_PY_WIZNET5K=$(MICROPY_PY_WIZNET5K) -D_WIZCHIP_=$(MICROPY_PY_WIZNET5K)
|
|
|
|
SRC_MOD += $(addprefix $(WIZNET5K_DIR)/,\
|
|
|
|
ethernet/w$(MICROPY_PY_WIZNET5K)/w$(MICROPY_PY_WIZNET5K).c \
|
|
|
|
ethernet/wizchip_conf.c \
|
|
|
|
ethernet/socket.c \
|
|
|
|
internet/dns/dns.c \
|
2018-10-09 01:28:30 -04:00
|
|
|
internet/dhcp/dhcp.c \
|
2018-10-04 07:59:25 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
endif # MICROPY_PY_WIZNET5K
|
|
|
|
endif # MICROPY_PY_NETWORK
|
|
|
|
|
2017-06-16 16:47:01 -04:00
|
|
|
SRC_COMMON_HAL = \
|
2017-09-22 21:05:51 -04:00
|
|
|
board/__init__.c \
|
2017-11-06 18:35:23 -05:00
|
|
|
busio/__init__.c \
|
|
|
|
busio/I2C.c \
|
2017-11-14 20:00:29 -05:00
|
|
|
busio/SPI.c \
|
2018-02-21 16:30:26 -05:00
|
|
|
busio/UART.c \
|
2017-09-29 16:58:13 -04:00
|
|
|
digitalio/__init__.c \
|
|
|
|
digitalio/DigitalInOut.c \
|
2018-08-15 14:01:01 -04:00
|
|
|
displayio/FourWire.c \
|
2018-08-02 08:52:27 -04:00
|
|
|
i2cslave/__init__.c \
|
|
|
|
i2cslave/I2CSlave.c \
|
2017-09-22 21:05:51 -04:00
|
|
|
microcontroller/__init__.c \
|
|
|
|
microcontroller/Pin.c \
|
|
|
|
microcontroller/Processor.c \
|
2017-10-10 19:56:59 -04:00
|
|
|
neopixel_write/__init__.c \
|
2017-10-10 14:36:00 -04:00
|
|
|
os/__init__.c \
|
2018-05-25 21:39:16 -04:00
|
|
|
rotaryio/__init__.c \
|
|
|
|
rotaryio/IncrementalEncoder.c \
|
2018-04-07 09:10:39 -04:00
|
|
|
rtc/__init__.c \
|
|
|
|
rtc/RTC.c \
|
2018-03-12 19:09:13 -04:00
|
|
|
supervisor/__init__.c \
|
2018-03-08 21:19:51 -05:00
|
|
|
supervisor/Runtime.c \
|
2017-11-06 18:35:23 -05:00
|
|
|
time/__init__.c \
|
2017-11-14 21:22:16 -05:00
|
|
|
analogio/__init__.c \
|
2017-04-10 16:32:19 -04:00
|
|
|
analogio/AnalogIn.c \
|
|
|
|
analogio/AnalogOut.c \
|
2018-04-12 21:13:40 -04:00
|
|
|
nvm/__init__.c \
|
|
|
|
nvm/ByteArray.c \
|
2018-02-09 03:22:29 -05:00
|
|
|
pulseio/__init__.c \
|
|
|
|
pulseio/PulseIn.c \
|
|
|
|
pulseio/PulseOut.c \
|
|
|
|
pulseio/PWMOut.c \
|
2018-05-02 13:18:14 -04:00
|
|
|
touchio/__init__.c \
|
2018-10-19 21:46:22 -04:00
|
|
|
touchio/TouchIn.c
|
2016-09-13 14:46:22 -04:00
|
|
|
|
2017-10-26 22:31:56 -04:00
|
|
|
ifeq ($(INTERNAL_LIBM),1)
|
2017-10-23 12:29:17 -04:00
|
|
|
SRC_LIBM = $(addprefix lib/,\
|
|
|
|
libm/math.c \
|
2018-04-26 15:51:37 -04:00
|
|
|
libm/roundf.c \
|
2017-10-23 12:29:17 -04:00
|
|
|
libm/fmodf.c \
|
|
|
|
libm/nearbyintf.c \
|
|
|
|
libm/ef_sqrt.c \
|
|
|
|
libm/kf_rem_pio2.c \
|
|
|
|
libm/kf_sin.c \
|
|
|
|
libm/kf_cos.c \
|
|
|
|
libm/kf_tan.c \
|
|
|
|
libm/ef_rem_pio2.c \
|
|
|
|
libm/sf_sin.c \
|
|
|
|
libm/sf_cos.c \
|
|
|
|
libm/sf_tan.c \
|
|
|
|
libm/sf_frexp.c \
|
|
|
|
libm/sf_modf.c \
|
|
|
|
libm/sf_ldexp.c \
|
|
|
|
libm/asinfacosf.c \
|
|
|
|
libm/atanf.c \
|
|
|
|
libm/atan2f.c \
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2017-06-16 16:47:01 -04:00
|
|
|
# These don't have corresponding files in each port but are still located in
|
|
|
|
# shared-bindings to make it clear what the contents of the modules are.
|
|
|
|
SRC_BINDINGS_ENUMS = \
|
|
|
|
digitalio/Direction.c \
|
|
|
|
digitalio/DriveMode.c \
|
2017-06-20 13:56:05 -04:00
|
|
|
digitalio/Pull.c \
|
2018-01-02 21:25:41 -05:00
|
|
|
microcontroller/RunMode.c \
|
2017-10-02 20:49:40 -04:00
|
|
|
help.c \
|
2017-10-20 15:21:41 -04:00
|
|
|
math/__init__.c \
|
2017-11-15 17:44:14 -05:00
|
|
|
supervisor/__init__.c \
|
2017-10-02 20:49:40 -04:00
|
|
|
util.c
|
2017-06-16 16:47:01 -04:00
|
|
|
|
2017-04-10 16:32:19 -04:00
|
|
|
|
2016-11-22 20:32:28 -05:00
|
|
|
SRC_SHARED_MODULE = \
|
|
|
|
bitbangio/__init__.c \
|
|
|
|
bitbangio/I2C.c \
|
2017-03-25 08:04:49 -04:00
|
|
|
bitbangio/OneWire.c \
|
2016-11-22 20:32:28 -05:00
|
|
|
bitbangio/SPI.c \
|
2017-04-10 16:32:19 -04:00
|
|
|
busio/OneWire.c \
|
2018-08-15 14:01:01 -04:00
|
|
|
displayio/__init__.c \
|
|
|
|
displayio/Bitmap.c \
|
2018-09-11 01:00:21 -04:00
|
|
|
displayio/ColorConverter.c \
|
2018-08-15 14:01:01 -04:00
|
|
|
displayio/Group.c \
|
2018-09-11 01:00:21 -04:00
|
|
|
displayio/OnDiskBitmap.c \
|
2018-08-15 14:01:01 -04:00
|
|
|
displayio/Palette.c \
|
|
|
|
displayio/Sprite.c \
|
2017-10-03 16:35:57 -04:00
|
|
|
gamepad/__init__.c \
|
|
|
|
gamepad/GamePad.c \
|
2018-01-29 15:24:46 -05:00
|
|
|
_stage/__init__.c \
|
|
|
|
_stage/Layer.c \
|
|
|
|
_stage/Text.c \
|
2018-10-19 21:46:22 -04:00
|
|
|
storage/__init__.c \
|
2017-06-27 18:17:30 -04:00
|
|
|
os/__init__.c \
|
2017-06-27 20:37:24 -04:00
|
|
|
random/__init__.c \
|
2017-10-18 15:50:20 -04:00
|
|
|
struct/__init__.c \
|
2016-11-22 20:32:28 -05:00
|
|
|
uheap/__init__.c \
|
2018-10-19 21:46:22 -04:00
|
|
|
ustack/__init__.c \
|
|
|
|
usb_hid/__init__.c \
|
|
|
|
usb_hid/Device.c
|
|
|
|
|
|
|
|
# usb_midi/__init__.c
|
|
|
|
# usb_midi/Port.c
|
2016-11-22 20:32:28 -05:00
|
|
|
|
2018-10-04 07:59:25 -04:00
|
|
|
ifeq ($(MICROPY_PY_NETWORK),1)
|
|
|
|
SRC_SHARED_MODULE += socket/__init__.c network/__init__.c
|
|
|
|
ifneq ($(MICROPY_PY_WIZNET5K),0)
|
2018-10-08 22:05:58 -04:00
|
|
|
SRC_SHARED_MODULE += wiznet/__init__.c wiznet/wiznet5k.c
|
2018-10-04 07:59:25 -04:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-08-07 10:43:52 -04:00
|
|
|
# SAMRs don't have a DAC
|
|
|
|
ifneq ($(CHIP_VARIANT),SAMR21G18A)
|
|
|
|
SRC_COMMON_HAL += \
|
|
|
|
audioio/__init__.c \
|
|
|
|
audioio/AudioOut.c
|
|
|
|
SRC_SHARED_MODULE += \
|
2018-10-02 21:06:52 -04:00
|
|
|
audioio/__init__.c \
|
|
|
|
audioio/Mixer.c \
|
2018-08-07 10:43:52 -04:00
|
|
|
audioio/RawSample.c \
|
|
|
|
audioio/WaveFile.c
|
|
|
|
endif
|
|
|
|
|
2018-04-26 15:51:37 -04:00
|
|
|
# The smallest SAMD51 packages don't have I2S. Everything else does.
|
2018-04-13 13:51:01 -04:00
|
|
|
ifneq ($(CHIP_VARIANT),SAMD51G18A)
|
|
|
|
ifneq ($(CHIP_VARIANT),SAMD51G19A)
|
2018-08-07 10:43:52 -04:00
|
|
|
ifneq ($(CHIP_VARIANT),SAMR21G18A)
|
|
|
|
SRC_COMMON_HAL += \
|
|
|
|
audiobusio/__init__.c \
|
|
|
|
audiobusio/I2SOut.c \
|
|
|
|
audiobusio/PDMIn.c
|
|
|
|
SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c
|
|
|
|
endif
|
2018-04-13 13:51:01 -04:00
|
|
|
endif
|
2018-03-12 19:09:13 -04:00
|
|
|
endif
|
|
|
|
|
2018-08-07 10:43:52 -04:00
|
|
|
SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
|
|
|
|
$(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \
|
|
|
|
$(addprefix common-hal/, $(SRC_COMMON_HAL))
|
|
|
|
|
2016-11-22 20:32:28 -05:00
|
|
|
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
|
|
|
|
$(addprefix shared-module/, $(SRC_SHARED_MODULE))
|
|
|
|
|
2018-07-05 07:44:00 -04:00
|
|
|
SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s
|
2018-06-28 13:36:28 -04:00
|
|
|
|
2017-09-22 21:05:51 -04:00
|
|
|
OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
2016-08-23 02:48:09 -04:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(SRC_ASF:.c=.o))
|
2017-06-16 16:47:01 -04:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o))
|
2016-11-22 20:32:28 -05:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o))
|
2017-10-26 22:31:56 -04:00
|
|
|
ifeq ($(INTERNAL_LIBM),1)
|
2017-10-23 12:29:17 -04:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
|
|
|
|
endif
|
2018-07-05 07:44:00 -04:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
|
2018-10-04 07:59:25 -04:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
|
2016-08-24 16:17:55 -04:00
|
|
|
|
2017-09-22 21:05:51 -04:00
|
|
|
SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) $(STM_SRC_C)
|
2018-08-02 14:07:22 -04:00
|
|
|
# Sources that only hold QSTRs after pre-processing.
|
|
|
|
SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c
|
2016-08-19 23:24:04 -04:00
|
|
|
|
2017-05-13 12:17:43 -04:00
|
|
|
all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2
|
2016-08-19 23:24:04 -04:00
|
|
|
|
|
|
|
$(BUILD)/firmware.elf: $(OBJ)
|
2017-02-24 09:59:59 -05:00
|
|
|
$(STEPECHO) "LINK $@"
|
2017-02-24 08:55:34 -05:00
|
|
|
$(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group
|
2018-05-14 11:19:19 -04:00
|
|
|
$(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE)
|
2016-08-19 23:24:04 -04:00
|
|
|
|
|
|
|
$(BUILD)/firmware.bin: $(BUILD)/firmware.elf
|
2018-07-31 19:53:54 -04:00
|
|
|
$(STEPECHO) "Create $@"
|
2016-08-23 19:47:53 -04:00
|
|
|
$(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@
|
2016-08-19 23:24:04 -04:00
|
|
|
|
2017-05-13 12:17:43 -04:00
|
|
|
$(BUILD)/firmware.uf2: $(BUILD)/firmware.bin
|
2018-07-31 19:53:54 -04:00
|
|
|
$(STEPECHO) "Create $@"
|
|
|
|
$(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -b $(BOOTLOADER_SIZE) -c -o $@ $^
|
2017-05-13 12:17:43 -04:00
|
|
|
|
2016-08-19 23:24:04 -04:00
|
|
|
deploy: $(BUILD)/firmware.bin
|
|
|
|
$(ECHO) "Writing $< to the board"
|
|
|
|
$(BOSSAC) -u $<
|
|
|
|
|
|
|
|
# Run emulation build on a POSIX system with suitable terminal settings
|
|
|
|
run:
|
|
|
|
stty raw opost -echo
|
|
|
|
build/firmware.elf
|
|
|
|
@echo Resetting terminal...
|
|
|
|
# This sleep is useful to spot segfaults
|
|
|
|
sleep 1
|
|
|
|
reset
|
|
|
|
|
|
|
|
test: $(BUILD)/firmware.elf
|
|
|
|
$(Q)/bin/echo -e "print('hello world!', list(x+1 for x in range(10)), end='eol\\\\n')\\r\\n\\x04" | $(BUILD)/firmware.elf | tail -n2 | grep "^hello world! \\[1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\]eol"
|
|
|
|
|
2017-08-27 15:02:50 -04:00
|
|
|
include $(TOP)/py/mkrules.mk
|