You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have SDBlockDevice driver for SD cards which uses SPI interface, and SDIO support is not available yet. In case you are planning to implement SDIO driver, you can add it as BlockDevice. BlockDevice class provides the underlying API for representing block-based storage that you can use to back a file system. Mbed OS provides standard interfaces for the more common storage media, and you can extend the BlockDevice class to provide support for unsupported storage.
There is only one question: mbed-os not support a API for SDIO interface, and i only plain to use it in stm32. How can I implement SDIO driver or only implement SDFilesystem for STM32 SDIO driver?
I'm sorry I don't have a public repository to share, but I found it pretty straightforward to implement the BlockDevice API using ST's Cube BSP functions - BSP_SD_xxx() Depending on your STM device, you should be able to download the appropriate ST Cube package to get the BSP drivers to use. If you're not using any of their evaluation boards, then you can use the BSP implementation as a starting point.
I have implemented a SDIOBlockDevice for the STM32F4. It needs some further testing but it is working already on a DISCO_F469NI and on a chinese STM32F407VE board. I would like to make a PR and appreciate any help for testing and design decisions.
Should this issue be reopened or shall I open a new issue?
I've also used the STM32 HAL implementation and created a /components/SDIO_BLOCKDEVICE. That makes it compatible with the FileSystem class and also LittleFS can be used.
I need to clean up my code before pushing, it contains too much stuff for testing.
@MarceloSalazar I have tried the first time to use the mbed tests. I copied the tests from SDBlockdevice and changed the setttings for SDIOBlockdevice.
I have some problems with the bd.init() / bd.deinit() sequence, on an execution of another bd.init() after a deinit() the HAL code is hanging in a SD_FindSCR() function when checking if 4 bit mode is supported. When I uncomment this check and switch to 4 bit mode anyway the tests are all passing positive.
In the case of the failing tests I can not see the reason why the seek test is passing ok but other tests are failing, the seek test performs also an init/deinit. Only the fopen test is programmed differently, the bd is assigned in the fs constructor statically and no init/deint is performed, so no problem. SDIOBlockdevice-Testresult-ok.txt SDIOBlockdevice-Testresult-notOk.txt
SD_FindSCR() is trying to read the SCR with polling when the SD is in fast transfer mode already. This polling seams to be very time critical, although data is read from a fifo. Within the read loop, there is a timeout check that reads the mbed timer. But due to a lot of lockings and checks for locking this has become very slow. Removing the timeout check makes the code work. Anyway, removing the FindSCR from the initialisation works more reliable and the SD standard requires 1 and 4 bit mode.
the FATFS format makes calls to blockdevice init/deinit, it looks like the reference counting for init/deinit is mandatory in the BD implementation, is that true?
thanks for your support.
For the second point I will implement the reference counting.
I had also some problems with rebasing my feature brand with master, after solving I will update my github repo.
@JojoS62 About a month ago I tested the SDIO and worked fine for me. Now I tried your new version that works too but I have some problem with mounting sd I need to reset my board twice or more to get sd mounted. I mean Filesystem.mount(sdio block).
@masoudr I have continued my work in a newer branch, add-sdioblockdevice. In 'add-component-sdio-blockdevice' I mixed sources from two origins and I could not rebase it without always merging.
My PR was not accepted, but I will create a lib as suggested here: #8634 I'm currently working on this.
The tests that I used showed also a problem with multiple init/deinit of the blockdevice, this was fixed in the 'add-sdioblockdevice' branch, so you should try these files.
@savent404 You are right, the constructor should get the IO pins for the SDIO interface. This version was tested with F469NI and F407VE, there the was same configuration. I will check this.
For the DMA, there are only two choices. There could be also a configuration via constructor or mBed configuration system.
And please answer through the github web interface, not by replying to the mail notification.
We have separate repository for SDIO driver https://github.com/ARMmbed/sdio-driver. Please add issues, queries and PR to respective repository, closing this
Activity
0xc0170 commentedon Mar 19, 2018
@deepikabhavnani Please review
deepikabhavnani commentedon Mar 19, 2018
We have SDBlockDevice driver for SD cards which uses SPI interface, and SDIO support is not available yet. In case you are planning to implement SDIO driver, you can add it as BlockDevice. BlockDevice class provides the underlying API for representing block-based storage that you can use to back a file system. Mbed OS provides standard interfaces for the more common storage media, and you can extend the BlockDevice class to provide support for unsupported storage.
For more information please refer: https://os.mbed.com/docs/v5.7/reference/storage.html
savent404 commentedon Mar 20, 2018
There is only one question: mbed-os not support a API for SDIO interface, and i only plain to use it in stm32. How can I implement SDIO driver or only implement SDFilesystem for STM32 SDIO driver?
deepikabhavnani commentedon Mar 20, 2018
API's for SDIO interface will be same as API's for SPI interface. https://github.com/ARMmbed/sd-driver/blob/master/SDBlockDevice.h
pauluap commentedon Mar 23, 2018
I'm sorry I don't have a public repository to share, but I found it pretty straightforward to implement the BlockDevice API using ST's Cube BSP functions -
BSP_SD_xxx()
Depending on your STM device, you should be able to download the appropriate ST Cube package to get the BSP drivers to use. If you're not using any of their evaluation boards, then you can use the BSP implementation as a starting point.savent404 commentedon Mar 27, 2018
That is exactly what i'm doing!
0xc0170 commentedon Jun 22, 2018
Thanks @pauluap for sharing.
@savent404 The question answered? I'll close it. Please reopen with an update if any
JojoS62 commentedon Sep 11, 2018
I have implemented a SDIOBlockDevice for the STM32F4. It needs some further testing but it is working already on a DISCO_F469NI and on a chinese STM32F407VE board. I would like to make a PR and appreciate any help for testing and design decisions.
Should this issue be reopened or shall I open a new issue?
savent404 commentedon Sep 11, 2018
Hi, I got a solution about implement BlockDevice
JojoS62 commentedon Sep 11, 2018
I've also used the STM32 HAL implementation and created a /components/SDIO_BLOCKDEVICE. That makes it compatible with the FileSystem class and also LittleFS can be used.
I need to clean up my code before pushing, it contains too much stuff for testing.
23 remaining items
JojoS62 commentedon Oct 29, 2018
@MarceloSalazar I have tried the first time to use the mbed tests. I copied the tests from SDBlockdevice and changed the setttings for SDIOBlockdevice.
I have some problems with the bd.init() / bd.deinit() sequence, on an execution of another bd.init() after a deinit() the HAL code is hanging in a SD_FindSCR() function when checking if 4 bit mode is supported. When I uncomment this check and switch to 4 bit mode anyway the tests are all passing positive.
In the case of the failing tests I can not see the reason why the seek test is passing ok but other tests are failing, the seek test performs also an init/deinit. Only the fopen test is programmed differently, the bd is assigned in the fs constructor statically and no init/deint is performed, so no problem.
SDIOBlockdevice-Testresult-ok.txt
SDIOBlockdevice-Testresult-notOk.txt
JojoS62 commentedon Oct 30, 2018
At the moment, I found two problems:
MarceloSalazar commentedon Oct 31, 2018
@dannybenor @offirko is this something you could review and advise? Thanks!
JojoS62 commentedon Oct 31, 2018
thanks for your support.
For the second point I will implement the reference counting.
I had also some problems with rebasing my feature brand with master, after solving I will update my github repo.
masoudr commentedon Nov 9, 2018
@JojoS62 About a month ago I tested the SDIO and worked fine for me. Now I tried your new version that works too but I have some problem with mounting sd I need to reset my board twice or more to get sd mounted. I mean
Filesystem.mount(sdio block)
.JojoS62 commentedon Nov 9, 2018
@masoudr I have continued my work in a newer branch, add-sdioblockdevice. In 'add-component-sdio-blockdevice' I mixed sources from two origins and I could not rebase it without always merging.
My PR was not accepted, but I will create a lib as suggested here: #8634 I'm currently working on this.
The tests that I used showed also a problem with multiple init/deinit of the blockdevice, this was fixed in the 'add-sdioblockdevice' branch, so you should try these files.
masoudr commentedon Nov 9, 2018
@JojoS62 Thanks. Now I'm testing it and it is a lot faster. I'm testing it with
zlib
and it worked fine for me.savent404 commentedon Nov 10, 2018
JojoS62 commentedon Nov 10, 2018
@savent404 You are right, the constructor should get the IO pins for the SDIO interface. This version was tested with F469NI and F407VE, there the was same configuration. I will check this.
For the DMA, there are only two choices. There could be also a configuration via constructor or mBed configuration system.
And please answer through the github web interface, not by replying to the mail notification.
deepikabhavnani commentedon Dec 28, 2018
We have separate repository for SDIO driver
https://github.com/ARMmbed/sdio-driver
. Please add issues, queries and PR to respective repository, closing this