Stack overflow issue with NRF9160 when compiler optimizations off

Hi,

I just turned off compiler optimizations with CONFIG_NO_OPTIMIZATIONS=y (before that, code was working correctly). After the change, I noticed that my program is stack overflowing during the bootup process, likely because the stack sizes of various threads increased. Seems code is crashing due to an interrupt. I turned on thread analysis with:

CONFIG_THREAD_ANALYZER=y
CONFIG_THREAD_ANALYZER_USE_PRINTK=y
CONFIG_THREAD_ANALYZER_AUTO=y
CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
CONFIG_THREAD_NAME=y

and increased the stack sizes of several variables including:

CONFIG_IDLE_STACK_SIZE=1024
CONFIG_ISR_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
CONFIG_MAIN_STACK_SIZE=8192

and then reloaded the project but still had the overflow. I also increased some numbers in the generated configs.c file (attached).

For your reference, I am running a program similar to the serial monitor sample with HTTPS. But, I commented out the HTTPS portion and still am having issues. 

It's difficult to debug this because for some reason, some messages are getting dropped in the output (below).

Do you have suggestions on what the issue is and how I can resolve it? Thanks in advance.

Related