I have a STM32-103STK board with a keil ulink-me usb programmer. My job is to create a USB connection to the pc. I've downloaded the USB-HID demo from keil (http://www.keil.com/download/docs/361.asp), compiled it and loaded it onto the board. But the demo isn't working. I know it would not work as it should be cause this board hasn't have the leds, but windows should recognize a USB device I think.
Does anyone knows how to get this working? Would this demo work on this board?
Look, I cannot help you without seeing _something_. Post, using the correct tags please, one of the functions MDK needs and exists in that header file.
"I've downloaded the USB-HID demo from keil compiled it and loaded it onto the board. But the demo isn't working. I know it would not work as it should be cause this board hasn't have the leds"
I imagine that the LEDs would be the least of your problems!
Embedded software like this is very specific to the hardware that it will run on - you cannot just take an example from one place, and expect it to work on any arbitrary board from somewhere completely different!
You need to check very carefully what hardware & connections the software requires, and then see if those are provided on the particular board that you have - if they aren't (which is quite likely), then you will have to modify the source code to match the particular hardware that you actually have.
Note that USB is pretty complex - it sounds like you should really be starting with something much simpler...
I believe that in this particular occasion, USB has a pretty good chance to work, as long as the sample is ported entirely, because there are not any board specific configurations required (so it seems) and we are talking about the same processor. I have something similar with an embedded artists board, and there I only needed to build using the Keil suit and set a jumper.
"Note that USB is pretty complex - it sounds like you should really be starting with something much simpler..."
i have to make this for school project, and we don't get further instructions...
"Embedded software like this is very specific to the hardware that it will run on - you cannot just take an example from one place, and expect it to work on any arbitrary board from somewhere completely different!"
But where to start? an example from st, olimex or keil?
The normal starting place for embedded novices is to blink a LED.
Then the standard "Hello, World"
Then build on that!
Given that you have an Olimex board, then Olimex is the obvious place to look for examples!
If the Olimex examples are for IAR, why are you using Keil?
I'm not sure sure.
USB involves a lot of code - so that's a lot of work to port it all!
Porting requires a good understanding of 'C' programming in general, and at least a working knowledge of both the "source" and the "target" compilers - none of which appears to apply here.
I think there really are just too many unknowns in this equation!
"If the Olimex examples are for IAR, why are you using Keil?"
Cause school gave it to us...
but i know how to put something on the lcd screen, put led or pin on or off...
Gave what to you?
Keil?
The Olimex board?
If they gave you these things, they must have assumed that a competent student, at this point in the course, should be able to complete the assignment with them...
problem solved, solution: use examples from ST with the following settings:
#define USB_DISCONNECT GPIOC #define USB_DISCONNECT_PIN GPIO_Pin_11 #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOC