1.. _footprint: 2 3Optimizing for Footprint 4######################## 5 6Stack Sizes 7*********** 8 9Stack sizes of various system threads are specified generously to allow for 10usage in different scenarios on as many supported platforms as possible. You 11should start the optimization process by reviewing all stack sizes and adjusting 12them for your application: 13 14:kconfig:option:`CONFIG_ISR_STACK_SIZE` 15 Set to 2048 by default 16 17:kconfig:option:`CONFIG_MAIN_STACK_SIZE` 18 Set to 1024 by default 19 20:kconfig:option:`CONFIG_IDLE_STACK_SIZE` 21 Set to 320 by default 22 23:kconfig:option:`CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE` 24 Set to 1024 by default 25 26:kconfig:option:`CONFIG_PRIVILEGED_STACK_SIZE` 27 Set to 1024 by default, depends on userspace feature. 28 29 30Unused Peripherals 31****************** 32 33Some peripherals are enabled by default. You can disable unused 34peripherals in your project configuration, for example:: 35 36 37 CONFIG_GPIO=n 38 CONFIG_SPI=n 39 40Various Debug/Informational Options 41*********************************** 42 43The following options are enabled by default to provide more information about 44the running application and to provide means for debugging and error handling: 45 46:kconfig:option:`CONFIG_BOOT_BANNER` 47 This option can be disabled to save a few bytes. 48 49:kconfig:option:`CONFIG_DEBUG` 50 This option can be disabled for production builds 51 52 53MPU/MMU Support 54*************** 55 56Depending on your application and platform needs, you can disable MPU/MMU 57support to gain some memory and improve performance. Consider the consequences 58of this configuration choice though, because you'll lose advanced stack 59checking and support. 60