Skip to content
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

initial PR for SDIOBlockdevice implementation #1

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

add_library(mbed-storage-sdio STATIC)

list(APPEND SOURCEFILES
SDIOBlockDevice.cpp
)

target_include_directories(mbed-storage-sdio INTERFACE .)

if("STM32F4" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-storage-sdio PUBLIC ./TARGET_STM/TARGET_STM32F4)
list(APPEND SOURCEFILES
TARGET_STM/TARGET_STM32F4/sdio_device.c
)
endif()

if("STM32F7" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-storage-sdio PUBLIC ./TARGET_STM/TARGET_STM32F7)
list(APPEND SOURCEFILES
TARGET_STM/TARGET_STM32F7/sdio_device.c
)
endif()

if("STM32H7" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-storage-sdio PUBLIC ./TARGET_STM/TARGET_STM32H7)
list(APPEND SOURCEFILES
TARGET_STM/TARGET_STM32H7/sdio_device.c
)
endif()

target_link_libraries(mbed-storage-sdio
PUBLIC
mbed-rtos-flags
mbed-storage-blockdevice
)

target_sources(mbed-storage-sdio
PRIVATE
${SOURCEFILES}
)
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,25 @@ This is not officially supported driver.
## License & Contributions

The software is provided under [Apache-2.0 license](LICENSE). Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more info.

This is an implementation for a blockdevice to use SDHC cards via SDIO interface.

## Supported Hardware
- STM32F4
- STM32F7

## Tested Hardware
- STM Discovery board 32F469IDISCOVERY, Targetname: DISCO_F469NI
https://os.mbed.com/platforms/ST-Discovery-F469NI/
- STM Discovery board 32F746IDISCOVERY, Targetname: DISCO_F746NG
https://os.mbed.com/platforms/ST-Discovery-F746NG/


## Driver Description
This SDIOBlockdevice inherits from Blockdevice. The implementation uses an intermediate layer for the target specific code. This version uses the STM HAL
for the SD card communication, an approach that is not fully mBed compliant. So this driver is not part of the mbed-os, a cleaner solution maybe supplied in the future. Anyway, this driver passes the same tests as for a SDBlockdevice with SPI interface.

## Usage
The driver is used like other blockdevices, a good starting point is https://github.com/ARMmbed/mbed-os-example-filesystem


Loading