Did you added the g_hid module to your image? Or how are you trying to interface with the keyboard?
Were you aware of the USBHID kernel module found on AlexT's repo? Have you tried it?
g_hid and USBHID both are enabled in the image that i m using.
Can you tell us what image you are using? And if you are using a custom image, what changes did you make to it?
Would you let us know step by step what you did before this error message appeared?
Do you have updates? Have you been able to load the g_hid?
Also are you doing these changes in the defconfig or with the menuconfig?
Have you tried to enable it in the defconfig instead of setting it as a module?