When using USB with CONFIG_NO_OPTIMIZATIONS=y I'm getting a usage fault and Zephyr gives the reason K_ERR_STACK_CHK_FAIL. The fault looks like it occurs in the unnamed thread created near the bottom of usb_dc_nrfx.c.
If CONFIG_NO_OPTIMIZATIONS=n then I do not see the hard faults.
I previously reported this same issue and changing the stack size to 4096 seemed to resolve it then. However, even if I increase the stack size to 8192 now I'm still seeing the fault.
CONFIG_NO_OPTIMIZATIONS=y
CONFIG_EXTRA_EXCEPTION_INFO=y
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
CONFIG_USB_DEVICE_PRODUCT="Itamar Loop CDC & MSD"
CONFIG_USB_CDC_ACM=y
CONFIG_USB_WORKQUEUE_STACK_SIZE=8192
CONFIG_USB_NRFX_WORK_QUEUE_STACK_SIZE=8192
Any ideas on what might be going on here?