cancel
Showing results for 
Search instead for 
Did you mean: 

USB SUPPORT

ABhat.7
Associate III

@Ons KOOLI​.

Hi, i want to use stm32f103 or stm32f1 family microcontroller for mass storage in usb for data logging.any reference and example are pretty useful as i am new to usb logging with stm32.

20 REPLIES 20

you dont really need VUSB pin if youre using USB in device mode (i am at the moment and i dont use VUSB)

we dont need to firmware by ourselves, lets talk

Hi, right now i am using usb host for Msc so as per reference manual it shown that we required to give vcc to vvbus,do you have done any mass storage project with stm32f1 kindly share your .ioc file

i am struggling also to do the mass storage in stm32f1 also but i do know this:

If you want your stm32 to behave as a usb flash drive use usb device mode:

https://www.youtube.com/watch?v=Us_sTdGGcOQ

If you want your stm32 to read an external flash drive connected to its usb use usb host mode:

https://www.youtube.com/watch?v=_bfROydrssA

Hardware:

Anyway VUSB needs to have a 2 resistors voltage divider becasue the bus is 5v and the adcs range ends in 3v3 as shown here:

https://www.youtube.com/watch?v=vwlXUOY7KY0&list=PLnMKNibPkDnFFRBVD206EfnnHhQZI4Hxa&index=8

0693W000008zup2QAA.png

we dont need to firmware by ourselves, lets talk

Hi @ABhat.7​ ,

Can you please specify which IDE are you using ?

Best Regards,

Ons.

Hi @Ons KOOLI​  i am using ewarm with cubemx v4.3 is their any problems with this can you example why my appli state is always showing application start in usb process function even though i have connect usb and secondly i noticed that when generate code the gpio definition for DP and DM are not present so what could be the reason​

Hi ABhat,7,

After generating the .ioc file you provided, I found some errors on your project. Can you please re-check if you provided the good file ?

Best Regards,

Ons.

Hi @Ons KOOLI​  what error you found as i said earlier I am new to usb with stm32 so i seethe youtube example with stm32f4 the only difference that is their is that i donot use gpio for vbus i simply put a resistor divider and activate vbus is they is any other error please let me know so that i can work on it thank again waiting for your support​

I am using cubemx v4.3 for usb code generate and after that following step provide in training video pls describe what error you are getting so that i can work on it​

ABhat.7
Associate III

Hi, @Ons KOOLI​  as per your advise i revised my project with latest stm32cubef1 library v1.8.3 so i am attached my latest .ioc file and the warning is coming since i have not selected any option for vbus activation since my idea is to always keep vbus on i.e i simply put a resistor divider that has 4k7 and 10k resistance so that i can get supply as per mentioned in hal usb host document i simply do not want to use any gpio apart from that all configuration is done as per ST USB HOST MSC training video ,kindly advise me what is wrong i am doing that my device is not getting detected while debug i always notice my appli state as application start. i don't think it any issue if i donot use any gpio for activating vbus if i am giving continuously the supply to vbus.

Thanks & wait for early reply

Hi ABhat.7,

I checked your new .ioc version, a good thing that there is no errors/warnings anymore. However, I have to load it to an STM32F107 board but I have not at the time, unfortunately, since I am on home office. I ask you to kindly wait some time until I have access to the board.

Best Regards,

Ons.