STM32 USB - Page 1
Forum section: electronics / projects

author: pyrohaz
author_rank: Regular Contributor
timestamp: May 27, 2014, 03:35:27 am
content: Hey all,I'm designing a system based on the STM32L1 chip which supports USB. I'm using a standard 8MHz crystal so the PLL will have a stable frequency to create the USB clock from.What I'm wondering is how I actually connect the USB port to the IC. After looking at the schematic for the STM32F4 discovery kit, it seems that the USB port is connected to the MCU through two 22Ohm resistors (http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00039084.pdfPage 39) along with an ESD protection IC. I won't be including this IC because I can't solder BGA packaged just yet!I've included these two 22Ohm resistors and a 1.5k pullup resistor to 3.3v that the internet seems to suggest I need. The 5v from the bus goes directly to my MCU regulator. In the image I've attached, USBD- goes to PA11 and USBD+ goes to PA12 (these are the respective pins on the MCU from the datasheet).Is this all I need to be able to program my system through DFU? I have included the ability to set BOOT0 high (required for DFU mode) and I can reset the MCU once BOOT0 is high.Cheers,Harris

author: theatrus
author_rank: Frequent Contributor
timestamp: May 27, 2014, 06:18:16 am
content: From what I can see, the STM32L only has a USART bootloader, and doesn't have any DFU capability

author: Lizerd
author_rank: Contributor
timestamp: May 27, 2014, 06:31:00 pm
content: STM32L1 series:– STM32L1xxxC, STM32L1xxxD, STM32L1xxxE Has DFU bootloaderCheckhttp://www.google.se/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCwQFjAA&url=http%3A%2F%2Fwww.st.com%2Fst-web-ui%2Fstatic%2Factive%2Fen%2Fresource%2Ftechnical%2Fdocument%2Fapplication_note%2FCD00264379.pdf&ei=k9mEU_a3HeeQ4gT2wYHgBw&usg=AFQjCNGaBlsRjRwY5CpwulTOHbpmtKPv3g&sig2=VLe8tTM5RCOmFtMSfDTlfg&bvm=bv.67720277,d.bGE&cad=rja

author: pyrohaz
author_rank: Regular Contributor
timestamp: May 27, 2014, 08:17:36 pm
content: Yeh, as said by Lizerd, i'll be using one of the USB enabled STM32L series! Is there anything else I need to add for this to work?

author: andyturk
author_rank: Frequent Contributor
timestamp: May 28, 2014, 02:22:44 am
content: You don't actually need the pull-up resistor as there's one built in already. The pull-up is activated by setting the USB_PU bit in the SYSCFG register. See section 8.5.2 of RM0038.Edit: Oh, and regarding the bootloader, make sure you have pull ups or pull downs on all the other I/O lines that the bootloader will try (CAN, USART, etc.).

author: pyrohaz
author_rank: Regular Contributor
timestamp: May 30, 2014, 02:51:30 pm
content: Hi all,I've finished the PCB routing for my system and have included the 22ohm resistors, along with the pads for the 1.5k resistor if required, I decided to include it just incase because if it isn't needed, I can just not populate it!Thanks for the help

author: gxti
author_rank: Frequent Contributor
timestamp: May 30, 2014, 04:39:55 pm
content: Good idea. Plan for the worst, because the pads are free. With STM32 it can be confusing exactly what's required because the different series have different USB controllers, and even within a part there can be a high speed controller and a OTG controller each with different capabilities in terms of pullup etc.For the ESD protection, there's no need to use the exact part ST used. There are dozens of different ESD protection ICs qualified specifically for USB in friendlier packages. For example, here's the one I'm using in my current product for both USB and SDIO:http://www.digikey.com/product-detail/en/USBLC6-2SC6/497-5235-1-ND/1121688That said, it's not strictly required to add extra ESD protection. The 22 ohm resistors plus the builtin ESD protection in the STM32 goes a long way.