diff --git a/main.c b/main.c index 6b56f5ff6f..4683bcf004 100755 --- a/main.c +++ b/main.c @@ -199,7 +199,7 @@ void cleanup_after_vm(supervisor_allocation* heap) { bool run_code_py(safe_mode_t safe_mode) { bool serial_connected_at_start = serial_connected(); - #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS + #if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 if (serial_connected_at_start) { serial_write("\n"); if (autoreload_is_enabled()) { diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 11e6874edd..16aed16158 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -292,12 +292,17 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) +# There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED, +# because a few modules have files both in common-hal/ and shared-modules/. +# Doing a $(sort ...) removes duplicates as part of sorting. +SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) + + SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_ASF:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o)) ifeq ($(INTERNAL_LIBM),1) OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) endif @@ -310,9 +315,18 @@ SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 -$(BUILD)/firmware.elf: $(OBJ) +LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) + +# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. +# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, +# because it may include other template files. +$(LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld + $(STEPECHO) "GEN $@" + $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld + +$(BUILD)/firmware.elf: $(OBJ) $(LD_FILE) $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) -Wl,--start-group $(LIBS) -Wl,--end-group $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h index a508d91913..226717c83b 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h @@ -7,10 +7,6 @@ #define MICROPY_HW_LED_STATUS (&pin_PB23) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index a543468e52..bd682ade07 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x2341 USB_PID = 0x8053 USB_PRODUCT = "Arduino MKR1300" diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h index 02750e6469..4871b1798b 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 5612eb88d7..894b9b0110 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8050 USB_PRODUCT = "Arduino MKRZero" diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h index ec201e6ef5..bf2a68c57a 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (PORT_PB03) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index cbbf15a3ef..f94ec13b7c 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x2341 USB_PID = 0x824D USB_PRODUCT = "Arduino Zero" diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h index 561240c69a..cbfb11d200 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h @@ -5,6 +5,7 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define DEFAULT_I2C_BUS_SCL (&pin_PA08) @@ -17,8 +18,6 @@ #define DEFAULT_UART_BUS_RX (&pin_PA01) #define DEFAULT_UART_BUS_TX (&pin_PA00) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA12 1 #define IGNORE_PIN_PA13 1 diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index 08e42aa4ef..c3f0750a9e 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB3 USB_PRODUCT = "Bast Pro Mini M0" diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h index f4e40739b0..d359687e13 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h +++ b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h @@ -3,7 +3,6 @@ #define CIRCUITPY_MCU_FAMILY samd51 - #define MICROPY_HW_LED_STATUS (&pin_PA22) // These are pins not to reset. @@ -14,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk index f390a8681a..0ff6f58eab 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk +++ b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x04D8 USB_PID = 0xEDB3 USB_PRODUCT = "Programmable USB Hub" diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h index 7a32bf023f..b92c2a65e3 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h @@ -7,14 +7,10 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - #define DEFAULT_SPI_BUS_SCK (&pin_PA19) #define DEFAULT_SPI_BUS_MOSI (&pin_PA18) #define DEFAULT_SPI_BUS_MISO (&pin_PA22) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA00 1 #define IGNORE_PIN_PA01 1 #define IGNORE_PIN_PA02 1 diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 2399aad5c5..adae4beb27 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB2 USB_PRODUCT = "CatWAN USBStick" diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index e6a7e06769..0ed5262ab5 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 3c43776f5b..cdbdf44f80 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express" diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index ca6f9b7734..2db5129291 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index f456515f9a..a6ed28aa71 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express with Crickit libraries" diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index 333fc79f9b..a1d5b0a671 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index f0c9c6b8c4..b5a7c2424d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express with displayio" diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld new file mode 100644 index 0000000000..e02bbfab02 --- /dev/null +++ b/ports/atmel-samd/boards/common.template.ld @@ -0,0 +1,89 @@ +/* Template for SAMD21/SAMD51 linking. dollar-sign-curly-bracket items are replaced with strings. */ + +/* Specify the memory areas */ +MEMORY +{ + /* CIRCUITPY_BOOTLOADER_SIZE is size of bootloader, if any. + * SAMD21 Arduino and UF2 bootloaders are 8KiB. SAMD51 UF2 is 6KiB. + * FLASH_SIZE is defined in ASF4. + * RAM_SIZE is defined in mpconfigport.h, from constants from ASF4. + * CIRCUITPY_INTERNAL_CONFIG_SIZE is size of an optional hidden config area, used currently + * for crystalless USB timing calibration. + * CIRCUITPY_INTERNAL_NVM_SIZE is the size of microntroller.nvm. + */ + FLASH (rx) : ORIGIN = 0x00000000 + ${BOOTLOADER_SIZE}, LENGTH = ${FLASH_SIZE} - ${BOOTLOADER_SIZE} - ${CIRCUITPY_INTERNAL_CONFIG_SIZE} - ${CIRCUITPY_INTERNAL_NVM_SIZE} + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${RAM_SIZE} +} + +/* top end of the stack */ +/* stack must be double-word (8 byte) aligned */ +_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; +_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; + +/* define output sections */ +SECTIONS +{ + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors)) /* isr vector table */ + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + + . = ALIGN(4); + } >FLASH + + .ARM.exidx : + { + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + _etext = .; /* define a global symbol at end of code */ + _sidata = .; /* start of .data section */ + } > FLASH + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : AT ( _sidata ) + { + . = ALIGN(4); + _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ + *(.ramfunc) + *(.ramfunc*) + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ + } >RAM + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; + _szero = .; /* define a global symbol at bss start; used by startup code */ + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ezero = .; /* define a global symbol at bss end; used by startup code */ + _ebss = .; + } >RAM + + /* this just checks there is enough RAM for the requested stack. */ + .stack : + { + . = ALIGN(4); + . = . + ${CIRCUITPY_DEFAULT_STACK_SIZE}; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h index 9e329b3ed9..8664a6a0ec 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h @@ -12,14 +12,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB09) #define DEFAULT_I2C_BUS_SDA (&pin_PB08) diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk index 86a7719b84..25ec501627 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8021 USB_PRODUCT = "CP32-M4" diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h index 99167d31bc..f560cfa493 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h @@ -20,14 +20,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk index aa5f47d400..b2823e30c3 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x4097 USB_PID = 0x0001 USB_PRODUCT = "Datalore IP M4" diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.h b/ports/atmel-samd/boards/datum_distance/mpconfigboard.h index e02e437805..74706ba040 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index a7bb8293d4..4f6c7ab82e 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8C USB_PRODUCT = "datum-Distance" diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.h b/ports/atmel-samd/boards/datum_imu/mpconfigboard.h index b87739dd0e..3cc218f9e0 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index 507c83b041..336a1b832f 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8D USB_PRODUCT = "datum-IMU" diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.h b/ports/atmel-samd/boards/datum_light/mpconfigboard.h index 2a91c112dd..33e80d06d0 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index 4bb227ba4e..7ec2efcf96 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8E USB_PRODUCT = "datum-Light" diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.h b/ports/atmel-samd/boards/datum_weather/mpconfigboard.h index 45619197b9..328a6860c4 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index 411aee6254..d3ec1b0fdd 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8F USB_PRODUCT = "datum-Weather" diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h index f27cb533b2..3a984188fa 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h @@ -8,12 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk index a2c182e683..dedd49ff71 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB6 USB_PRODUCT = "Escornabot Makech" diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h index eb1b905851..a0fde67ef6 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA22) #define DEFAULT_I2C_BUS_SDA (&pin_PA23) diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index a88dbd563e..134abf7236 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 Adalogger" diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h index a16cee0b4c..41a4bde212 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 076f1f8ff0..3643743509 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0" diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h index e6cd1c729b..5421dc8890 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h @@ -15,13 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index 5b89f1be4f..cdee7b7946 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Express" diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h index 77146889e5..ee61e1d87d 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h @@ -15,12 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index 5793d82e55..d5e03b49d4 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Express" diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h index 19a5147587..2a319a4129 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 83d794d047..40a461b279 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 RFM69" diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h index d3db098e54..850033dbe4 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index a84e14f55f..736161047a 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 RFM9x" diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h index 5ad265bf14..2d9f88e2e1 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h @@ -17,12 +17,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index c5fef4373c..cb13adb76d 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Supersized" diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h index f65ea8db78..ba16d17ee4 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define EXTERNAL_FLASH_QSPI_DUAL #define BOARD_HAS_CRYSTAL 1 diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 176ebac82c..d736941df3 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8026 USB_PRODUCT = "Feather M4 Express" diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h index 7df31f3a93..2afe358178 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h @@ -14,12 +14,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA13) diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index c4a3a5a19e..05c305b1a2 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather RadioFruit Zigbee" diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h index 5f09ab4d2f..b6d8f946bc 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h @@ -10,16 +10,12 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - #define DEFAULT_I2C_BUS_SCL (&pin_PA05) #define DEFAULT_I2C_BUS_SDA (&pin_PA04) #define DEFAULT_UART_BUS_RX (&pin_PA05) #define DEFAULT_UART_BUS_TX (&pin_PA04) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA06 1 #define IGNORE_PIN_PA07 1 diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 6f44a22f84..d649386328 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x801D USB_PRODUCT = "Gemma M0" diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h index bc8f5a134a..bab0550148 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h @@ -21,14 +21,6 @@ #define MICROPY_PORT_C ( PORT_PC24 | PORT_PC30 | PORT_PC31 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB21) diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk index 423761c3f7..49331a705d 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8032 USB_PRODUCT = "Grand Central M4 Express" diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h index d5c2745009..e5ac346daf 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B ( PORT_PB22 | PORT_PB23 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA17) #define DEFAULT_I2C_BUS_SDA (&pin_PA16) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index 988d10d1cd..af4a5a2932 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0xD1ED USB_PRODUCT = "HalloWing M0 Express" diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h index 654632db5d..a0c726e726 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk index 0d891abc82..9379ed3fe0 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x804A USB_PRODUCT = "Hallowing M4 Express" diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h index 6f9f661d94..db5e2a4df2 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 2b64e90275..4d516c75b6 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8012 USB_PRODUCT = "ItsyBitsy M0 Express" @@ -21,4 +20,3 @@ CIRCUITPY_RTC = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 - diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h index 9e4d4a10c9..98920b54f2 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index 5cab5bf43a..7ce45d0a1a 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x802C USB_PRODUCT = "ItsyBitsy M4 Express" diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index 194542b055..6664524d24 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -14,8 +14,6 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - 0x010000) - #define DEFAULT_I2C_BUS_SCL (&pin_PA17) #define DEFAULT_I2C_BUS_SDA (&pin_PA16) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 706e551c5d..6d6571a2ae 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xED94 USB_PRODUCT = "kicksat-sprite" diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h index 1304b6dfbf..80d3678630 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h @@ -8,12 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk index 894e19a6bb..4b452ecbfe 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB1 USB_PRODUCT = "Meow Meow" diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h index bfa254b95e..04565feb40 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h @@ -21,12 +21,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index d3f35ba8b0..b52b1343fb 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8014 USB_PRODUCT = "Metro M0 Express" diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h index e89b0322a1..9fa4018046 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h @@ -18,14 +18,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk index 98d85ba826..78e27b422f 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8038 USB_PRODUCT = "Metro M4 Airlift Lite" diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h index 2a8878874d..7f8dbb1d2b 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h @@ -20,14 +20,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk index 68b6f64065..4f01f3edd1 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8021 USB_PRODUCT = "Metro M4 Express" diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h index c4563964f8..08ab7e16b9 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk index 4bd1d6e522..eedfd2ecca 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x1209 USB_PID = 0x2017 USB_PRODUCT = "Mini SAM M4" diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h index fc77520f5f..42fb4548e0 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk index a3db7dc890..e61f3d2403 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8048 USB_PRODUCT = "Monster M4SK" diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h index 445ccc4355..6b3b4aa15c 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h @@ -5,11 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - - #define IGNORE_PIN_PB00 1 #define IGNORE_PIN_PB01 1 #define IGNORE_PIN_PB02 1 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index e24a290519..c9aa26e3c8 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x801D USB_PRODUCT = "PewPew 10.2" diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h index 1b3035e120..60cd8d754f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h @@ -9,14 +9,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) @@ -48,4 +40,3 @@ #define IGNORE_PIN_PB09 1 #define IGNORE_PIN_PB10 1 #define IGNORE_PIN_PB11 1 - diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 54ec3d1d0e..af7e3fb16c 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader.ld USB_VID = 0x1d50 USB_PID = 0x60e8 USB_PRODUCT = "PewPew M4" diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h index 5a8eb9d147..866e21991b 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA02 1 #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA04 1 diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index 686c9099fc..c5b2c9eb58 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8028 USB_PRODUCT = "pIRKey M0" diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.h b/ports/atmel-samd/boards/pybadge/mpconfigboard.h index 36115bc873..435185322a 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.h +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.h @@ -14,14 +14,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index 7e2cb64398..05df09627c 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8034 USB_PRODUCT = "PyBadge" diff --git a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h index ade74786d3..229cfa3354 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h +++ b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h @@ -14,14 +14,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk index 7e77b0feaf..242722870a 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8043 USB_PRODUCT = "PyBadge AirLift" diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.h b/ports/atmel-samd/boards/pygamer/mpconfigboard.h index 4720b22eb1..102c259567 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.h +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 0fce468d9f..70109e332e 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x803E USB_PRODUCT = "PyGamer" diff --git a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h index c05aa4f062..fbe946b72f 100644 --- a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h +++ b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk index 8711738d4f..7f3207ecd0 100644 --- a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x803E USB_PRODUCT = "PyGamer Advance" diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.h b/ports/atmel-samd/boards/pyportal/mpconfigboard.h index 43346488ba..2c4cf4f580 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C ( 0 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk index f763c74fa4..149141a4e3 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8036 USB_PRODUCT = "PyPortal" diff --git a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h index 91c1188108..c463b56616 100644 --- a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C ( 0 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk index 58b363779c..dbc2d5ae99 100644 --- a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8054 USB_PRODUCT = "PyPortal Titano" diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.h b/ports/atmel-samd/boards/pyruler/mpconfigboard.h index 171873b47c..4d0586d912 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA12 1 #define IGNORE_PIN_PA13 1 #define IGNORE_PIN_PA16 1 diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 9663944a38..220e48872a 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x804C USB_PRODUCT = "PyRuler" diff --git a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h index c6856c68f8..68991f9974 100644 --- a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h @@ -17,13 +17,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) @@ -39,4 +32,3 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - diff --git a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk index e703fbfb9f..29cca569e6 100644 --- a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x1209 USB_PID = 0x4D43 USB_PRODUCT = "Robo HAT MM1 M0" diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h index 64040a6586..c66873aeb2 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h @@ -21,14 +21,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk index 56f1617dbf..b2ea18e5f2 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x1209 USB_PID = 0x4D43 USB_PRODUCT = "Robo HAT MM1 M4" diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.h b/ports/atmel-samd/boards/sam32/mpconfigboard.h index f6d3fb6b46..3c6f52ebcc 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.h +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.h @@ -11,12 +11,9 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - 0x010000) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA04) diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.mk b/ports/atmel-samd/boards/sam32/mpconfigboard.mk index 12884a9cc8..0d6be64374 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEDBE USB_PRODUCT = "SAM32" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld index 2adf4fa909..1ee745eb17 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld index bddaae99da..d8f4cc2365 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld index 4e677a079f..f663326d69 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K /* 32 KiB RAM */ } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _etext ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader.ld b/ports/atmel-samd/boards/samd21x18-bootloader.ld index 2ef09ba9af..666ac79c47 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader.ld @@ -11,75 +11,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-external-flash.ld b/ports/atmel-samd/boards/samd21x18-external-flash.ld index a540bfde2a..6afdab7345 100644 --- a/ports/atmel-samd/boards/samd21x18-external-flash.ld +++ b/ports/atmel-samd/boards/samd21x18-external-flash.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18.ld b/ports/atmel-samd/boards/samd21x18.ld index 139be86bb2..c035f5117e 100644 --- a/ports/atmel-samd/boards/samd21x18.ld +++ b/ports/atmel-samd/boards/samd21x18.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - -/* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld index c0e812ce19..b22bef3f3a 100644 --- a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld index 253a764c9b..f1493f2510 100644 --- a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader.ld b/ports/atmel-samd/boards/samd51x19-bootloader.ld index 56786a37af..c73db2ece9 100644 --- a/ports/atmel-samd/boards/samd51x19-bootloader.ld +++ b/ports/atmel-samd/boards/samd51x19-bootloader.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld index 598915b1b7..ee28fdf1cc 100644 --- a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader.ld b/ports/atmel-samd/boards/samd51x20-bootloader.ld index 49d4d87914..ea0e0569f5 100644 --- a/ports/atmel-samd/boards/samd51x20-bootloader.ld +++ b/ports/atmel-samd/boards/samd51x20-bootloader.ld @@ -9,76 +9,4 @@ MEMORY FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 1M - 16K - 512K - 8K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } - -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-external-flash.ld b/ports/atmel-samd/boards/samd51x20-external-flash.ld index d3ed90476e..5212363fe1 100644 --- a/ports/atmel-samd/boards/samd51x20-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x20-external-flash.ld @@ -9,74 +9,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20.ld b/ports/atmel-samd/boards/samd51x20.ld index e203c5b7a9..1f0b661720 100644 --- a/ports/atmel-samd/boards/samd51x20.ld +++ b/ports/atmel-samd/boards/samd51x20.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.h b/ports/atmel-samd/boards/serpente/mpconfigboard.h index 034e1f6c37..515bc14410 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.h +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.h @@ -13,12 +13,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) @@ -36,4 +30,3 @@ // Not connected #define IGNORE_PIN_PA13 1 #define IGNORE_PIN_PA28 1 - diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.mk b/ports/atmel-samd/boards/serpente/mpconfigboard.mk index 98e1e37297..a5adb17a1e 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.mk +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8058 USB_PRODUCT = "Serpente" diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.h b/ports/atmel-samd/boards/snekboard/mpconfigboard.h index a349143d91..1c0804fe72 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.h +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.h @@ -15,13 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 0 #define DEFAULT_I2C_BUS_SCL (&pin_PA08) /* ANALOG 5 */ diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index db2e511abf..4faa041b1b 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x804E USB_PRODUCT = "snekboard" diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h index 80cacfa9b0..d184945f35 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h @@ -13,10 +13,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 //I2C diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk index 9d0ef1c040..6a2afc306e 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x1B4F USB_PID = 0x0017 USB_PRODUCT = "LUMIDrive Board" diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h index cf7c3998bb..ae272d502b 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h @@ -15,20 +15,12 @@ #define SPI_FLASH_SCK_PIN &pin_PB23 #define SPI_FLASH_CS_PIN &pin_PA13 -#define MICROPY_PORT_A ( 0 ) +#define MICROPY_PORT_A ( 0 ) #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 - // I2C - also QWIIC #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index e80ef62771..f2d4eccad9 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x1B4F USB_PID = 0x0015 USB_PRODUCT = "RedBoard Turbo Board" diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h index a50c61cf2d..13bb263803 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index c9d0baf11f..0c33ef960e 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1B4F USB_PID = 0x8D23 USB_PRODUCT = "SparkFun SAMD21 Dev Breakout" diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h index 6af7fa1918..2cfdd9e73b 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index a6e216575e..d09785fb8a 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1B4F USB_PID = 0x8D22 USB_PRODUCT = "SparkFun SAMD21 Mini Breakout" diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h index 34ab8fcfbc..02a6e7f7ce 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA05) #define DEFAULT_I2C_BUS_SDA (&pin_PA04) @@ -47,4 +41,3 @@ #define IGNORE_PIN_PA28 1 #define IGNORE_PIN_PA30 1 #define IGNORE_PIN_PA31 1 - diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index 17de6ac742..92129eb63f 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8060 USB_PRODUCT = "StringCar M0 Express" @@ -21,4 +20,3 @@ CIRCUITPY_RTC = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 - diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h index 8ca1df1621..96b38810c3 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB08) #define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk index ec37186c3a..3795208724 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8030 USB_PRODUCT = "Trellis M4 Express" diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h index dd8bc03ccf..69517534ee 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h @@ -11,10 +11,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA04 1 #define IGNORE_PIN_PA11 1 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index b4a00b654a..0d41fa4bd7 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -1,4 +1,4 @@ -LD_FILE = boards/samd21x18-bootloader.ld +LD_TEMPLATE_FILE = boards/common.template.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT = "Trinket M0" diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h index 369d84b8b8..af473b1288 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h @@ -18,12 +18,6 @@ #define CALIBRATE_CRYSTALLESS 1 -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index c20358e19f..bd6c9c9ff7 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT="Trinket M0 Haxpress" diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.h b/ports/atmel-samd/boards/uchip/mpconfigboard.h index 6dcaf2965c..1877a41ef9 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.h +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.h @@ -7,11 +7,9 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) - - // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 109492b764..950910e48b 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xED5F USB_PRODUCT = "uChip CircuitPython" diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.h b/ports/atmel-samd/boards/ugame10/mpconfigboard.h index b5590d986c..550172a517 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.h +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.h @@ -13,12 +13,6 @@ #define CALIBRATE_CRYSTALLESS 1 -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_SPI_BUS_SCK (&pin_PA07) #define DEFAULT_SPI_BUS_MISO (&pin_PA11) #define DEFAULT_SPI_BUS_MOSI (&pin_PA06) diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index f0310b4aaa..1c43369076 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT = "uGame10" diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c index cb0751acef..41dee2b490 100644 --- a/ports/atmel-samd/common-hal/microcontroller/__init__.c +++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c @@ -92,7 +92,6 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; -// NVM is only available on Express boards for now. #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 // The singleton nvm.ByteArray object. const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { diff --git a/ports/atmel-samd/ld_defines.c b/ports/atmel-samd/ld_defines.c new file mode 100644 index 0000000000..62838ca4b5 --- /dev/null +++ b/ports/atmel-samd/ld_defines.c @@ -0,0 +1,14 @@ +// Fake source file used only to capture #define values for use in ld template files. +#include "mpconfigport.h" + +// For each value needed in the LD file, create a C-like line: +// NAME_OF_VALUE; ///DEFINE_VALUE NAME_OF_VALUE +// The C preprocessor will replace NAME_OF_VALUE with the actual value. +// This will be post-processed by tools/gen_ld_files.py to extract the name and vlaue. + +BOOTLOADER_SIZE; ///DEFINE_VALUE BOOTLOADER_SIZE +RAM_SIZE; ///DEFINE_VALUE RAM_SIZE lambda f: f.rstrip("UL") +FLASH_SIZE; ///DEFINE_VALUE FLASH_SIZE lambda f: f.rstrip("UL") +CIRCUITPY_INTERNAL_CONFIG_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_CONFIG_SIZE +CIRCUITPY_INTERNAL_NVM_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_NVM_SIZE +CIRCUITPY_DEFAULT_STACK_SIZE; ///DEFINE_VALUE CIRCUITPY_DEFAULT_STACK_SIZE diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 4e15a6c308..21adb10028 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -31,6 +31,30 @@ #include "include/sam.h" #ifdef SAMD21 + +// Default is 0, set by py/circuitpy_mpconfig.h +#if INTERNAL_FLASH_FILESYSTEM +// 64kB +#define INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#endif + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (256) +#endif + +// if CALIBRATE_CRYSTALLESS is requested, make room for storing +// calibration data generated from external USB. +#ifndef CIRCUITPY_INTERNAL_CONFIG_SIZE + #ifdef CALIBRATE_CRYSTALLESS +#define CIRCUITPY_INTERNAL_CONFIG_SIZE (256) + #else +#define CIRCUITPY_INTERNAL_CONFIG_SIZE (0) + #endif +#endif + +// HMCRAMC0_SIZE is defined in the ASF4 include files for each SAMD21 chip. +#define RAM_SIZE HMCRAMC0_SIZE +#define BOOTLOADER_SIZE (8*1024) #define CIRCUITPY_MCU_FAMILY samd21 #define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21" #define SPI_FLASH_MAX_BAUDRATE 8000000 @@ -54,9 +78,17 @@ X(EISDIR) \ X(EINVAL) \ -#endif +#endif // SAMD21 #ifdef SAMD51 + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (8192) +#endif + +// HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. +#define RAM_SIZE HSRAM_SIZE +#define BOOTLOADER_SIZE (16*1024) #define CIRCUITPY_MCU_FAMILY samd51 #define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51" #define SPI_FLASH_MAX_BAUDRATE 24000000 @@ -69,7 +101,8 @@ #define MICROPY_PY_UJSON (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) // MICROPY_PY_UERRNO_LIST - Use the default -#endif + +#endif // SAMD51 // Turning off audioio, audiobusio, and touchio as necessary // due to limitations of chips is handled in mpconfigboard.mk diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 88ddb49e01..63ddb5f23f 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -1,3 +1,7 @@ +# All linking can be done with this common templated linker script, which has +# parameters that vary based on chip and/or board. +LD_TEMPLATE_FILE = boards/common.template.ld + # Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk # $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. # This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. diff --git a/ports/atmel-samd/tick.c b/ports/atmel-samd/tick.c index 4d7bb9dca7..6163a64d87 100644 --- a/ports/atmel-samd/tick.c +++ b/ports/atmel-samd/tick.c @@ -56,7 +56,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/ports/cxd56/tick.c b/ports/cxd56/tick.c index 6529db7901..6b93a3b659 100644 --- a/ports/cxd56/tick.c +++ b/ports/cxd56/tick.c @@ -39,7 +39,7 @@ void board_timerhook(void) #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif } diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld index 90b8862cf0..74e66754d8 100644 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld @@ -19,11 +19,12 @@ /* Specify the memory areas (S140 6.x.x) */ MEMORY { - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x086000 FLASH_FATFS (r) : ORIGIN = 0x000AD000, LENGTH = 0x040000 + FLASH_NVM (r) : ORIGIN = 0x000EC000, LENGTH = 0x001000 FLASH_CONFIG (r): ORIGIN = 0x000ED000, LENGTH = 0x007000 /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 1e55cd0260..cc441eb0b0 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -55,12 +55,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_15 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_P0_04) #define DEFAULT_I2C_BUS_SDA (&pin_P0_05) diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld index dfb355a76f..fade4b9e1b 100644 --- a/ports/nrf/boards/common.ld +++ b/ports/nrf/boards/common.ld @@ -6,6 +6,10 @@ __fatfs_flash_length = LENGTH(FLASH_FATFS); __config_flash_start_addr = ORIGIN(FLASH_CONFIG); __config_flash_length = LENGTH(FLASH_CONFIG); +/* Flash region for microcontroller.nvm region */ +__nvm_flash_start_addr = ORIGIN(FLASH_NVM); +__nvm_flash_length = LENGTH(FLASH_NVM); + /* define output sections */ SECTIONS { diff --git a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h index 21e8c3ef61..6b0813e7d0 100644 --- a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h +++ b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h @@ -34,12 +34,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) diff --git a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h index 7f5021fdca..594c3e54c9 100644 --- a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h +++ b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h @@ -33,12 +33,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_06) diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index 70ccffc3f3..130c5f3e8b 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -54,12 +54,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_20 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h index ed48364942..093a0df3bd 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h @@ -40,12 +40,6 @@ #define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 3) #define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 8) -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 0 #define DEFAULT_UART_BUS_RX (&pin_P0_19) diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h index d4096503d7..2128428b85 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h @@ -33,10 +33,4 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "MakerDiary52840MDKDongle" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 // according to the schematic we do diff --git a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h index 520eef90d9..99ed5c785b 100644 --- a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h @@ -54,12 +54,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_20 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_16) diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.h b/ports/nrf/boards/particle_argon/mpconfigboard.h index a4ecb2bb43..0d74869b1d 100644 --- a/ports/nrf/boards/particle_argon/mpconfigboard.h +++ b/ports/nrf/boards/particle_argon/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.h b/ports/nrf/boards/particle_boron/mpconfigboard.h index 5e817311f9..61af22f580 100644 --- a/ports/nrf/boards/particle_boron/mpconfigboard.h +++ b/ports/nrf/boards/particle_boron/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/particle_xenon/mpconfigboard.h b/ports/nrf/boards/particle_xenon/mpconfigboard.h index 6c8cc7cef2..c2dfffde85 100644 --- a/ports/nrf/boards/particle_xenon/mpconfigboard.h +++ b/ports/nrf/boards/particle_xenon/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/pca10056/mpconfigboard.h b/ports/nrf/boards/pca10056/mpconfigboard.h index 48ef7f1c39..eca339a7db 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.h +++ b/ports/nrf/boards/pca10056/mpconfigboard.h @@ -30,8 +30,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "nRF52840-DK" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - #define MICROPY_HW_LED_STATUS (&pin_P0_13) #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/pca10059/mpconfigboard.h b/ports/nrf/boards/pca10059/mpconfigboard.h index d5ce212292..eaca1bf210 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.h +++ b/ports/nrf/boards/pca10059/mpconfigboard.h @@ -29,5 +29,3 @@ #define MICROPY_PY_SYS_PLATFORM "nRF52840-DK" #define MICROPY_HW_LED_STATUS (&pin_P0_06) - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h index a5ed69b2bd..20a99a6953 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h @@ -30,8 +30,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "SFE_NRF52840_Mini" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) #define DEFAULT_I2C_BUS_SDA (&pin_P0_08) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index a8e1f19059..76f08b5ed3 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -39,12 +39,21 @@ #include "supervisor/usb.h" #include "shared-bindings/_bleio/Adapter.h" #include "shared-bindings/_bleio/Address.h" +#include "shared-bindings/nvm/ByteArray.h" #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_MAX_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_SLAVE_LATENCY 0 #define BLE_CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) +const nvm_bytearray_obj_t common_hal_bleio_nvm_obj = { + .base = { + .type = &nvm_bytearray_type, + }, + .len = CIRCUITPY_BLE_CONFIG_SIZE, + .start_address = CIRCUITPY_BLE_CONFIG_ADDRESS, +}; + STATIC void softdevice_assert_handler(uint32_t id, uint32_t pc, uint32_t info) { mp_raise_msg_varg(&mp_type_AssertionError, translate("Soft device assert, id: 0x%08lX, pc: 0x%08lX"), id, pc); diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index a6b1c4ba3b..eea3d43cec 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -76,11 +76,14 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }; #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 + // The singleton nvm.ByteArray object. const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { .type = &nvm_bytearray_type, - }, + } + .start_address = CIRCUITPY_INTERNAL_NVM_ADDRESS, + .len = CIRCUITPY_INTERNAL_NVM_SIZE, }; #endif diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index ee270f79bb..416768101d 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -31,19 +31,12 @@ #include "peripherals/nrf/nvm.h" -// defined in linker -extern uint32_t __fatfs_flash_start_addr[]; -extern uint32_t __fatfs_flash_length[]; - -#define NVM_START_ADDR ((uint32_t)__fatfs_flash_start_addr + \ - (uint32_t)__fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) - uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { - return CIRCUITPY_INTERNAL_NVM_SIZE; + return self->len; } static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { - // Write a whole page to flash, buffering it first and then erasing and rewriting + // Write a whole page to flash, buffering it first and then erasing and rewriting // it since we can only clear a whole page at a time. if (offset == 0 && len == FLASH_PAGE_SIZE) { @@ -59,7 +52,7 @@ static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { - uint32_t address = NVM_START_ADDR + start_index; + uint32_t address = self->start_address + start_index; uint32_t offset = address % FLASH_PAGE_SIZE; uint32_t page_addr = address - offset; @@ -76,5 +69,5 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t* values) { - memcpy(values, (uint8_t *)(NVM_START_ADDR + start_index), len); + memcpy(values, self->start_address + start_index, len); } diff --git a/ports/nrf/common-hal/nvm/ByteArray.h b/ports/nrf/common-hal/nvm/ByteArray.h index a8d09dd43a..c048d55778 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.h +++ b/ports/nrf/common-hal/nvm/ByteArray.h @@ -31,6 +31,8 @@ typedef struct { mp_obj_base_t base; + uint8_t* start_address; + uint32_t len; } nvm_bytearray_obj_t; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 9c3d02f44d..3cb086f310 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -43,6 +43,10 @@ #include "py/circuitpy_mpconfig.h" +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) +#endif + #ifndef BOARD_HAS_32KHZ_XTAL // Assume crystal is present, which is the most common case. #define BOARD_HAS_32KHZ_XTAL (1) diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h index 4eac3d7283..60a663e81f 100644 --- a/ports/nrf/peripherals/nrf/nvm.h +++ b/ports/nrf/peripherals/nrf/nvm.h @@ -27,8 +27,4 @@ #define FLASH_PAGE_SIZE (4096) -#ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (0) -#endif - void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index dcacd4d27f..c43454eb39 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -67,7 +67,7 @@ uint32_t supervisor_flash_get_block_size(void) { } uint32_t supervisor_flash_get_block_count(void) { - return ((uint32_t) __fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) / FILESYSTEM_BLOCK_SIZE ; + return ((uint32_t) __fatfs_flash_length) / FILESYSTEM_BLOCK_SIZE ; } void supervisor_flash_flush(void) { @@ -120,4 +120,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/nrf/tick.c b/ports/nrf/tick.c index 6d8fd13e0a..1a9e69a8c7 100644 --- a/ports/nrf/tick.c +++ b/ports/nrf/tick.c @@ -43,7 +43,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/ports/stm32f4/boards/feather_f405/mpconfigboard.h b/ports/stm32f4/boards/feather_f405/mpconfigboard.h index 831a17573a..908b35a71e 100644 --- a/ports/stm32f4/boards/feather_f405/mpconfigboard.h +++ b/ports/stm32f4/boards/feather_f405/mpconfigboard.h @@ -33,9 +33,6 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - // On-board flash #define SPI_FLASH_MOSI_PIN &pin_PB05 #define SPI_FLASH_MISO_PIN &pin_PB04 diff --git a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h index e8441d665c..d793a222f6 100644 --- a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h @@ -32,6 +32,3 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) \ No newline at end of file diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h index d5491fe362..5bea089750 100644 --- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h @@ -32,9 +32,3 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) - -#define AUTORESET_DELAY_MS 500 diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h index ebee98f89f..9e23f1db54 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h @@ -32,7 +32,3 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - diff --git a/ports/stm32f4/tick.c b/ports/stm32f4/tick.c index 43521fb516..b417df3059 100644 --- a/ports/stm32f4/tick.c +++ b/ports/stm32f4/tick.c @@ -44,7 +44,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index b72d753904..915310f83a 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -296,7 +296,6 @@ $(filter $(SRC_PATTERNS), \ fontio/Glyph.c \ microcontroller/RunMode.c \ math/__init__.c \ - supervisor/__init__.c \ ) SRC_BINDINGS_ENUMS += \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 2cb6178198..91e2e223c2 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -212,7 +212,6 @@ typedef long mp_off_t; #define MP_SSIZE_MAX (0x7fffffff) #endif - // These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off. // So if any are not defined in *.mk, they'll throw an error here. @@ -661,8 +660,20 @@ void run_background_tasks(void); #define MICROPY_VM_HOOK_LOOP run_background_tasks(); #define MICROPY_VM_HOOK_RETURN run_background_tasks(); +// CIRCUITPY_AUTORELOAD_DELAY_MS = 0 will completely disable autoreload. +#ifndef CIRCUITPY_AUTORELOAD_DELAY_MS #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 +#endif + +#ifndef CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS #define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000 +#endif + +// Default is no internal flash filesystem. +#ifndef INTERNAL_FLASH_FILESYSTEM_SIZE +#define INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" #endif // __INCLUDED_MPCONFIG_CIRCUITPY_H diff --git a/tools/gen_ld_files.py b/tools/gen_ld_files.py new file mode 100755 index 0000000000..fc80d46c9e --- /dev/null +++ b/tools/gen_ld_files.py @@ -0,0 +1,47 @@ +#! /usr/bin/env python3 +import argparse + +import os +import os.path +import sys +import re +from string import Template + +parser = argparse.ArgumentParser(description='Apply #define values to .template.ld file.') +parser.add_argument('template_files', metavar='TEMPLATE_FILE', type=argparse.FileType('r'), + nargs='+', help="template filename: .template.ld") +parser.add_argument('--defines', type=argparse.FileType('r'), required=True) +parser.add_argument('--out_dir', required=True) + +args = parser.parse_args() + +defines = {} + +# We're looking for lines like this: +# ///DEFINE_VALUE NAME_OF_VALUE +VALUE_LINE_RE = re.compile(r'^([^/].*); ///DEFINE_VALUE (\w+)(.*)$') + +for line in args.defines: + match = VALUE_LINE_RE.match(line.strip()) + if match: + value = match.group(1).strip() + name = match.group(2) + lambda_exp = match.group(3).strip() + # Apply the given lambda to the value if it is present, else just store the value. + defines[match.group(2)] = eval(lambda_exp)(value) if lambda_exp else value + +#print(defines) +fail = False + +for template_file in args.template_files: + ld_template_basename = os.path.basename(template_file.name) + ld_pathname = os.path.join(args.out_dir, ld_template_basename.replace('.template.ld', '.ld')) + with open(ld_pathname, 'w') as output: + try: + output.write(Template(template_file.read()).substitute(defines)) + except KeyError as e: + print("ERROR: {}: No #define for '{}'".format(ld_pathname, e.args[0]), file=sys.stderr) + fail = True + +if fail: + sys.exit(1)