-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samples: disk: unable to access sd card #27841
Comments
@FRASTM I do not think that this is problem with FAT FS, shouldn't this be called "Unable to access SD Card"? |
yes, at the beginning the pb occurs with the sample fat_fs, |
Thanks for clarification! So the issue probably is not even with the samples but the general SD access via SPI. |
This is probably similar issue: #27112 |
@FRASTM Does the SPI controller driver used for accessing the SDHC card support |
thank you @henrikbrixandersen for pointing that. Trying CONFIG_SPI_HOLD_ON_CS=y gives not the solution, though. Could you please describe a bit the way for the spi driver to support |
well, the
|
Also wanting to confirm a similar issue while giving
When reverting c64e0ce, it works again
The DTS for the SPI is:
|
@pabigot You mentioned that you verified commit c64e0ce on Nordic SPI in #27685 (review). Any idea on what goes wrong for @NZSmartie above? |
I'll have a dig/debug into the situation tomorrow. I've been looking into the nrfx spi driver and so far it looks to respect zephyr/drivers/spi/spi_context.h Lines 176 to 200 in 016b542
from here zephyr/drivers/spi/spi_nrfx_spi.c Line 165 in 016b542
|
I'm not sure what board's being used in #27841 (comment) because the nrf52840dk_nrf52840 has a different A clear problem in @NZSmartie's DTS is specifying the chip select as active-high. CSn should be active-low. What works for me is this:
Note I'm switching from spi3 to spi2 because spi3 (which only supports |
Oh hmm. I haven't paid too much attention to the SPI CS line, their spec is rather vague about the pin itself[1]. I was following the Device tree example set by most boards and most but one that specify zephyr/boards/arm/olimexino_stm32/olimexino_stm32.dts Lines 80 to 91 in c6b1375
It still doesn't explain why GPIO_ACTIVE_HIGH works reliably in 2.3.0
Another interesting note. After setting
I guess the OEM SD card has some quirks that was compatible with the previous CS handling? [1] Physical Layer Simplified Specification Version 7.10 - 7.2.1 Mode Selection and Initialization
|
Also, the OEM SDCard times out during initialisation with |
In Zephyr 2.3.0 the active level flags from devicetree were ignored, and the SPI infrastructure set the configuration at runtime, defaulting to active low. ("asserted (negative)" in the spec you quoted means active low; active high would be "asserted (positive)".) Note that most non-SPI uses of GPIO are indeed active-high. It could well be the card, there are many standards and classes. I've had to go back to class 4 cards from five years ago to get some interfaces to work. In any case all I can confirm is that on current master the sample works correctly on Nordic boards when using the |
It appears that, if With software control of SSn this doesn't happen, but the response to the command is still not the expected result. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
I would like to repoen this issue. as still seeing this issue. |
Describe the bug
The samples/subsys/fs/fat_fs/ application cannot access the SD card through SPI bus,
To Reproduce
This sample is using a ci_shield to mount a SD card through SPI on a nucleo stm32f411
$ west build -p auto -b nucleo_f411re samples/subsys/fs/fat_fs/ -DSHIELD="ci_shield"
See error:
Error mounting disk.
[00:00:00.007,000] <err> main: Storage init ERROR!
[00:00:00.009,000] <err> fs: fs mount error (-5)
Expected behavior
`[00:00:00.005,000] spi_ll_stm32: CS control inhibited (no GPIO device)
Sector size 512
Memory Size(MB) 1886
Disk mounted.
Listing dir /SD: ...
[DIR ] SYSTEM~1
[FILE] TEST.LOG (size = 3072000)
[DIR ] TEST
`
Using the zephyrproject-rtos /fatfs latest branch including commit zephyrproject-rtos/fatfs@1369778
More info : PR ##26741 is helpful to adapt a SD card on a nucleo board
The text was updated successfully, but these errors were encountered: