mips32r2_generic/include/cpu_conf.h

Common CPU definitions for MIPS32R2 compliant devices.

THREAD_EXTRA_STACKSIZE_PRINTF

Configuration of default stack sizes.

1
(1024)

printf takes a pretty tortured route through the C lib then via UHI syscall exception to end up at the UART driver.

When debugging timer code we get printfs on the idle threads stack which can easily blow its limits.

Note code must be compiled at -Os with these values, using -O0 you’ll overflow these stacks.

NO ISR stack is in use yet, interrupt use the current running stack hence the big-ish default stack size.

THREAD_STACKSIZE_DEFAULT
1
(2048)
THREAD_STACKSIZE_IDLE
1
(512 + THREAD_EXTRA_STACKSIZE_PRINTF)