Hello,
I am working with a nRF5340 and need to use both CDC and mass storage on SD Card. I started my application based on the CDC example and it has worked fine.
Now I need to implement the SD Card. Using the mass storage example from zephyr, it has kind of worked. The file system is started OK and the card is detected and read. But when the USB is started, an Stack Overflow occurs.
Nevertheless, I merged the SD Card functions into my app. It has performed better, as the USB can start and the removable disk can be accessed in windows. But, in order to have it working, it is necessary to disable the CDC initialization, otherwise it will also genarate an Stack overflow. My questions are:
- Why does the CDC API utilizes a physical UART port? I found that the UARTE0 is being initialized when CDC is enabled and some of the chosen pins are the ones I use in my SPI interface with the SD Card.
- Wasn't the mass storage example supposed to work without problems in the nRF5340?
- What could be the cause for the Stack Overflow? I have incresed the reserved stack (CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE and CONFIG_MAIN_STACK_SIZE) up to 256kB and didn't had any improvements.
- Is there any known example on zephyr runnig both CDC and SD Card?
I have attached my overlay file and a log of the error.
My environment is:
Windows 11, VSCode and NCS v1.9.
Any help would be really appreciated.
Thanks in advance,
Eduardo Carletti