Custom STM32F103C8 SD Card Datalogger and USB Port

Post here first, or if you can't find a relevant section!
Post Reply
jenspogo
Posts: 30
Joined: Mon Feb 24, 2020 10:42 am

Custom STM32F103C8 SD Card Datalogger and USB Port

Post by jenspogo »

Hey everybody,

i would like to design my own STM32F103 Board. There should be an micro SD Card reader on it and also an easy way to programm the board with USB.
For the SD Card It seems to be a really straight forward design if you use SPI and the 3.3V Level of the STM32. Is it that easy?! just connect to the SPI pins and then use the STM32SD lib from github in the Arduino IDE? (https://github.com/stm32duino/STM32SD)

I'm a little bit confused about the USB Port - is Vbus from the PC or does it has to be from the board? I do know need the power from the USB Port - just data.
And are there any recommended values for USB resistors?

greetings, Jens
SDCard an USB.PNG
SDCard an USB.PNG (28.14 KiB) Viewed 15259 times
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Post by fpiSTM »

jenspogo wrote: Thu Mar 19, 2020 3:29 pm For the SD Card It seems to be a really straight forward design if you use SPI and the 3.3V Level of the STM32. Is it that easy?! just connect to the SPI pins and then use the STM32SD lib from github in the Arduino IDE? (https://github.com/stm32duino/STM32SD)
If you use SPI then you have to use the SD Arduino library. STM32SD is for SD card slot connected to SDIO or SDMMC peripherals of the STM32.
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Post by stevestrong »

You could eventually consider this F4 MCU board instead of bluepill, it is already equipped with SD card slot.
https://www.aliexpress.com/item/4000094075769.html
And the MCU is faster. ;)
jenspogo
Posts: 30
Joined: Mon Feb 24, 2020 10:42 am

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Post by jenspogo »

Hey :) Thanks for your reply!

Do you also have any ideas about the USB question?
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Post by stevestrong »

The STM chips have built-in USB ROM botloaders, also see viewtopic.php?p=1638#p1638.
jenspogo
Posts: 30
Joined: Mon Feb 24, 2020 10:42 am

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Post by jenspogo »

ok, that's good to know!
But what about the Layout? USB has a 5V Level and the STM is at 3.3V. So i do not knwo how to design the PCB of the USB connection correctly. Any ideas or examples?
greetings, Jens

EDIT: Ok, i was just to stupid to google. Found something!
https://www.mikrocontroller.net/wikifil ... 32_USB.png
Post Reply

Return to “General discussion”