cancel
Showing results for 
Search instead for 
Did you mean: 

Standard Peripherals library for STM32L1xx USB

nanayakkaraan
Associate II
Posted on April 01, 2014 at 12:59

Hello,

STM32L1 microcontrollers are having USB peripheral. But unfortunately 

STM32L1xx Standard Peripherals library from ST does not include a sample project for USB. The library includes a rich set of sample files for most other units. Can some body points me out a good sample project to start with STM32L1 USB?

Thanks.

#stm32l151-usb
6 REPLIES 6
chen
Associate II
Posted on April 01, 2014 at 15:42

Hi

''

Can some body points me out a good sample project to start with STM32L1 USB?

''

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/PF258157?s_searchtype=keyword

I believe ST are stopping support for the Peripheral Libraries in favour of the STM32Cube

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1533/PF259242?icmp=pf259242_prom_stm32cube-long-promo_feb2014

I do not anything about this new cube software - I have not tried it yet.

tsuneo
Senior
Posted on April 02, 2014 at 17:42

> But unfortunately STM32L1xx Standard Peripherals library from ST does not include a sample project for USB.

This library is still there on the ST site.

STSW-STM32121

STM32F10x, STM32L1xx and STM32F3xx USB full speed device library (UM0424)

http://www.st.com/web/en/catalog/tools/PF258157

Tsuneo

kevinliao
Associate II
Posted on December 22, 2014 at 05:14

Hi, 

Tsuneo & Everyone,

Is the USB function of STM32L15x workable?

Because I bought the both ST Nucleo L152RE board and STM32 L1 Discovery board,

there are no USB connector.

I need the composite device function (HID and virtual com port). and I fear the L1 can't support USB function.

Thank you.

BR

chengyi

Posted on December 22, 2014 at 16:59

I fear the L1 can't support USB function.

Have you looked at the

http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF247169?sc=internet/evalboard/product/247169.jsp

board? Review the design documents for that, and determine how you can replicate the connectivity on the boards you bought without USB hardware attached.

STM32_USB-FS-Device_Lib_V4.0.0\Utilities\STM32_EVAL\STM32L152_EVAL

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kevinliao
Associate II
Posted on December 23, 2014 at 10:23

Dear clive

Thank you for the reply. I got it.

By the way, May I ask if I need to switch the clock source between HSI & HSE when MCU working.

Is it possible? 

Because in the application, the HSE clock source need set by MCU, 

so I need start MCU with HSI RC source, to enable HSE clock source, then switch to HSE clock source.

And maybe also need to switch clock source from HSE to HSI for saving power.

Is it workable? 

Thanks a lot!

Best regards,

Chengyi

Posted on December 23, 2014 at 15:32

Yes, you can change clock sources on the fly, how complicated that gets depends on what you're using and what you want to go to.

For a PLL speed changed you'd need to switch the processor to a different enabled/ready clock, then disable the PLL, reconfigure it, wait for it to lock, then switch back to the PLL source, and then wait for it to be selected.

You also need to make sure flash wait states, and other APB/AHB settings are valid for the speeds you are switching too, and do it before/after the change depending on if they need to be faster/slower.

Not sure if HSI uses less energy than HSE.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..