2021-12-08 09:05 AM
I'm trying to recreate one of the example projects from https://github.com/STMicroelectronics/x-cube-azrtos-f4/tree/main/Projects/STM32469I-Discovery/Applications/USBX/Ux_Device_CDC_ACM
I have a nucleo-F446ZE board for this test.
I created the bare project in CubeMX and added the Azure RTOS software components. I then added the methods from the above example and compiled. Running this on the board fails with a memory error unless I increase the ux static memory size to 74*1024. After that I can connect the USB port to my laptop and get a device appearing but it has 'device descriptor' errors.
I'm confused about the dynamic memory comment in the example readme, even though the example itself suggests static allocation for the ux components. I'm not sure what to look at next to debug this further, any suggestions are welcome.
My project code is here: https://github.com/jonbramble/rtos_usbx_barebones
Solved! Go to Solution.
2021-12-14 03:33 AM
Hello @jbramble
Welcome to ST Community :smiling_face_with_smiling_eyes:
I checked your example and identified the problem.
The USART3_IRQHandler() and OTG_FS_IRQHandler() interrupt handlers are missing from the stm32f4xx_it.c file.
You must therefore configure the NVIC Interrupt Table and enable the USART3 and USB interrupts.
Please follow this configuration :
Please click on Select as Best if my post fully answered your question. This will help other customers with the same issue to find the solution faster!
BeST Regards,
Walid
2021-12-14 03:33 AM
Hello @jbramble
Welcome to ST Community :smiling_face_with_smiling_eyes:
I checked your example and identified the problem.
The USART3_IRQHandler() and OTG_FS_IRQHandler() interrupt handlers are missing from the stm32f4xx_it.c file.
You must therefore configure the NVIC Interrupt Table and enable the USART3 and USB interrupts.
Please follow this configuration :
Please click on Select as Best if my post fully answered your question. This will help other customers with the same issue to find the solution faster!
BeST Regards,
Walid
2021-12-15 03:50 AM
Dear Walid,
Thanks for taking the time to look through my example code. I have added those with cubemx and made progress, the device descriptor errors are gone. I now have a USB Serial Device in device manager that says "failed to start" error code 10. I will try to do some debugging from here.
I reduced the USBX_MEMORY_SIZE to 15kB, less than this results in a memory allocation error.
So not totally working yet, but a step forward,
Best Regards
Jonathan
2021-12-15 05:24 AM
Hello @jbramble
I have tested your example with the update described above and the USB works well for me.
This is a bit strange. Try to follow the README and let me know if your problem has been resolved.
BeST Regards,
Walid
2021-12-21 01:21 PM
Hi Walid,
I changed the USB end point address and that fixed it.
I pushed the changes should this be of use to others.
Thanks for the help, I can now continue with my project ideas.
Jonathan
2021-12-22 12:32 AM
Good news :smiling_face_with_smiling_eyes: Glad to hear that.