Stack overflow during boot when both WiFi and USB stack (CDC_ACM) are enabled

Hello,

We are in the final stages of development with a board that combines the nRF5340 with the nRF7002. This board also requires native USB support and we are routing the Zephyr console to the  USB CDC_ACM interface. USB has been working fine until we brought WiFi into the mix. Now there's a fault during boot due to a stack overflow. After quite some research we are still unable to increase the stack size of the task where the problem occurs. Please see the UART console output below:

*** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***

*** Using Zephyr OS v3.7.99-ca954a6216c9 ***

[00:00:00.207,336] <inf> net_config: Initializing network

[00:00:00.215,332] <inf> net_config: Waiting interface 1 (0x20001d90) to be up...

[00:00:00.225,616] <inf> net_config: IPv4 address: 192.168.1.99

[00:00:00.234,191] <inf> net_config: Running dhcpv4 client...

[00:00:00.243,347] <inf> udc_nrf: Initialized

[00:00:00.250,305] <inf> usbd_init: interface 0 alternate 0

[00:00:00.258,483] <inf> usbd_init:     ep 0x81 mps 0x0010 interface ep-bm 0x00020000

[00:00:00.268,646] <inf> usbd_init: interface 1 alternate 0

[00:00:00.276,855] <inf> usbd_init:     ep 0x82 mps 0x0040 interface ep-bm 0x00040000

[00:00:00.287,048] <inf> usbd_init:     ep 0x01 mps 0x0040 interface ep-bm 0x00040002

[00:00:00.297,180] <inf> usbd_init: Instance iface-bm 0x00000003 ep-bm 0x00060002

[00:00:00.307,281] <inf> usbd_init: Init class node 0x20000454, descriptor length 66

[00:00:00.317,626] <inf> usbd_init: bNumInterfaces 2 wTotalLength 75

[00:00:00.326,568] <inf> usbd_init: FS bNumConfigurations 1

[00:00:00.334,869] <inf> usbd_cdc_acm: rx_en: trigger rx_fifo_work

[00:00:00.343,780] <err> os: ***** USAGE FAULT *****

[00:00:00.351,776] <err> os:   Stack overflow (context area not valid)

[00:00:00.361,175] <err> os: r0/a1:  0x2002b864  r1/a2:  0x2002b8cc  r2/a3:  0x00000002

[00:00:00.372,039] <err> os: r3/a4:  0xffffffff r12/ip:  0x00000000 r14/lr:  0x00000064

[00:00:00.382,873] <err> os:  xpsr:  0x0005ce00

[00:00:00.390,319] <err> os: s[ 0]:  0x00000003  s[ 1]:  0x00001683  s[ 2]:  0x2002b87d  s[ 3]:  0xaaaaaaaa

[00:00:00.402,923] <err> os: s[ 4]:  0xaaaaaaaa  s[ 5]:  0x00075d40  s[ 6]:  0x00000000  s[ 7]:  0x0007e3d2

[00:00:00.415,527] <err> os: s[ 8]:  0x00000080  s[ 9]:  0xaaaaaaaa  s[10]:  0xaaaaaaaa  s[11]:  0xaaaaaaaa

[00:00:00.428,131] <err> os: s[12]:  0xaaaaaaaa  s[13]:  0xaaaaaaaa  s[14]:  0xaaaaaaaa  s[15]:  0xaaaaaaaa

[00:00:00.440,704] <err> os: fpscr:  0x0007e3d1

[00:00:00.448,120] <err> os: Faulting instruction address (r15/pc): 0x00000000

[00:00:00.458,221] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0

[00:00:00.468,292] <err> os: Current thread: 0x20003770 (udc_nrfx)

[00:00:00.477,325] <err> os: Halting system

uart:~$

Is this something that can be fixed by config settings? Or requires a patch directly in the NCS source code?

Best regards,

Daniel Campora

Related