I'm going to guess you didn't actually copy that file, because looking at
it in the repo on Github it already had the periph_clock changes in it, and
it correctly initializes the USB device. Since I have a copy of the repo I
cd to the directoy and type make it compiles without errors.

That said, you can re-create the USB initialization from first principles
using the information in the ST Micro f3 reference manual, and you can
compile the example using the free IAR compiler that is in the USB App note
(also from ST Micro).

When I started playing around with USB on the ST Micro series I found it
very helpful to read:
USB Complete - from Jan Axelson (
http://www.amazon.com/USB-Complete-Fourth-Edition-Developers/dp/1931448086)
and
Universal Serial Bus System Architecture (
http://www.amazon.com/Universal-Serial-System-Architecture-Edition/dp/0201309750)
which helped describe what the peripherals were trying to accomplish.

--Chuck



On Wed, Jul 16, 2014 at 1:57 PM, Luis Rodrigues <[email protected]>
wrote:

> Thanks but I already did, thats how I found that the code I have was
> copied from that file. The difference being that it uses
> interrupt NVIC_OTG_FS_IRQ  to know when to poll. Are there some
> docs/examples on how to use usb interrupts'
> for f3?
>
>
>
> On 16 July 2014 22:52, Chuck McManis <[email protected]> wrote:
>
>> github://libopencm3-examples/
>>
>> Look in the examples/stm32/f3/stm32f3-discovery directory for examples.
>>
>>
>> On Wed, Jul 16, 2014 at 1:27 PM, Luis Rodrigues <[email protected]>
>> wrote:
>>
>>> Its STM32F302R8T6, so I guess it does not have OTG.
>>>
>>> Just realized one of the files I'm converting basically is
>>> "usb_cdcacm/cdcacm.c" (from examples) with added stuff:
>>>
>>>
>>> nvic_enable_irq(NVIC_OTG_FS_IRQ); and then:
>>>
>>> void otg_fs_isr(void) { (this is interrupt handler, right?)
>>>     usbd_poll(usbd_dev);
>>> }
>>>
>>> Can you please help me, how could this be done in F3?
>>>
>>> Luis
>>>
>>>
>>>
>>> On 16 July 2014 21:40, Chuck McManis <[email protected]> wrote:
>>>
>>>> The code recently changed (well a couple of months ago) so that instead
>>>> of rcc_peripheral_enable_clock( ...) its now simply
>>>> rcc_periph_clock_enable(RCC_GPIOA) for example, But perhaps more
>>>> importantly I don't believe the f3 has a USB OTG i/o port, I believe it is
>>>> device only USB so there will be no OTG_FS in it. Do you have a part number
>>>> for the chip you are targeting?
>>>>
>>>> --Chuck
>>>>
>>>>
>>>>
>>>> On Wed, Jul 16, 2014 at 12:16 PM, Luis Rodrigues <[email protected]
>>>> > wrote:
>>>>
>>>>> Hi all,
>>>>> I'm a complete noobie at programming MCUs, I'm trying to port some
>>>>> code made for smt32f4 to a stm32f3.
>>>>>
>>>>> I have some code that:
>>>>>     nvic_enable_irq(NVIC_OTG_FS_IRQ);
>>>>>     rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPAEN);
>>>>>     rcc_peripheral_enable_clock(&RCC_AHB2ENR, RCC_AHB2ENR_OTGFSEN);
>>>>>
>>>>>
>>>>> None of these are defined for F3, can someone please point me in the
>>>>> right direction?
>>>>>
>>>>> Best,
>>>>> Luis
>>>>>
>>>>> PS:
>>>>> From what I've seen in include files I guess RCC_AHB1ENR becomes
>>>>> RCC_AHBENR but
>>>>> but not really sure
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Want fast and easy access to all the code in your enterprise? Index and
>>>>> search up to 200,000 lines of code with a free copy of Black Duck
>>>>> Code Sight - the same software that powers the world's largest code
>>>>> search on Ohloh, the Black Duck Open Hub! Try it now.
>>>>> http://p.sf.net/sfu/bds
>>>>> _______________________________________________
>>>>> libopencm3-devel mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/libopencm3-devel
>>>>>
>>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
libopencm3-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel

Reply via email to