Problems using USB mass storage middleware with BLE stack on STM32WB55?
I'm developing an application which uses both USB mass storage and BLE. I've started by building two separate applications using STM32CubeMX:
- A USB mass storage application communicating with a microSD card over SPI1
- A BLE P2P server
Both of these work fine on their own. But if I build an application that includes both components, the USB mass storage device will not enumerate properly.
Initially, I discovered that in the full application, HAL_PCD_IRQHandler got called, but it never fell through to PCD_EP_ISR_Handler. This makes me think the mass storage endpoints have not been configured properly.
I've also tackled the problem a different way--by systematically eliminating parts of the BLE initialization to determine what is interfering with USB mass storage. Using this method, I've been able to determine that if I comment out the call to SHCI_C2_BLE_Init in APP_BLE_Init (in app_ble.c), USB mass storage enumerates properly. If I then uncomment this line, it stops working again.
SHCI_C2_BLE_Init simply sends a message to CPU telling it to start the BLE stack, so this makes me think that the BLE stack on CPU2 is somehow interfering with USB endpoints configured before the call to APPE_Init in main.c.
I believe USB is a shared resource between CPU1 and CPU2, so it seems likely that the BLE stack is also trying to do something with USB. However, I'm at a loss as to how to debug this further or how to avoid the problem.
Any help would be greatly appreciated!
Michael