Hi,
I use the board MCBSTM32Exl (http://www.keil.com/arm/mcbstm32exl/) and i wanna that my Board emulate a USB HID Keyboard (When i use the push-button User, the char 'Q' is send to my PC Host). For this, i studied the STMicroelectronics' library "USB full-speed device library" (www.st.com/.../um0424.zip) and adapted interruptions/GPIOs to use this Flibrary with my Board. Also, my PC recognize the device and i successed send data (I watched with a sniffer).
But, it's not like a keyboard, i tried to change the descriptor but it does'nt work (for exemple, my PC don't recognize the device)...
Have you any idea to help me ?
Regards, ealary.
1) Clean up wrong device instance(s) on registry On the PC Device Manager, do you see an extra keyboard, made by your device? If you wouldn't, unplug your device. a) And uninstall all the device instance(s) of VID/PID = 0x0483/0x5750, using USBDeview
USBDeview www.nirsoft.net/.../usb_devices_view.html
OR b) Assign another VID/PID on the device descriptor
2) Key interrupt ST's example sees the User Button on STM3210E-EVAL board which connects to PG8. Fortunately, Keil MCBSTM32Exl also has a User Button at PG8.
To enable interrupt on both edge,
\STM32_USB-FS-Device_Lib_V3.3.0\Utilities\STM32_EVAL\STM3210E_EVAL\stm3210e_eval.c void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode) { ... ... if(Button != BUTTON_WAKEUP) { EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; if (Button == BUTTON_KEY) // <--- add these two lines EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling; }
OR
You may poll this User Button in main loop, instead of interrupt And put above input reports at the state transition
Tsuneo
Hi
Clean the wrong instance has successed. Now my board is recognizes like a Keyboard, thank you.
But now,when i push the button the char is alway send (Like when you keep push a key).
Do you know why ?
Regards, Ealary
Do you generate any key-up event?
My keyboard with the MCBSTM32Exl board work perfectly. But now, i need to emulate the Keyboard with a single microcontroller (STM32F103RC) into a protoboard to keep just the USB feature and can add more button. I have adapted the code of MCBSTM32 to the STM32F103RC. I modified the buttons placement with the EXTIs Line and the USB_DISCONNECT pin.
But when i connect the USB line, nothing is happen. My PC don't recognize the "device" and provide just the power into the protoboard. When i look the base board schematics of MCBSTM32, i see that the D+ and D- lines are PA11 and PA12 but i see nothing in the code about this lines...
How can i do to emulate my keyboard with the protoboard ?
Check the pin connections. Connection requirements for your custom USB board are, 1) PA12 for D+ on USB connector (pin 3), PA11 for D- (pin 2) 2) PB14 for "USB Disconnect" circuitry (*1) 3) 8MHz crystal
(*1) I wrote it's PB15 in my first post, but it was wrong. On both boards (MCBSTM32Exl and STM3210E-EVAL), PB14 is the "USB Disconnect" pin.
My pins connections is correct. That why i don't understand why my PC don't recognize the protoboard :/
How about other pins? 1) BOOT0 (pin 60) - GND 2) NRST (pin 7) - JTAG TRST
BOOT0 at GND NRST at JtagTRST...
It's not a firmware issue rather that hardware connection ?
Ealary.
> It's not a firmware issue rather that hardware connection ?
The difference of STM32F103RC from STM32F103ZG, related to your project, is just FLASH memory size. The binary of MCBSTM32Exl project should work on STM32F103RC.