When I compiling the project downloaded from http://www.keil.com/download/list/arm.htm, I met: STM32_Init.c(4968): error: #20: identifier "GPIOF" is undefined STM32_Init.c(4974): error: #20: identifier "GPIOG" is undefined usbhw.c(92): error: #136: struct "<unnamed>" has no field "IPR" usbhw.c(93): error: #136: struct "<unnamed>" has no field "ISER", and after I deleted them and downloaded to the MCBSTM32 board, I saw an "unkonwn device" displayed in the screen after connected to my PC, anything wrong since it is said "The example is tesed with the Keil Evaluation Board MCBSTM32."
I think this means you have the wrong version of the ST FWLib.
The names were changed somewhere along the lines, so you get these errors if your source is assuming one version, but finding the other...
Help~
I tried to use this sample (http://www.keil.com/download/docs/361.asp) with STM32F101R8
from the sample, I just tried to use the USB Part by removing LCD and button related funtions. This is what I did.
demo.c - main() // lcd_init(); // lcd_clear(); // lcd_print (" MCBSTM32 HID "); // set_cursor (0, 1); // lcd_print (" http://www.keil.com ");
hiduser.c - HID_GetReport() // GetInReport(); // EP0Buf[0] = InReport;
- USB_Configure_Event() // GetInReport(); // USB_WriteEP(0x81, &InReport, sizeof(InReport));
- USB_EndPoint1() // GetInReport(); // USB_WriteEP(0x81, &InReport, sizeof(InReport));
- HID_SetReport() // SetOutReport();
This device was recognized as HID device. However, USB_GetStatus() was called and port was reseted every 5 seconds.
Can anyone tell me why this is happening and how to solve this problem?
> every 5 seconds
The number is typical timeout for USB requests, which is defined in the spec. Get_Status request is issued as a part of error recovery after timeout.
For HID, Get_Report and Set_Report requests over the default endpoint may cause timeout. The Interrupt IN EP doesn't cause timeout in any case. Optional interrupt OUT EP, doesn't cause any timeout, either, unless PC app explicitly cancels the transfer.
I think the problem is caused by Get_Report or Set_Report requests, but your modification seems not to affect to these handlers so much as it stops the response.
Humm.. Do you see any Get_Report or Set_Report on sniffer, before starting error recovery?
Tsuneo