libopenstm32-devel Mailing List for libopenstm32
Status: Inactive
Brought to you by:
uh1763
You can subscribe to this list here.
2010 |
Jan
(10) |
Feb
(8) |
Mar
(27) |
Apr
(2) |
May
(16) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(11) |
Nov
(3) |
Dec
(11) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(18) |
Feb
(17) |
Mar
(5) |
Apr
(2) |
May
|
Jun
(4) |
Jul
(20) |
Aug
(1) |
Sep
(4) |
Oct
(3) |
Nov
(1) |
Dec
|
From: Uwe H. <uw...@he...> - 2011-11-01 22:02:16
|
Hi, the long-pending rename of the libopenstm32 project to libopencm3 is finally done. The new website/wiki is: http://www.libopencm3.org (user accounts are only created manually per request for spam-reasons, just let me know and I'll make one for you) The new SourceForge project page: https://sourceforge.net/projects/libopencm3/ The new git repository clone command is: git clone git://libopencm3.git.sourceforge.net/gitroot/libopencm3/libopencm3 Code browser: http://libopencm3.git.sourceforge.net/ The new IRC channel on FreeNode is: #libopencm3 The mailings lists libopencm3-commits and libopencm3-devel are now available. Everyone who was subscribed to the old lists should be automatically subscribed to the new ones too (with same settings). Please let me know if anything went wrong. The old lists should no longer be used, but the list archives will remain accessible. Please let me know if I forgot to update or move anything. Thanks, Uwe. -- http://hermann-uwe.de | http://sigrok.org http://randomprojects.org | http://unmaintained-free-software.org |
From: Kamel B. <k.b...@gm...> - 2011-10-23 10:45:13
|
Hello, I wonder if you already tried to use the libopenstm32 with FreeRTOS? Actually I don't really know how to port FreeRTOS on my stm32-h103 Olimex board so if someone can help me going trough this work I would really appreciate ! Regards. -- __________________________________ *Kamel BOUHARA* ***Embedded Systems Student * *I.N.S.S.E.T * |
From: Kamel B. <k.b...@gm...> - 2011-10-11 10:32:10
|
Hi Gareth, Actually I've already tried the summon-arm-toolchain method but I've missed to install some dependencies. I fixed the problem by installing them and using summon-arm-toolchain to compile libopenstm32, it works ! Thanks for you help. 2011/10/11 Gareth McMullin <ga...@bl...> > Hi Kamel > > libnosys is shipped with, and normally built with Newlib > (http://sourceware.org/newlib/) which is a C library for embedded > systems. libnosys provides dummy system calls for systems without an > OS to that applications can link to Newlib with no undefined symbols. > See http://sourceware.org/newlib/libc.html#Syscalls > > I believe that Newlib is the C library provided with the Code Sourcery > toolchain, so I would expect libnosys to be in there somewhere, but it > is possible that it's been removed from the distribution. > > The popular toolchain for use with libopenstm32 is summon-arm-toolchain: > https://github.com/esden/summon-arm-toolchain > This script builds an arm-eabi toolchain including binutils, gcc, > newlib, gdb and libopenstm32. > > I hope this helps. > > Regards, > Gareth > > > On Tue, Oct 11, 2011 at 10:19 PM, Kamel BOUHARA <k.b...@gm...> > wrote: > > > > Hi all, > > I am just starting to work on my Olimex stm32-h103 board. I've downloaded > > the libopenstm32 and want to compile it with the arm-none-eabi from > sourcery > > lite (version 2011) and here is what I'm getting : > > $ PREFIX=/home/mks/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi make > > BUILD lib/stm32 > > CC vector.o > > CC rcc.o > > CC gpio.o > > CC usart.o > > CC adc.o > > CC spi.o > > CC flash.o > > CC nvic.o > > CC rtc.o > > CC i2c.o > > CC dma.o > > CC systick.o > > CC exti.o > > CC scb.o > > CC ethernet.o > > CC usb_f103.o > > CC usb.o > > CC usb_control.o > > CC usb_standard.o > > CC can.o > > CC timer.o > > CC usb_f107.o > > AR libopencm3_stm32.a > > BUILD lib/lpc13xx > > CC gpio.o > > AR libopencm3_lpc13xx.a > > BUILD lib/lm3s > > CC gpio.o > > CC vector.o > > AR libopencm3_lm3s.a > > BUILD examples/stm32/lisa-m/fancyblink > > > /home/mks/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/bin/ld: > > cannot find -lnosys > > collect2: ld returned 1 exit status > > make[1]: *** [fancyblink.elf] Error 1 > > make: *** [examples] Error 2 > > It seems the makefile is not looking at the good lib directories ? > > Any help would be appreciate. > > Thanks. > > -- > > __________________________________ > > Kamel BOUHARA > > 7 rue Jules César > > 02100 SAINT-QUENTIN > > 06.17.83.29.04 > > > > > > > > > ------------------------------------------------------------------------------ > > All the data continuously generated in your IT infrastructure contains a > > definitive record of customers, application performance, security > > threats, fraudulent activity and more. Splunk takes this data and makes > > sense of it. Business sense. IT sense. Common sense. > > http://p.sf.net/sfu/splunk-d2d-oct > > _______________________________________________ > > libopenstm32-devel mailing list > > lib...@li... > > https://lists.sourceforge.net/lists/listinfo/libopenstm32-devel > > > > > > > > -- > Black Sphere Technologies Ltd. > > Web: www.blacksphere.co.nz > Mobile: +64 27 777 2182 > Tel: +64 9 478 8885 > Skype: gareth.mcmullin > LinkedIn: http://nz.linkedin.com/in/gsmcmullin > -- __________________________________ *Kamel BOUHARA* 7 rue Jules César 02100 SAINT-QUENTIN 06.17.83.29.04 |
From: Kamel B. <k.b...@gm...> - 2011-10-11 09:20:12
|
Hi all, I am just starting to work on my Olimex stm32-h103 board. I've downloaded the libopenstm32 and want to compile it with the arm-none-eabi from sourcery lite (version 2011) and here is what I'm getting : $ PREFIX=/home/mks/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi make BUILD lib/stm32 CC vector.o CC rcc.o CC gpio.o CC usart.o CC adc.o CC spi.o CC flash.o CC nvic.o CC rtc.o CC i2c.o CC dma.o CC systick.o CC exti.o CC scb.o CC ethernet.o CC usb_f103.o CC usb.o CC usb_control.o CC usb_standard.o CC can.o CC timer.o CC usb_f107.o AR libopencm3_stm32.a BUILD lib/lpc13xx CC gpio.o AR libopencm3_lpc13xx.a BUILD lib/lm3s CC gpio.o CC vector.o AR libopencm3_lm3s.a BUILD examples/stm32/lisa-m/fancyblink /home/mks/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/bin/ld: cannot find -lnosys collect2: ld returned 1 exit status make[1]: *** [fancyblink.elf] Error 1 make: *** [examples] Error 2 It seems the makefile is not looking at the good lib directories ? Any help would be appreciate. Thanks. -- __________________________________ *Kamel BOUHARA* 7 rue Jules César 02100 SAINT-QUENTIN 06.17.83.29.04 |
From: Fergus N. <fer...@gm...> - 2011-09-25 19:40:34
|
Hi, I've got some working SPI code for the F2 series port I'm working on. Its on my github: https://github.com/fnoble/libopenstm32 Although setting up the GPIOs and alternate functions is different on F2 the SPI peripheral should be code compatible. The one difference I can see is that you need to set the SSOE bit in SPI_CR2. This had me confused for a long while too, see the paragraph about NSS in the reference manual section 25.3.1 for an explanation. Thanks, Fergus On 25 Sep 2011, at 05:20, Armin Schlegel wrote: > Hey, > > i got similar problems. Have you got working until now? > > Best Regards, > > Armin > > > >Hi guys... > >I'm in trouble with SPI1 of my cortexm3. I'm trying only to send some > >packet on the line and to view it trhrough oscilloscope. > >Can you take a look to my code? I'm going crazy. > > > >http://pastie.org/2066599 > > > >Thanks in advance > >Roberto > > > > > >P.S. Is there working example about SPI using libopenstm32? I found it > >in examples/stm32/stm32-h103/spi but is not complete. > > > >-- > >Roberto (aka formica) Marino > >Computer Engineer > >FSF Member #9647 - Me|Lug Member > >http://people.gnudev.org/~formica/ > >Mobile: 349-5740870 > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2dcopy2_______________________________________________ > libopenstm32-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libopenstm32-devel |
From: Armin S. <kna...@gm...> - 2011-09-25 12:20:41
|
Hey, i got similar problems. Have you got working until now? Best Regards, Armin >Hi guys... >I'm in trouble with SPI1 of my cortexm3. I'm trying only to send some >packet on the line and to view it trhrough oscilloscope. >Can you take a look to my code? I'm going crazy. > >http://pastie.org/2066599 > >Thanks in advance >Roberto > > >P.S. Is there working example about SPI using libopenstm32? I found it >in examples/stm32/stm32-h103/spi but is not complete. > >-- >Roberto (aka formica) Marino >Computer Engineer >FSF Member #9647 - Me|Lug Member >http://people.gnudev.org/~formica/ <http://people.gnudev.org/%7Eformica/> >Mobile: 349-5740870 |
From: Marko K. <ma...@el...> - 2011-09-17 12:14:02
|
Hi - in older revisions of libopenstm32, use of some functions would call these [sbrk_r, open_r, read_r, write_r and so on], which would then fail as they were undefined. The other day I upgraded to current rev, and things that call these (in my case gmtime_r() ) no longer fail on compile - but they still don't work. I didn't have debug, but the MCU became non-responsive as soon as it hit the call. grepping the source didn't seem to give me any clues where they were defined - any ideas? Also recently, I wrote up a bit of code that buffers the UARTs, both send and receive. There are routines to fill/pull data from the ringbuffers, and the UART side is all interrupt driven. I got the idea from a similar library I had used on AVRs in the past. I can clean it up and submit it if anyone is interested. Now, at this point I decided to upgrade to trunk, as mentioned earlier. Of course I then saw the new example usart_irq_printf, which was basically what I was going for in the above (although I don't think it buffered RX)... All this seemed to do for me (compiled for the stm32vl-discovery) was hang and use ungodly amounts of flash, something like 30k IIRC. (I'm presuming this is related to heavyweight printf, and sbrk_r or whatever it calls, which goes back to the start of this post). Perhaps someone who has ran this on a F103 as the example can give me a hint. In my past experience with AVR GCC, they have a file stream setup, and stripped down printf functions, so you can fprintf to fd, which I could link to my uart deal above. I guess I could look into porting some of that, I'm not sure how involved it is. I'm just looking for comments about whether such functions are worthwhile for the project - I can't see myself being the only one that would like them, but you never know. And some ideas on implementation would be nice. Or, if someone has already worked along similar lines, there's no sense in me doing so. Thanks guys, keep up the good work... :) mark |
From: Marko K. <ma...@el...> - 2011-09-17 11:31:54
|
Hi, I was wondering if there's been any work on supporting the STM32L device family? Looking at the migration guide, it doesn't look too different but some parts are. From a quick look - a lot of peripherals are the same, some are backwards compatible but have new features, however others need work. Looks like RCC, ADC, RTC, flash and GPIO have changed enough to not be compatible. Now, what is the best way to add support? Should it be split out so that under /include/libopencm3/ there would be: stm32/ (common) stm32f/ stm32l/ As opposed to the current, only stm32. Or is it better to stick support for both in the individual include files, and have a makefile define the MCU type or so..? thanks, mark |
From: Matjaz J. <ja...@gm...> - 2011-08-26 09:13:52
|
Hi, another question about using USB CDC ACM. Example and some upgrades to it were quite successfull. There are some problems using it as virtual com port: - If I want to make usb to RS232 bridge, where to detect the set up for COM port (baudrate, parity,....)? - receiving data from PC shows no problem. I've used example and upgrade it to reply for incoming data. But sending the data to the PC was problematic, because I've probably overfilled/corrupted the output data pipe. My question is, how to check if the outgoing bufffer is empty and is ready for new data? best regards, Matjaz |
From: Uwe B. <bo...@el...> - 2011-07-21 12:44:22
|
>>>>> "Uwe" == Uwe Bonnes <bo...@el...> writes: >>>>> "Gareth" == Gareth McMullin <ga...@bl...> writes: Gareth> On Tue, Jul 12, 2011 at 6:41 AM, Uwe Bonnes Gareth> <bo...@el...> wrote: >>> on my STM32F107 board, the USB bootloader enumerates much faster >>> with a 25 MHz crystal then with a 8 MHz crystal. With the 8 MHz >>> crystal, there are several unseuccessfull attempts like: Gareth> I have two boards both enumerate correctly and reliably with Gareth> 8MHz crystals. Check your crystal, but I think it's more likely Gareth> a software problem. If you send me a pcap file (capture with Gareth> wireshark) I'll have a look at it. Uwe> I am not talking about user software. I talk about the system Uwe> software, when booting with Boot1==0 and Boot0 ==1, and I have not Uwe> influence on the software. Uwe> After enumeration, dfu-util did see the device, I did no further Uwe> test for now. AN3156 clearly describes the effect: For USB DFU bootloader V2.0, the device first tries the 25 MHz configuration, then, if it fails, the 14.7456 MHz configuration, and finally, if it fails, the 8 MHz configuration. If it still fails, this operation is repeated with a large timeout value (the three configurations are tested again). If the second trial also fails, a system reset is generated. So it should be normal to see two failing enumeration tries before the succeeding third try when running on a 8 MHz crystal. -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Uwe H. <uw...@he...> - 2011-07-13 08:07:03
|
On Thu, Jul 07, 2011 at 09:10:28PM +1200, Gareth McMullin wrote: > On Wed, Jul 6, 2011 at 4:50 AM, Uwe Bonnes > <bo...@el...> wrote: > > appended patch moves enabling the USB/OTG clock into stm32f10x_usbd_init(). > > > > User code has then one point less to distinguish between 103 and 105/7 and > > perhaps allows to write more portable code. > > > > Any comments? > > I'm happy with this change. Yep, looks good, merged. I only build-tested, though. Uwe. -- http://hermann-uwe.de | http://sigrok.org http://randomprojects.org | http://unmaintained-free-software.org |
From: Uwe H. <uw...@he...> - 2011-07-13 08:06:08
|
On Tue, Jul 05, 2011 at 06:14:40PM +0200, Uwe Bonnes wrote: > Subject: Add more files to ignore Thanks, merged. Uwe. -- http://hermann-uwe.de | http://sigrok.org http://randomprojects.org | http://unmaintained-free-software.org |
From: Uwe B. <bo...@el...> - 2011-07-12 18:25:29
|
Hello, is there an example of an STM32F linkerscript, that loads to RAM? Thanks -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Matjaz J. <ja...@gm...> - 2011-07-12 14:03:48
|
Hi, thank you, I've also managed to make a build of a library. My default path to yagarto compiler is c:\yagarsto, so I updated DESTDIR = c:/yagarto and becouse I'm using Eclipse I've added new variable to properties/c/c++ build/enviroment, PREFIX with value arm-none-eabi Thank you very much! Matjaz On 12 July 2011 12:57, Uwe Hermann <uw...@he...> wrote: > Hi, > > On Tue, Jun 28, 2011 at 09:56:00PM +1200, Gareth McMullin wrote: >> On Mon, Jun 27, 2011 at 11:00 AM, Matjaz Janezic <ja...@gm...> wrote: >> > is where tutorial how to build this library with yagarto tools? >> >> I don't think so. Windows isn't the friendliest build environment. >> >> I built a Windows toolchain with a modified summon-arm-toolchain >> including libopenstm32: >> http://www.blacksphere.co.nz/downloads/sat-w32-0a.exe >> >> This was cross-compiled from Linux. I can't help with a native Windows build. > > I just downloaded the current Yagarto .exe file (uses gcc 4.6), > double-clicked it on Windows, then cloned the libopenstm32 repo using > TortoiseGit, then entered an MSYS shell and typed: > > PREFIX=arm-none-eabi make > > Everything built fine out of the box (didn't do any other tests). > > A tutorial for a MinGW/MSYS setup is probably out of scope here, I recommend > checking the MinGW/MSYS docs for that. Maybe we'll add a quick HOWTO at some > point, but it's not a high priority. > > Update: I also tested this in a normal DOS command line prompt window: > > set PREFIX=arm-none-eabi > make > > Seems like MinGW/MSYS is not strictly needed. > > > Uwe. > -- > http://hermann-uwe.de | http://sigrok.org > http://randomprojects.org | http://unmaintained-free-software.org > |
From: Uwe H. <uw...@he...> - 2011-07-12 11:16:34
|
Hi, On Tue, Jun 28, 2011 at 09:56:00PM +1200, Gareth McMullin wrote: > On Mon, Jun 27, 2011 at 11:00 AM, Matjaz Janezic <ja...@gm...> wrote: > > is where tutorial how to build this library with yagarto tools? > > I don't think so. Windows isn't the friendliest build environment. > > I built a Windows toolchain with a modified summon-arm-toolchain > including libopenstm32: > http://www.blacksphere.co.nz/downloads/sat-w32-0a.exe > > This was cross-compiled from Linux. I can't help with a native Windows build. I just downloaded the current Yagarto .exe file (uses gcc 4.6), double-clicked it on Windows, then cloned the libopenstm32 repo using TortoiseGit, then entered an MSYS shell and typed: PREFIX=arm-none-eabi make Everything built fine out of the box (didn't do any other tests). A tutorial for a MinGW/MSYS setup is probably out of scope here, I recommend checking the MinGW/MSYS docs for that. Maybe we'll add a quick HOWTO at some point, but it's not a high priority. Update: I also tested this in a normal DOS command line prompt window: set PREFIX=arm-none-eabi make Seems like MinGW/MSYS is not strictly needed. Uwe. -- http://hermann-uwe.de | http://sigrok.org http://randomprojects.org | http://unmaintained-free-software.org |
From: Uwe B. <bo...@el...> - 2011-07-12 08:28:46
|
>>>>> "Gareth" == Gareth McMullin <ga...@bl...> writes: Gareth> On Tue, Jul 12, 2011 at 6:41 AM, Uwe Bonnes Gareth> <bo...@el...> wrote: >> on my STM32F107 board, the USB bootloader enumerates much faster with >> a 25 MHz crystal then with a 8 MHz crystal. With the 8 MHz crystal, >> there are several unseuccessfull attempts like: Gareth> I have two boards both enumerate correctly and reliably with Gareth> 8MHz crystals. Check your crystal, but I think it's more likely Gareth> a software problem. If you send me a pcap file (capture with Gareth> wireshark) I'll have a look at it. I am not talking about user software. I talk about the system software, when booting with Boot1==0 and Boot0 ==1, and I have not influence on the software. After enumeration, dfu-util did see the device, I did no further test for now. Bye -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Gareth M. <ga...@bl...> - 2011-07-12 07:08:11
|
On Tue, Jul 12, 2011 at 6:41 AM, Uwe Bonnes <bo...@el...> wrote: > on my STM32F107 board, the USB bootloader enumerates much faster with a 25 > MHz crystal then with a 8 MHz crystal. With the 8 MHz crystal, there are > several unseuccessfull attempts like: I have two boards both enumerate correctly and reliably with 8MHz crystals. Check your crystal, but I think it's more likely a software problem. If you send me a pcap file (capture with wireshark) I'll have a look at it. Does the device work after enumeration? Regards, Gareth -- Black Sphere Technologies Ltd. Web: www.blacksphere.co.nz Mobile: +64 27 777 2182 Tel: +64 9 478 8885 Skype: gareth.mcmullin LinkedIn: http://nz.linkedin.com/in/gsmcmullin |
From: Jan P. <jan...@gm...> - 2011-07-11 20:03:36
|
Hi, I think there is the possibility to select different internal clocks and output them on a pin. That way you can measure the frequency and check if it's ok for USB. > Hello, > > on my STM32F107 board, the USB bootloader enumerates much faster with a 25 > MHz crystal then with a 8 MHz crystal. With the 8 MHz crystal, there are > several unseuccessfull attempts like: > > Jul 11 20:27:34 hertz kernel: [35078.633123] hub 1-1:1.0: unable to enumerate USB device on port 1 > Jul 11 20:27:34 hertz kernel: [35079.024836] usb 1-1.1: new full speed USB device using ehci_hcd and address 20 > Jul 11 20:27:34 hertz kernel: [35079.096942] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:34 hertz kernel: [35079.272932] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:34 hertz kernel: [35079.448542] usb 1-1.1: new full speed USB device using ehci_hcd and address 21 > Jul 11 20:27:35 hertz kernel: [35079.520403] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:35 hertz kernel: [35079.696887] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:35 hertz kernel: [35079.872366] usb 1-1.1: new full speed USB device using ehci_hcd and address 22 > Jul 11 20:27:35 hertz kernel: [35080.280050] usb 1-1.1: device not accepting address 22, error -32 > Jul 11 20:27:35 hertz kernel: [35080.352571] usb 1-1.1: new full speed USB device using ehci_hcd and address 23 > Jul 11 20:27:36 hertz kernel: [35080.760031] usb 1-1.1: device not accepting address 23, error -32 > Jul 11 20:27:36 hertz kernel: [35080.760406] hub 1-1:1.0: unable to enumerate USB device on port 1 > Jul 11 20:27:40 hertz kernel: [35084.912351] usb 1-1.1: new full speed USB device using ehci_hcd and address 24 > Jul 11 20:27:40 hertz kernel: [35084.984331] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:40 hertz kernel: [35085.160821] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:40 hertz kernel: [35085.336555] usb 1-1.1: new full speed USB device using ehci_hcd and address 25 > Jul 11 20:27:40 hertz kernel: [35085.408543] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:41 hertz kernel: [35085.584900] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:41 hertz kernel: [35085.760503] usb 1-1.1: new full speed USB device using ehci_hcd and address 26 > Jul 11 20:27:41 hertz kernel: [35086.168037] usb 1-1.1: device not accepting address 26, error -32 > Jul 11 20:27:41 hertz kernel: [35086.240459] usb 1-1.1: new full speed USB device using ehci_hcd and address 27 > Jul 11 20:27:42 hertz kernel: [35086.648047] usb 1-1.1: device not accepting address 27, error -32 > Jul 11 20:27:42 hertz kernel: [35086.648428] hub 1-1:1.0: unable to enumerate USB device on port 1 > Jul 11 20:27:44 hertz kernel: [35089.264398] usb 1-1.1: new full speed USB device using ehci_hcd and address 28 > Jul 11 20:27:44 hertz kernel: [35089.336639] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:45 hertz kernel: [35089.512870] usb 1-1.1: device descriptor read/64, error -32 > Jul 11 20:27:45 hertz kernel: [35089.688480] usb 1-1.1: new full speed USB device using ehci_hcd and address 29 > Jul 11 20:27:45 hertz kernel: [35089.781713] usb 1-1.1: New USB device found, idVendor=0483, idProduct=df11 > Jul 11 20:27:45 hertz kernel: [35089.781722] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > Jul 11 20:27:45 hertz kernel: [35089.781728] usb 1-1.1: Product: STM32 0x418 DFU Bootloade > Jul 11 20:27:45 hertz kernel: [35089.781733] usb 1-1.1: Manufacturer: STMicroelectronics > Jul 11 20:27:45 hertz kernel: [35089.781737] usb 1-1.1: SerialNumber: STM32 > > Is this expected behaviour? Is my 8 MHaz crystal broken? > > Thanks |
From: Uwe B. <bo...@el...> - 2011-07-11 18:41:28
|
Hello, on my STM32F107 board, the USB bootloader enumerates much faster with a 25 MHz crystal then with a 8 MHz crystal. With the 8 MHz crystal, there are several unseuccessfull attempts like: Jul 11 20:27:34 hertz kernel: [35078.633123] hub 1-1:1.0: unable to enumerate USB device on port 1 Jul 11 20:27:34 hertz kernel: [35079.024836] usb 1-1.1: new full speed USB device using ehci_hcd and address 20 Jul 11 20:27:34 hertz kernel: [35079.096942] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:34 hertz kernel: [35079.272932] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:34 hertz kernel: [35079.448542] usb 1-1.1: new full speed USB device using ehci_hcd and address 21 Jul 11 20:27:35 hertz kernel: [35079.520403] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:35 hertz kernel: [35079.696887] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:35 hertz kernel: [35079.872366] usb 1-1.1: new full speed USB device using ehci_hcd and address 22 Jul 11 20:27:35 hertz kernel: [35080.280050] usb 1-1.1: device not accepting address 22, error -32 Jul 11 20:27:35 hertz kernel: [35080.352571] usb 1-1.1: new full speed USB device using ehci_hcd and address 23 Jul 11 20:27:36 hertz kernel: [35080.760031] usb 1-1.1: device not accepting address 23, error -32 Jul 11 20:27:36 hertz kernel: [35080.760406] hub 1-1:1.0: unable to enumerate USB device on port 1 Jul 11 20:27:40 hertz kernel: [35084.912351] usb 1-1.1: new full speed USB device using ehci_hcd and address 24 Jul 11 20:27:40 hertz kernel: [35084.984331] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:40 hertz kernel: [35085.160821] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:40 hertz kernel: [35085.336555] usb 1-1.1: new full speed USB device using ehci_hcd and address 25 Jul 11 20:27:40 hertz kernel: [35085.408543] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:41 hertz kernel: [35085.584900] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:41 hertz kernel: [35085.760503] usb 1-1.1: new full speed USB device using ehci_hcd and address 26 Jul 11 20:27:41 hertz kernel: [35086.168037] usb 1-1.1: device not accepting address 26, error -32 Jul 11 20:27:41 hertz kernel: [35086.240459] usb 1-1.1: new full speed USB device using ehci_hcd and address 27 Jul 11 20:27:42 hertz kernel: [35086.648047] usb 1-1.1: device not accepting address 27, error -32 Jul 11 20:27:42 hertz kernel: [35086.648428] hub 1-1:1.0: unable to enumerate USB device on port 1 Jul 11 20:27:44 hertz kernel: [35089.264398] usb 1-1.1: new full speed USB device using ehci_hcd and address 28 Jul 11 20:27:44 hertz kernel: [35089.336639] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:45 hertz kernel: [35089.512870] usb 1-1.1: device descriptor read/64, error -32 Jul 11 20:27:45 hertz kernel: [35089.688480] usb 1-1.1: new full speed USB device using ehci_hcd and address 29 Jul 11 20:27:45 hertz kernel: [35089.781713] usb 1-1.1: New USB device found, idVendor=0483, idProduct=df11 Jul 11 20:27:45 hertz kernel: [35089.781722] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Jul 11 20:27:45 hertz kernel: [35089.781728] usb 1-1.1: Product: STM32 0x418 DFU Bootloade Jul 11 20:27:45 hertz kernel: [35089.781733] usb 1-1.1: Manufacturer: STMicroelectronics Jul 11 20:27:45 hertz kernel: [35089.781737] usb 1-1.1: SerialNumber: STM32 Is this expected behaviour? Is my 8 MHaz crystal broken? Thanks -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Gareth M. <ga...@bl...> - 2011-07-08 23:19:26
|
On Sat, Jul 9, 2011 at 4:15 AM, Uwe Bonnes <bo...@el...> wrote: > I am trying to run a modifed (patches sent to Tormod) dfu-util on STM32F107 > with the modfied usb-iap/usb-dfu example, running a libopenstm32 tree with > the patches sent to this mailing list. > > The device enumerates, dfu-utils talks to the device, but programming fails. > > To debug, in usbdfu_control_request() I wrote the received USB control frame > to uncommmited flash. > > I see the first 4 bytes of the control transfer buffer missing! I've observed the same problem with control transactions with a data out stage. > I banged my head against the code and the STM32F connectivity line > documentation, but to no avail. > > Anybody any idea about that? Me too. I've spent quite a few hours on this with no luck. The literature isn't very good on this one, it leaves a lot to interpretation. Maybe a fresh set of eyes on it will help :) Regards, Gareth -- Black Sphere Technologies Ltd. Web: www.blacksphere.co.nz Mobile: +64 27 777 2182 Tel: +64 9 478 8885 Skype: gareth.mcmullin LinkedIn: http://nz.linkedin.com/in/gsmcmullin |
From: Uwe B. <bo...@el...> - 2011-07-08 16:15:38
|
Hello, I am trying to run a modifed (patches sent to Tormod) dfu-util on STM32F107 with the modfied usb-iap/usb-dfu example, running a libopenstm32 tree with the patches sent to this mailing list. The device enumerates, dfu-utils talks to the device, but programming fails. To debug, in usbdfu_control_request() I wrote the received USB control frame to uncommmited flash. I see the first 4 bytes of the control transfer buffer missing! I banged my head against the code and the STM32F connectivity line documentation, but to no avail. Anybody any idea about that? Thanks -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Uwe B. <bo...@el...> - 2011-07-08 10:59:46
|
Hello, Gareth had no objections, but the original mail is not visible in the archive, so I resend. Please apply or let me know any problems Bye -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- >From 2f27157aa305fed214a6317db82c15b7ed53d9da Mon Sep 17 00:00:00 2001 From: Uwe Bonnes <bo...@el...> Date: Tue, 5 Jul 2011 18:40:34 +0200 Subject: Move enabling the USB Clock into stm32f10x_usbd_init --- examples/stm32/lisa-m/usb_dfu/usbdfu.c | 1 - examples/stm32/lisa-m/usb_hid/usbhid.c | 1 - examples/stm32/other/usb_cdcacm/cdcacm.c | 1 - examples/stm32/other/usb_dfu/usbdfu.c | 1 - examples/stm32/other/usb_hid/usbhid.c | 1 - examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c | 1 - examples/stm32/stm32-h103/usb_dfu/usbdfu.c | 1 - examples/stm32/stm32-h103/usb_hid/usbhid.c | 1 - examples/stm32/stm32-h103/usb_iap/usbiap.c | 1 - examples/stm32/stm32-h107/usb_simple/usb_simple.c | 1 - lib/usb/usb_f103.c | 2 ++ lib/usb/usb_f107.c | 2 ++ 12 files changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/stm32/lisa-m/usb_dfu/usbdfu.c b/examples/stm32/lisa-m/usb_dfu/usbdfu.c index 4e83ce0..7ffbc74 100644 --- a/examples/stm32/lisa-m/usb_dfu/usbdfu.c +++ b/examples/stm32/lisa-m/usb_dfu/usbdfu.c @@ -248,7 +248,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/lisa-m/usb_hid/usbhid.c b/examples/stm32/lisa-m/usb_hid/usbhid.c index 241c481..5314241 100644 --- a/examples/stm32/lisa-m/usb_hid/usbhid.c +++ b/examples/stm32/lisa-m/usb_hid/usbhid.c @@ -241,7 +241,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); diff --git a/examples/stm32/other/usb_cdcacm/cdcacm.c b/examples/stm32/other/usb_cdcacm/cdcacm.c index cd701b8..fdc92e2 100644 --- a/examples/stm32/other/usb_cdcacm/cdcacm.c +++ b/examples/stm32/other/usb_cdcacm/cdcacm.c @@ -226,7 +226,6 @@ int main(void) { rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/other/usb_dfu/usbdfu.c b/examples/stm32/other/usb_dfu/usbdfu.c index 4e83ce0..7ffbc74 100644 --- a/examples/stm32/other/usb_dfu/usbdfu.c +++ b/examples/stm32/other/usb_dfu/usbdfu.c @@ -248,7 +248,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/other/usb_hid/usbhid.c b/examples/stm32/other/usb_hid/usbhid.c index 459ccbe..8f08aac 100644 --- a/examples/stm32/other/usb_hid/usbhid.c +++ b/examples/stm32/other/usb_hid/usbhid.c @@ -240,7 +240,6 @@ int main(void) { rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c b/examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c index fe1f542..4b90640 100644 --- a/examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c +++ b/examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c @@ -228,7 +228,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); gpio_set(GPIOC, GPIO11); diff --git a/examples/stm32/stm32-h103/usb_dfu/usbdfu.c b/examples/stm32/stm32-h103/usb_dfu/usbdfu.c index 4e83ce0..7ffbc74 100644 --- a/examples/stm32/stm32-h103/usb_dfu/usbdfu.c +++ b/examples/stm32/stm32-h103/usb_dfu/usbdfu.c @@ -248,7 +248,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/stm32-h103/usb_hid/usbhid.c b/examples/stm32/stm32-h103/usb_hid/usbhid.c index 09c49e9..a21fce6 100644 --- a/examples/stm32/stm32-h103/usb_hid/usbhid.c +++ b/examples/stm32/stm32-h103/usb_hid/usbhid.c @@ -241,7 +241,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); gpio_set(GPIOC, GPIO11); diff --git a/examples/stm32/stm32-h103/usb_iap/usbiap.c b/examples/stm32/stm32-h103/usb_iap/usbiap.c index 4e83ce0..7ffbc74 100644 --- a/examples/stm32/stm32-h103/usb_iap/usbiap.c +++ b/examples/stm32/stm32-h103/usb_iap/usbiap.c @@ -248,7 +248,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/stm32-h107/usb_simple/usb_simple.c b/examples/stm32/stm32-h107/usb_simple/usb_simple.c index 517f37e..85f67df 100644 --- a/examples/stm32/stm32-h107/usb_simple/usb_simple.c +++ b/examples/stm32/stm32-h107/usb_simple/usb_simple.c @@ -98,7 +98,6 @@ int main(void) { rcc_clock_setup_in_hse_8mhz_out_72mhz(); - rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); diff --git a/lib/usb/usb_f103.c b/lib/usb/usb_f103.c index 19f645d..594d3c6 100644 --- a/lib/usb/usb_f103.c +++ b/lib/usb/usb_f103.c @@ -17,6 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <libopencm3/stm32/rcc.h> #include <libopencm3/cm3/common.h> #include <libopencm3/stm32/tools.h> #include <libopencm3/stm32/usb.h> @@ -53,6 +54,7 @@ const struct _usbd_driver stm32f103_usb_driver = { /** Initialize the USB device controller hardware of the STM32. */ static void stm32f103_usbd_init(void) { + rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); SET_REG(USB_CNTR_REG, 0); SET_REG(USB_BTABLE_REG, 0); SET_REG(USB_ISTR_REG, 0); diff --git a/lib/usb/usb_f107.c b/lib/usb/usb_f107.c index ee83b65..134b728 100644 --- a/lib/usb/usb_f107.c +++ b/lib/usb/usb_f107.c @@ -17,6 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <libopencm3/stm32/rcc.h> #include <libopencm3/cm3/common.h> #include <libopencm3/stm32/tools.h> #include <libopencm3/stm32/otg_fs.h> @@ -63,6 +64,7 @@ const struct _usbd_driver stm32f107_usb_driver = { /** Initialize the USB device controller hardware of the STM32. */ static void stm32f107_usbd_init(void) { + rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN); OTG_FS_GINTSTS = OTG_FS_GINTSTS_MMIS; /* WARNING: Undocumented! Select internal PHY */ -- 1.7.3.4 |
From: Tobias G. <tob...@ka...> - 2011-07-08 06:59:15
|
Hello, I think there's a bug in STM32 nvic_set_priority in nvic.c There is that line: NVIC_IPR(irqn/4) |= (priority << ((irqn % 4) * 8)); irqn/4 is right to choose the array index of the priority register array but not to choose the right memory address because STM32 microcontrollers addresses there registers bytewise. So if NVIC_IPR0 has the address offset 0x400 NVIC_IPR1 has the offset 0x404 and so on. Because of set you can address the priority registers directly by 0x400 + irqn and this line is enough to set the priority: NVIC_IPR(irqn) |= priority; I had problems with the priority of my interrupt because it has fired allthough the basepri register was set to an higher priority as my interrupt was configured. After I had changed the line in nvic.c my interrupt doesn't fire if the basepri register is that to an higher priority. Regards, Tobias Groll |
From: Gareth M. <ga...@bl...> - 2011-07-07 09:10:56
|
On Wed, Jul 6, 2011 at 4:50 AM, Uwe Bonnes <bo...@el...> wrote: > appended patch moves enabling the USB/OTG clock into stm32f10x_usbd_init(). > > User code has then one point less to distinguish between 103 and 105/7 and > perhaps allows to write more portable code. > > Any comments? I'm happy with this change. Gareth -- Black Sphere Technologies Ltd. Web: www.blacksphere.co.nz Mobile: +64 27 777 2182 Tel: +64 9 478 8885 Skype: gareth.mcmullin LinkedIn: http://nz.linkedin.com/in/gsmcmullin |
From: Uwe B. <bo...@el...> - 2011-07-05 16:50:20
|
Hello, appended patch moves enabling the USB/OTG clock into stm32f10x_usbd_init(). User code has then one point less to distinguish between 103 and 105/7 and perhaps allows to write more portable code. Any comments? -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- >From 2f27157aa305fed214a6317db82c15b7ed53d9da Mon Sep 17 00:00:00 2001 From: Uwe Bonnes <bo...@el...> Date: Tue, 5 Jul 2011 18:40:34 +0200 Subject: Move enabling the USB Clock into stm32f10x_usbd_init --- examples/stm32/lisa-m/usb_dfu/usbdfu.c | 1 - examples/stm32/lisa-m/usb_hid/usbhid.c | 1 - examples/stm32/other/usb_cdcacm/cdcacm.c | 1 - examples/stm32/other/usb_dfu/usbdfu.c | 1 - examples/stm32/other/usb_hid/usbhid.c | 1 - examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c | 1 - examples/stm32/stm32-h103/usb_dfu/usbdfu.c | 1 - examples/stm32/stm32-h103/usb_hid/usbhid.c | 1 - examples/stm32/stm32-h103/usb_iap/usbiap.c | 1 - examples/stm32/stm32-h107/usb_simple/usb_simple.c | 1 - lib/usb/usb_f103.c | 2 ++ lib/usb/usb_f107.c | 2 ++ 12 files changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/stm32/lisa-m/usb_dfu/usbdfu.c b/examples/stm32/lisa-m/usb_dfu/usbdfu.c index 4e83ce0..7ffbc74 100644 --- a/examples/stm32/lisa-m/usb_dfu/usbdfu.c +++ b/examples/stm32/lisa-m/usb_dfu/usbdfu.c @@ -248,7 +248,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/lisa-m/usb_hid/usbhid.c b/examples/stm32/lisa-m/usb_hid/usbhid.c index 241c481..5314241 100644 --- a/examples/stm32/lisa-m/usb_hid/usbhid.c +++ b/examples/stm32/lisa-m/usb_hid/usbhid.c @@ -241,7 +241,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); diff --git a/examples/stm32/other/usb_cdcacm/cdcacm.c b/examples/stm32/other/usb_cdcacm/cdcacm.c index cd701b8..fdc92e2 100644 --- a/examples/stm32/other/usb_cdcacm/cdcacm.c +++ b/examples/stm32/other/usb_cdcacm/cdcacm.c @@ -226,7 +226,6 @@ int main(void) { rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/other/usb_dfu/usbdfu.c b/examples/stm32/other/usb_dfu/usbdfu.c index 4e83ce0..7ffbc74 100644 --- a/examples/stm32/other/usb_dfu/usbdfu.c +++ b/examples/stm32/other/usb_dfu/usbdfu.c @@ -248,7 +248,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/other/usb_hid/usbhid.c b/examples/stm32/other/usb_hid/usbhid.c index 459ccbe..8f08aac 100644 --- a/examples/stm32/other/usb_hid/usbhid.c +++ b/examples/stm32/other/usb_hid/usbhid.c @@ -240,7 +240,6 @@ int main(void) { rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c b/examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c index fe1f542..4b90640 100644 --- a/examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c +++ b/examples/stm32/stm32-h103/usb_cdcacm/cdcacm.c @@ -228,7 +228,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); gpio_set(GPIOC, GPIO11); diff --git a/examples/stm32/stm32-h103/usb_dfu/usbdfu.c b/examples/stm32/stm32-h103/usb_dfu/usbdfu.c index 4e83ce0..7ffbc74 100644 --- a/examples/stm32/stm32-h103/usb_dfu/usbdfu.c +++ b/examples/stm32/stm32-h103/usb_dfu/usbdfu.c @@ -248,7 +248,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/stm32-h103/usb_hid/usbhid.c b/examples/stm32/stm32-h103/usb_hid/usbhid.c index 09c49e9..a21fce6 100644 --- a/examples/stm32/stm32-h103/usb_hid/usbhid.c +++ b/examples/stm32/stm32-h103/usb_hid/usbhid.c @@ -241,7 +241,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); gpio_set(GPIOC, GPIO11); diff --git a/examples/stm32/stm32-h103/usb_iap/usbiap.c b/examples/stm32/stm32-h103/usb_iap/usbiap.c index 4e83ce0..7ffbc74 100644 --- a/examples/stm32/stm32-h103/usb_iap/usbiap.c +++ b/examples/stm32/stm32-h103/usb_iap/usbiap.c @@ -248,7 +248,6 @@ int main(void) rcc_clock_setup_in_hsi_out_48mhz(); - rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); diff --git a/examples/stm32/stm32-h107/usb_simple/usb_simple.c b/examples/stm32/stm32-h107/usb_simple/usb_simple.c index 517f37e..85f67df 100644 --- a/examples/stm32/stm32-h107/usb_simple/usb_simple.c +++ b/examples/stm32/stm32-h107/usb_simple/usb_simple.c @@ -98,7 +98,6 @@ int main(void) { rcc_clock_setup_in_hse_8mhz_out_72mhz(); - rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); diff --git a/lib/usb/usb_f103.c b/lib/usb/usb_f103.c index 19f645d..594d3c6 100644 --- a/lib/usb/usb_f103.c +++ b/lib/usb/usb_f103.c @@ -17,6 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <libopencm3/stm32/rcc.h> #include <libopencm3/cm3/common.h> #include <libopencm3/stm32/tools.h> #include <libopencm3/stm32/usb.h> @@ -53,6 +54,7 @@ const struct _usbd_driver stm32f103_usb_driver = { /** Initialize the USB device controller hardware of the STM32. */ static void stm32f103_usbd_init(void) { + rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USBEN); SET_REG(USB_CNTR_REG, 0); SET_REG(USB_BTABLE_REG, 0); SET_REG(USB_ISTR_REG, 0); diff --git a/lib/usb/usb_f107.c b/lib/usb/usb_f107.c index ee83b65..134b728 100644 --- a/lib/usb/usb_f107.c +++ b/lib/usb/usb_f107.c @@ -17,6 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <libopencm3/stm32/rcc.h> #include <libopencm3/cm3/common.h> #include <libopencm3/stm32/tools.h> #include <libopencm3/stm32/otg_fs.h> @@ -63,6 +64,7 @@ const struct _usbd_driver stm32f107_usb_driver = { /** Initialize the USB device controller hardware of the STM32. */ static void stm32f107_usbd_init(void) { + rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN); OTG_FS_GINTSTS = OTG_FS_GINTSTS_MMIS; /* WARNING: Undocumented! Select internal PHY */ -- 1.7.3.4 |