2025-12-24 2:30 PM
I'm working on a project based on the STM32WB5MMG module that must support the following three building blocks:
The examples for the STM32WB5MM-DK are non-existent and the only useful examples I could find in the STM32Cube_FW_WB_V1.24.0 repository were for the P-NUCLEO-WB55.Nucleo.
After weeks of tweaking and much struggle I was able to create a project with USB, FreeRTOS, and ZigBee APS Coordinator that compiles and kinda works. This is how I did it.
First, I created a project for the STM32WB5MMG using STM32CubeMX where I added and configured the USB and FreeRTOS. I Also added "RF" since that is the only thing related to ZigBee you can do there. This project which only has USB runs fine and works well.
Then, I took the two P-NUCLEO-WB55.Nucleo projects; Zigbee_APS_Coord and Zigbee_OnOff_Server_Coord_FreeRTOS, and I was able to merge them together to have a FreeRTOS-based Zigbee APS Coordinator. Then after long sessions of comparing projects I was able to merge the FreeRTOS-based Zigbee APS Coordinator code into the USB with FreeRTOS project I generated with CubeMX.
And here comes the brick wall I've hit. I haven't been able to make the whole thing work at the same time. I can either have functional USB or functional zigbee. I mean. I have this line in main which is the critical part:
MX_APPE_Init();If I leave that line, then ZigBee works perfectly fine but the USB doesn't work. It doesn't even enumerate. BUT! if I comment out that line, then USB works perfectly fine but I don't have any ZigBee.
I haven't been able to figure this out. Not even gemini and claude have been able to figure this out (I think mainly because there is no sample project with both USB and ZigBee which makes sense).
Is there anyone here that has a similar project or can help me figure out what's missing?
I have attached the whole project as reference. FYI: It has all the code it needs so it compiles even if the STM32WBCubeFW is not present and it works only on VSCode.
Thanks!!