2024-03-08 06:21 AM - last edited on 2024-03-08 07:08 AM by SofLit
2024-04-03 01:17 AM
I reduced the speed of the SDcard to 400kHz and mounted it on a nucleo board. Still did not do it on the custom board. I now have the feeling something is not right with the custom board.
2024-03-08 06:50 AM
Hello,
Try with 1 bit mode. If it does work see this thread.
2024-03-08 10:26 AM
The code fails only after :-
if (HAL_SD_Init(&hsd) != HAL_OK) { Error_Handler(); }
It fails in the HAL_SD_Init() only even after changing to 1B.
2024-03-08 10:58 AM
So your hardware is not working .
What board : custom or nucleo ...?
Length of tracks cpu -- sdcard ?
+
try simple setup for beginning with sd-card:
- 1 bit mode
- no dma template
- port/pins : all on speed: medium + pullup on
2024-03-10 04:38 AM
Its a custom board
2024-03-11 02:18 AM
The same problem I am facing after making sure only 1 bit, No DMA and all GPIO pins on medium speed
2024-03-11 03:03 AM - edited 2024-03-12 04:47 AM
+ Length of tracks cpu -- sdcard ?
Still init not working?
Then first check all signals to sd-card with scope . (10:1 low cap. tip)
If ok (3,3V....etc) look at CMD , here first (400kHz speed) "hello card..." communication;
if this ok, it switching to hi-speed (5...25Mbit), if long lines, then here problems begin to show up.
2024-03-12 04:44 AM
Track length is below 3 inches .
2024-03-26 08:17 AM
I did order a nucloe board and connected an SD card reader to it where I did see that it was connected in the 1bit mode but it was not connecting in the 4 bit mode.
When I am trying to enable the 4 bit mode then it is returning HAL_SD_ERROR_REQUEST_NOT_APPLICABLE
Clock is 108 MHz but I have put a clock div of 16 which makes 108/CLKDIV+2 which makes it 6 Mhz. Please help where we can look next.
2024-03-26 08:31 AM
-- Which nucleo ?
+ You got it working in 1 bit mode (the standard for sd-card) , good !
Try setting higher speed (i have 100M + div1 -> 50MHz card clk max.) and proof working;
by (only !!) reading files and check speed , you get. (and tell it here.)
If you really NEED more speed then, try same in 4 bit mode.