-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Portenta H7 (STM32H7xx): eMMC support #945
Comments
it seems SDMMCBlockDevice::program is misbehaving, and calculating block_addr / block_cnt wrong. uint32_t block_cnt = size / 512; The output will be Edit: |
int TestDisk() |
When I do Erase, Write, Read on 512-Byte-Block 1, it works. Then Block 2 erase, write, read. Block 2 still reads. However Block 1 is now not readable anymore, so erasing block 2 seems to also erase block 1. There seems to be an issue with the erase block size. eMMC seems to have an erase block size much larger than the 512 Byte block size (typically 128 ... 512 KiB) bd_size_t sector_size = _ffs[pdrv]->get_erase_size();
MBED_ASSERT(sector_size <= WORD(-1));
WORD ssize = sector_size;
if (ssize < 512) {
ssize = 512;
}
MBED_ASSERT(ssize >= FF_MIN_SS && ssize <= FF_MAX_SS); |
I have sucessfully used SD Cards with the Portenta.
However I cant get it to work with eMMC Modules. I use a custom Board for this.
the relevant code is in BSP.c
With the HAL_SD functions I get errors, HAL_SD_Init Fails.
If I replace the with the fitting HAL_MMC_xxx functions (including changing the types), it does initialize the eMMC Chip, showing that it can interact with the chip. The size / block size etc. shown when enabling SD_DBG seem to work.
It does also read / write when trying to format with FatFileSystem (the underlying HAL function calls return OK every single time). However the format call fails with error code -22 (EINVAL).
It seems that data written are not really written.
I can provide my modified code (BSP.c/.h, SDMMCBlockDevice.cpp) if that helps.
The text was updated successfully, but these errors were encountered: