diff --git a/doc/guides/index.rst b/doc/guides/index.rst index 030bcccf73c76..675fe149ac2b2 100644 --- a/doc/guides/index.rst +++ b/doc/guides/index.rst @@ -25,3 +25,4 @@ User and Developer Guides test/index tracing/index west/index + optimizations/index diff --git a/doc/guides/optimizations/footprint.rst b/doc/guides/optimizations/footprint.rst new file mode 100644 index 0000000000000..73d11995f85bf --- /dev/null +++ b/doc/guides/optimizations/footprint.rst @@ -0,0 +1,62 @@ +.. _footprint: + +Optimizing for Footprint +######################## + +Stack Sizes +*********** + +Stack sizes of various system threads are specified generously to allow for +usage in different scenarios on as many supported platforms as possible. You +should start the optimization process by reviewing all stack sizes and adjusting +them for your application: + +:option:`CONFIG_ISR_STACK_SIZE` + Set to 2048 by default + +:option:`CONFIG_MAIN_STACK_SIZE` + Set to 1024 by default + +:option:`CONFIG_IDLE_STACK_SIZE` + Set to 320 by default + +:option:`CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE` + Set to 1024 by default + +:option:`CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE` + Set to 1024 by default + +:option:`CONFIG_PRIVILEGED_STACK_SIZE` + Set to 1024 by default, depends on userspace feature. + + +Unused Peripherals +****************** + +Some peripherals are enabled by default. You can disable unused +peripherals in your project configuration, for example:: + + + CONFIG_GPIO=n + CONFIG_SPI=n + +Various Debug/Informational Options +*********************************** + +The following options are enabled by default to provide more information about +the running application and to provide means for debugging and error handling: + +:option:`CONFIG_BOOT_BANNER` + This option can be disabled to save a few bytes. + +:option:`CONFIG_DEBUG` + This option can be disabled for production builds + + +MPU/MMU Support +*************** + +Depending on your application and platform needs, you can disable MPU/MMU +support to gain some memory and improve performance. Consider the consequences +of this configuration choice though, because you'll lose advanced stack +checking and support. diff --git a/doc/guides/optimizations/index.rst b/doc/guides/optimizations/index.rst new file mode 100644 index 0000000000000..cddc5f6b02990 --- /dev/null +++ b/doc/guides/optimizations/index.rst @@ -0,0 +1,11 @@ +.. _optimizations: + +Optimizations +############## + +Guides on how to optimize Zephyr for performance, power and footprint. + +.. toctree:: + :maxdepth: 1 + + footprint.rst