Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 26, 2024, 08:28:19 20:28


Login with username, password and session length


Pages: [1]
Print
Author Topic: STM32F103C8T6 USB HID problem  (Read 4494 times)
0 Members and 1 Guest are viewing this topic.
Kombinator
Junior Member
**
Offline Offline

Posts: 84

Thank You
-Given: 39
-Receive: 32



« on: August 06, 2016, 11:49:28 11:49 »

Hello
I trying to set up a USB HID STM32F103C8 board. Use MicroC ARM 4.9.0 and TOP's MED18.
I use the example of Mikroelektronika Help site with USBdsc.c generated file Аfter compilation
PC says "USB Device  not Recognized".
SYSCLK is correct. A8 PIN have 36MHz. Waveforms of USB D + and D- look good.
USB communication with other project works well.
Is it possible to receive compiled BIN file from another microC ARM with real license .
Or working project MikroC ARM with this processor and usb HID

Attach generated BIN and HEX file.

Code is here:
Code:
 //void USB1Interrupt() {
 // USB_Interrupt_Proc();
//}

unsigned long int i = 0;

char cnt;
char kk;
char readbuff[64];
char writebuff[64];   
void main() {
GPIO_Config(&GPIOA_BASE, _GPIO_PINMASK_8, (_GPIO_CFG_MODE_ALT_FUNCTION | _GPIO_CFG_SPEED_50MHZ | _GPIO_CFG_OTYPE_PP));  //Set PA8 as a high speed digital output
  HID_Enable(&readbuff,&writebuff);

  while(1){
  USB_Polling_Proc();      // Call this routine periodically
    kk =HID_Read();

    if(kk != 0){
      for(cnt=0;cnt<64;cnt++);
        writebuff[cnt]=readbuff[cnt];
     HID_Write(&writebuff,64);
    }
  }
}


STM32CubeMX   The configuration is correct

Settings configuration file of the project is as STM32CubeMX .

« Last Edit: August 08, 2016, 10:03:23 10:03 by Kombinator » Logged
Kombinator
Junior Member
**
Offline Offline

Posts: 84

Thank You
-Given: 39
-Receive: 32



« Reply #1 on: August 06, 2016, 04:34:30 16:34 »

Problem is :
Code:
const char USB_INTERRUPT = 1; // in descriptor file must by 0;
Completely incomprehensible to me   must be declared, not used in mine(); Without the i variable does not work HID_Read();
Code:
unsigned long int i = 0;     

TOP's MED18 It works well with USB and limit code
« Last Edit: August 07, 2016, 09:11:41 09:11 by Kombinator » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC