cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-F103RB + USB

lemac
Associate II
Posted on November 03, 2014 at 16:33

Hello

I have a board Nucleo-F103RB. 

I cut a usb cable and connect:

D+ to PA11 

D- to PA12 

GND to GND pin in morpho headers 

VCC to E5V pin in morpho headers

I am using the libraries. STM32_USB-FS-Device_Lib_V4.0.0. 

And i want make a HID dvice so I copi the source code to my IAR proyect

I use this functions in main function.

  Set_System();

  USB_Interrupts_Config();

  Set_USBClock();

  USB_Init();

    while (1)

    {

    }

But it don't make nothing the PC don't recog

Compile and execute but it don't make nothing the PC does not identify the a new device connected.

What am I making bad?

I must instal first the PC driver?

Where can i find a example code?

Some one can help me?

Best regards

#stm32f103rb #usb #usb #stm32f103
12 REPLIES 12
chen
Associate II
Posted on November 05, 2014 at 17:45

''I measured with the oscilloscope the crystal signals and i saw that the Crystal is not right.''

Measuring on the crystal will disturb the circuit. The capacitance of the scope probe may affect the freq.

Best to use the OSCOut pit to measure the CPU oscillation, check the datasheet for which pin this is.

lemac
Associate II
Posted on November 05, 2014 at 18:26

Hello

I am making probes and i see that the codee stop in:

startup_stm32f10x_md.s

 

 

 

USB_LP_CAN1_RX0_IRQHandler

 

        B USB_LP_CAN1_RX0_IRQHandler  <--- This line

 

 

 

        PUBWEAK CAN1_RX1_IRQHandler

 

        SECTION .text:CODE:REORDER:NOROOT(1)

So... I create a USB.C and USB.H file where I put the next funtions

void USB_HP_CAN1_TX_IRQHandler(void)

 

{

 

  OutStringUART_PC(''USB_HP_CAN1_TX_IRQHandler \r\n'');

 

}

 

void USB_LP_CAN1_RX0_IRQHandler(void)

 

{

 

  OutStringUART_PC(''USB_LP_CAN1_RX0_IRQHandler \r\n'');

 

}

 

void USBWakeUp_IRQHandler(void)

 

{

 

  OutStringUART_PC(''USBWakeUp_IRQHandler \r\n'');

 

}

 

 

 

void EXTI9_5_IRQHandler(void)

 

{

 

  OutStringUART_PC(''EXTI9_5_IRQHandler \r\n'');

 

}

I open a hiperterminal and I only view 

 

EXTI9_5_IRQHandler

What I must make???

This interrupt is the USB cable detection???

Best regards.

lemac
Associate II
Posted on November 06, 2014 at 09:23

Hello

Oh!! my god..

I have stupid error

I forgot include the stm32_it.c.

I include it and I modificate because it is in collision with stm32f1xx it

And now is all right

Best regards