CONFIG_MAIN_STACK_SIZE

Size of stack for initialization and main thread

Type: int

Help

When the initialization is complete, the thread executing it then
executes the main() routine, so as to reuse the stack used by the
initialization, which would be wasted RAM otherwise.

After initialization is complete, the thread runs main().

Defaults

Kconfig definitions

At <Zephyr>/boards/arm/mps2_an385/Kconfig.defconfig:49

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:22

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 4096
    depends on COVERAGE && BOARD_MPS2_AN385

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em4:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:14

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM4 && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em5d:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:15

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM5D && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em6:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:16

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM6 && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em7d:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:17

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM7D && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em9d:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:19

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM9D && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em11d:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:20

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM11D && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsk/Kconfig.defconfig.em7d:43

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_emsk/Kconfig.defconfig:10

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on ARC_MPU_VER = 2 && SOC_EMSK_EM7D && SOC_EMSK

At <Zephyr>/soc/arc/snps_nsim/Kconfig.defconfig.em:41

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_nsim/Kconfig.defconfig:12

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on ARC_MPU_VER = 2 && SOC_NSIM_EM && SOC_NSIM

At <Zephyr>/soc/arc/snps_nsim/Kconfig.defconfig.em7d_v22:38

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/arc/snps_nsim/Kconfig.defconfig:13

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on ARC_MPU_VER = 2 && SOC_NSIM_EM7D_V22 && SOC_NSIM

At <Zephyr>/soc/riscv/riscv-privilege/andes_v5/Kconfig.defconfig.ae350:12

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/riscv/riscv-privilege/Kconfig.defconfig:6<Zephyr>/soc/riscv/riscv-privilege/andes_v5/Kconfig.defconfig.series:9

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_RISCV_ANDES_AE350 && SOC_SERIES_RISCV_ANDES_V5

At <Zephyr>/soc/riscv/riscv-privilege/telink_b91/Kconfig.defconfig.series:38

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:25<nRF>/doc/_build/kconfig/Kconfig.soc.defconfig:1<Zephyr>/soc/riscv/riscv-privilege/Kconfig.defconfig:6

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_SERIES_RISCV_TELINK_B91

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em4:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:14

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM4 && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em5d:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:15

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM5D && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em6:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:16

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM6 && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em7d:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:17

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM7D && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em9d:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:19

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM9D && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig.em11d:30

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_emsdp/Kconfig.defconfig:20

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_EMSDP_EM11D && SOC_ARC_EMSDP

At <Zephyr>/soc/arc/snps_emsk/Kconfig.defconfig.em7d:43

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_emsk/Kconfig.defconfig:10

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on ARC_MPU_VER = 2 && SOC_EMSK_EM7D && SOC_EMSK

At <Zephyr>/soc/arc/snps_nsim/Kconfig.defconfig.em:41

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_nsim/Kconfig.defconfig:12

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on ARC_MPU_VER = 2 && SOC_NSIM_EM && SOC_NSIM

At <Zephyr>/soc/arc/snps_nsim/Kconfig.defconfig.em7d_v22:38

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/arc/snps_nsim/Kconfig.defconfig:13

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on ARC_MPU_VER = 2 && SOC_NSIM_EM7D_V22 && SOC_NSIM

At <Zephyr>/soc/riscv/riscv-privilege/andes_v5/Kconfig.defconfig.ae350:12

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/riscv/riscv-privilege/Kconfig.defconfig:6<Zephyr>/soc/riscv/riscv-privilege/andes_v5/Kconfig.defconfig.series:9

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_RISCV_ANDES_AE350 && SOC_SERIES_RISCV_ANDES_V5

At <Zephyr>/soc/riscv/riscv-privilege/telink_b91/Kconfig.defconfig.series:38

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:27<Zephyr>/soc/riscv/riscv-privilege/Kconfig.defconfig:6

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on SOC_SERIES_RISCV_TELINK_B91

At <nRF>/subsys/net/openthread/Kconfig.defconfig:25

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:33<Zephyr>/modules/Kconfig:6<nRF>/doc/_build/kconfig/Kconfig.modules:2<nRF>/Kconfig.nrf:7

Menu path: (Top) → Modules → nrf (/home/runner/work/sdk-nrf/sdk-nrf/ncs/nrf)

config MAIN_STACK_SIZE
    int
    default 2048
    depends on NET_L2_OPENTHREAD

At <nRF>/Kconfig.nrf:40

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:33<Zephyr>/modules/Kconfig:6<nRF>/doc/_build/kconfig/Kconfig.modules:2

Menu path: (Top) → Modules → nrf (/home/runner/work/sdk-nrf/sdk-nrf/ncs/nrf) → Nordic nRF Connect

config MAIN_STACK_SIZE
    int
    default 2048 if ZTEST
    default 2048 if ENTROPY_CC3XX && !(SPM || BUILD_WITH_TFM)

At <Zephyr>/arch/arc/Kconfig:363

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:39<Zephyr>/arch/Kconfig:12

Menu path: (Top)

config MAIN_STACK_SIZE
    int
    default 4096 if 64BIT

At <Zephyr>/arch/arm64/core/Kconfig:54

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:39<Zephyr>/arch/Kconfig:12<Zephyr>/arch/arm64/Kconfig:32

Menu path: (Top) → ARM64 Options

config MAIN_STACK_SIZE
    int
    default 4096
    depends on ARM64

At <Zephyr>/arch/riscv/Kconfig:154

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:39<Zephyr>/arch/Kconfig:12

Menu path: (Top) → RISCV Options

config MAIN_STACK_SIZE
    int
    default 4096 if 64BIT
    depends on RISCV

At <Zephyr>/arch/sparc/Kconfig:37

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:39<Zephyr>/arch/Kconfig:12

Menu path: (Top) → SPARC Options

config MAIN_STACK_SIZE
    int
    default 4096 if COVERAGE_GCOV
    default 2048
    depends on SPARC

At <Zephyr>/arch/x86/core/Kconfig.intel64:8

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:39<Zephyr>/arch/Kconfig:12<Zephyr>/arch/x86/Kconfig:483

Menu path: (Top) → X86 Architecture Options

config MAIN_STACK_SIZE
    int
    default 8192
    depends on X86_64 && X86

At <Zephyr>/kernel/Kconfig:154

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:40

Menu path: (Top) → General Kernel Options

config MAIN_STACK_SIZE
    int "Size of stack for initialization and main thread"
    default 2048 if COVERAGE_GCOV
    default 1024 if TEST_ARM_CORTEX_M
    default 512 if ZTEST && !(RISCV || X86)
    default 1024
    help
      When the initialization is complete, the thread executing it then
      executes the main() routine, so as to reuse the stack used by the
      initialization, which would be wasted RAM otherwise.

      After initialization is complete, the thread runs main().

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)