2016-12-22 06:36 PM
Hello everyone! I use CubeMX to generate projects for stm32f042f6 USB custom HID mode, when I configured parameters ,download to my circuit board,connect it to PC,but the USB HID Demonstrator do not display any message;
Configuration is as follows:
I wonder if the stm32f042 can realize this function of custom HID mode?
Thank you for your answer to my question first?
#cubemx-stm32f042-custom-hid2016-12-23 01:43 AM
Hi !
I've done a custom hid device with the same uC as you, the STM32F042F6. So I can tell you that it is possible. Even if I didn't use CubeMX, but rather the SPL version of the USB lib for F0x2.
One thing I don't understand from your pictures is the clock tree configuration. You seem to have a crystal connected (from the GPIO view), why don't you use it as a clock source for the USB ? The USB needs a precise clock, so a crystal would be better than HSI. But you can also choose HSI48 as a clock source for the USB (and for the system if you like) and use the SOF event to recalibrate automatically the HSI48 at run time (this is what I did and it worked). Maybe the clock instability is why the device is showing with an exclamation mark on its icon. Can you tell us what is the error/warning message related to your device (right-click->properties) ?
2016-12-23 06:32 PM
Thank you for your answer to my question!
After the USB device to connect the computer shows that the equipment cannot be started, the error code 10.What does this error mean?
When I try to use HSE will lead to my USB device shows unable to connect, so I just choose HSI.After listening to your advice, I will check for HSE issues first !
Thanks a lot!!
2016-12-24 11:58 PM
You must increase size of stack & heap
2016-12-25 06:55 AM
?@chernobay.vitaliy: By how much? What would be reasonable values to use for the stack & heap sizes? I have run into the same problem as Fei.
Thanks (Ñ��?¿�?°Ñ��?¸�?±�?¾),
Dale
2016-12-25 07:25 AM
pick experimentally
1000-4000