STM32 with SD card hangs :(
I cant get my STM32F4 to get past initializing the SD card, ive got it hooked up to SPI1 and PA4 on a 3V breakout board. It just hangs on
SD.begin()
. Ive tried SD and SDFat on a 16gb sd card

60 Replies
try initializing sd.Begin outside the if statement and comparing it later
still hangs there :(
check wiring?
douyble checked
have you soldered the header pins to the sd module?
also which board
stm32f4 blackpill
its wired w dupont
i shouldve designed the header to match the layout of the module, but this was before i got this module for other projects
have you checked to see if the sd card has a fat32/fatfs file system?
also what ide are you using to program it?
im using ardunio for stm32
yeah, i just formatted it to fat32
weird it was in GPT mode
formatted the partition table to MBR
nope :P
oh well
doesnt the miso,mosi and sclk pins need to be set aswell?
i dont think so?
ive never had to do that before
theres not much documentation of using SPI either, usually ppl just use SDIO but thats not really possible for me
unless i maybe add a second STM32 but like..
https://embetronicx.com/tutorials/microcontrollers/stm32/sd-card-interfacing-with-stm32-using-arduino-ide/
maybe this is a degraded example
letse see
ive just been playing with modified examples
btw i havent gotten into stm32,what pcb is the blackpill sitting on?
custom designed board to support IO and stuff for my weather balloon
ive got the entire i2c part working
woah
itsj ust the sd card is killing me
i dont like SPI anyway its so finicky no matter what youre doing
unholy
in so used to absolute beginners asking questions here without reading docs an stuff
can like a regular person just launch an air balloon?don't you need permits for that and stuff
if youre doing like really big ones yeah you need permits
im under the weight limit
best to notify the FAA n stuff tho
i dont see why setting the pa4 to high would do anything,but maybe mosi and rest of the pins are initialized in the header files?ill dowload them and look
especially when near airports
grasping for straws really
logically those pins need to be set for recieving and outputting somewhere
the one you sent me doesnt explode when you enable the SDcard fortunately
just fails to init lol
i might check w multimeter
ye,might just have a faulty module :/
low chance tho
i mean its just some resistors capacitors and a sd socket
im assuming youve checked for corrosion
wired properly
i dont think thered be corrosion
huh it worked
whar
why
im not sure?
thats scary though what if it fails again
i didnt change anything
see why i say SPI is unholy
turn it off/unplug it and back in to see if it works again?
maybe?
waow

?
it wrote to the file
maybe the old binary was in a cache and didnt load the new one i sent(???)
no it was definitely in there
at least the new one doesnt hang if it fails
like the old one
the hanging was cause of the infinite while loop
i remember spitting inside an sd card module like this and it working
yes it got stuck inside SD begin
whats the write speed of the card?
from this forum it seems when you try to write multiple times quickly the sd card has to finish writing the first instruction and then the next
honestly i have no idea
i was just trying to open it
so if you were spamming the program it mightve caused something similar??
https://community.st.com/t5/stm32-mcus-embedded-software/sdio-multi-block-write-fails-sometimes/td-p/571749
SDIO multi block write fails sometimes
Hi. I have few questions regarding SDIO and SD card write performance. I am using STM32F446 MCU and a simple application using polling SDIO that writes (appends) 32 blocks (16KB) of data to the SD card every 20ms. I do not use filesystem, just writing RAW bytes. Application increases block address o...
whatever happens in the open() function killed it
the cards dead now?
sorry my stupid dialect
it caught the STM32 in a loop
it couldnt get out of it
i guess
i mean i have no way to debug it
my UART programmers not that fancy
i see.....reformat the card and see if the current thing works?
no its working now
just to be redundant
im integrating it into the flight code
lol
:3
:3
:3
its fun to google my disc name and my posts from here show up
wait what :omori_basil_scared:
I think it scrapes after youve marked the thread as solved
and only the help threads(for the most part....)
damn

Oscilloscope Online: An online Graph Plotter, A cool alternative to...
Questions related to Oscilloscope Online: An online Graph Plotter, A cool alternative to Arduino IDE's Serial Plotter in Arduino
oscilloscope online??
i love oscilloscopes
also ace combat !!!
waow
this is perfectly relatvent because uh
im..
my flight software is called ace combat
oscilloscope is the name of the file log .CSV file
FUCKKKKK
MY OPSEC IS SHIT!
MY HYPERFIXATION
oscilloscopes
i have four