From 51311948be03292921c267723a0879a82e516d4a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 9 Apr 2025 22:48:29 -0400 Subject: [PATCH] atsamd: Enable HAVE_LIMITED_CODE_SIZE on small atsamd chips Signed-off-by: Kevin O'Connor --- src/atsamd/Kconfig | 1 + src/atsamd/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/src/atsamd/Kconfig b/src/atsamd/Kconfig index 991e0376..2d08b179 100644 --- a/src/atsamd/Kconfig +++ b/src/atsamd/Kconfig @@ -14,6 +14,7 @@ config ATSAMD_SELECT select HAVE_CHIPID select HAVE_STEPPER_OPTIMIZED_BOTH_EDGE select HAVE_BOOTLOADER_REQUEST + select HAVE_LIMITED_CODE_SIZE if FLASH_SIZE < 0x10000 config HAVE_SERCOM depends on HAVE_GPIO_I2C || HAVE_GPIO_SPI diff --git a/src/atsamd/Makefile b/src/atsamd/Makefile index 2416200f..c79c0a93 100644 --- a/src/atsamd/Makefile +++ b/src/atsamd/Makefile @@ -7,6 +7,7 @@ dirs-y += src/atsamd src/generic lib/fast-hash MCU := $(shell echo $(CONFIG_MCU) | tr a-z A-Z) +CFLAGS-$(CONFIG_HAVE_LIMITED_CODE_SIZE) += -Os CFLAGS-$(CONFIG_MACH_SAMC21) += -mcpu=cortex-m0plus -Ilib/samc21/samc21/include CFLAGS-$(CONFIG_MACH_SAMD21) += -mcpu=cortex-m0plus -Ilib/samd21/samd21a/include CFLAGS-$(CONFIG_MACH_SAMD51) += -Ilib/samd51/samd51a/include