ChibiOS version: stable_20.3.x@13804
Compiler: gcc (GCC) 10.1.0
Platform/board: Custom board implementing STM32F446RE and 4-bit eMMC
Problem:
sdcErase() uses the reserved commands CMD32 and CMD33 according to the STM32F446xx Reference Manual Table 200. This causes the SDIOv1 driver to respond with HAL_FAILURE when calling sdcErase(). When tested using the commands CMD35 and CMD36, sdcErase succeeds.
SDC driver uses reserved CMD for erase Topic is solved
-
- Posts: 34
- Joined: Thu Aug 31, 2017 6:32 pm
- Has thanked: 8 times
- Been thanked: 6 times
-
- Posts: 34
- Joined: Thu Aug 31, 2017 6:32 pm
- Has thanked: 8 times
- Been thanked: 6 times
Re: SDC driver uses reserved CMD for erase
Looking into this more, while CMD35 and CMD36 indicate the command succeeded, they are not drop-in replacements for what CMD32 and CMD33 were. Apparently CMD32/CMD33 erase a range of sectors (blocks), while CMD35/CMD36 erase a range of groups of blocks that could be 16-32 blocks long (so START 1 END 2 would be 64 blocks if it's 32 blocks per group I think?).
This presents a challenge when everything else is in terms of individual blocks. I'm not really sure how this should be fixed besides maybe defining things in terms of block groups. Does anyone have thoughts on this?
This presents a challenge when everything else is in terms of individual blocks. I'm not really sure how this should be fixed besides maybe defining things in terms of block groups. Does anyone have thoughts on this?
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: SDC driver uses reserved CMD for erase
Cards used to support CMD32 and CMD33, this is why it is done this way.
I decided to not fix it for simplicity, the erase function is not really required for FatFS which is our use case.
Giovanni
I decided to not fix it for simplicity, the erase function is not really required for FatFS which is our use case.
Giovanni
-
- Posts: 34
- Joined: Thu Aug 31, 2017 6:32 pm
- Has thanked: 8 times
- Been thanked: 6 times
Re: SDC driver uses reserved CMD for erase
Ah okay, fair enough.
I guess generally speaking it's not needed. I was trying to test some alternatives to FatFS for more fault tolerant space applications, and some of them expect an erase function. I think I worked around it though by just having the erase functions do a write of 0xFFFFFFFF.
I guess generally speaking it's not needed. I was trying to test some alternatives to FatFS for more fault tolerant space applications, and some of them expect an erase function. I think I worked around it though by just having the erase functions do a write of 0xFFFFFFFF.
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: SDC driver uses reserved CMD for erase
heliochronix wrote:Ah okay, fair enough.
I guess generally speaking it's not needed. I was trying to test some alternatives to FatFS for more fault tolerant space applications, and some of them expect an erase function. I think I worked around it though by just having the erase functions do a write of 0xFFFFFFFF.
It is not a problem, cards do their own optimizations internally.
Giovanni
Who is online
Users browsing this forum: No registered users and 17 guests