Hello guys, I am working with STM32G0C1RET6. I want to use STM32 as a USB host and want to save data on USB flash stick. I followed some tutorial from ST microcontroller's youtube channel but I am still not able to mount my USB device. what should I do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-11 8:12 AM
Here are details about my project:
- I have connected my USB_DM and USB_DP pin directly to USB connector.
- I enable A9 and selected as a GPIO output using VBUS setting in CUBEIDE. Which is providing me 3.3V
- I read that there is inbuilt pull up resistor in STM32G0C1RET6. So, I connected USB connector directly to pins
- I used "f_mount" function to mount my usb device.
My USB device is using FAT32 format. I AM SORRY if I made some dumb mistake; I am newbie
- Labels:
-
STM32G0 Series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-11 10:39 AM
If your USB connection is as above, I recommend that you find the MX_DriverVbusFS function in the usbh_platform.c file and make its content compatible with your power switch IC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-11 7:25 PM
Hiii, thank you so much for suggestion. Is it necessary to set USB connection as you showed in image??
​
I​ didn't make any connection like that. I just connected USB connector pin to STM32's A9 pin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-12 12:59 AM
A couple of times I accidentaly swapped USB DATA+ and DATA- Lines, double check you didnt do the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-12 1:02 AM
Leave a link to the youtube tutorial youre trying to follow and maybe some pictures of your hardware
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-12 7:40 AM
Hi, thank you so much for reply. No, I made sure that I don't interchange DP and DM lines. Both connections are correct..Here is link of the video I am following:
https://www.youtube.com/watch?v=dC0d8CVEPrQ&list=PLnMKNibPkDnFFRBVD206EfnnHhQZI4Hxa&index=20
Sorry but I can't get picture of hardware. Do I need to use "Current limiter power switch"??
When I run program FRESULT shows FR_DISK_ERR. what does that mean?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-12 7:45 AM
>>When I run program FRESULT shows FR_DISK_ERR. what does that mean?
Means your DISKIO layer isn't working, fix that first.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-12 7:49 AM
Okay. I will update after fixing this. Thank you so much.
Do I need to use "current limiter switch" as shown in below diagram OR I can just directly connect STM32 pin with USB connector??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-12 8:30 AM
During the installation phase, the power of the usb disk needs to be cut and re-applied. It is necessary for safety to have current limitation, but you must use a switch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-12 8:41 AM
You can use STMPS2141 as switch. I also recommend adding a protection element such as USBLC6-2SC6 to the USB data line.​
