2023-06-12 12:47 AM
I am using STM32H735AGI6 on a custom board with an KLM8G1GETF eMMC
I am reading JEDEC Standard No. 84-B451
I want to start reading counter: std says "The counter read sequence is initiated by Write Multiple Block command, CMD25. Prior to CMD25, the block count is set to 1 by CMD23"
Prob 1: There is only 1 block to write but in HAL_MMC_WriteBlocks_DMA I find
if (NumberOfBlocks > 1U)
{
hmmc->Context = (MMC_CONTEXT_WRITE_MULTIPLE_BLOCK | MMC_CONTEXT_DMA);
/* Write Multi Block command */
errorstate = SDMMC_CmdWriteMultiBlock(hmmc->Instance, add);
}
else
{
hmmc->Context = (MMC_CONTEXT_WRITE_SINGLE_BLOCK | MMC_CONTEXT_DMA);
/* Write Single Block command */
errorstate = SDMMC_CmdWriteSingleBlock(hmmc->Instance, add);
}
so it will send "write single block"
Prob 2: As you can see, before SDMMC_CmdWriteMultiBlock, it does not send CMD23.
Moreover, if you search for SDMMC_CMD_SET_BLOCK_COUNT (aka CMD23), you find only the #define
Can you help me?
Solved! Go to Solution.
2023-07-10 05:54 AM
to whom it may concern:
First of all, you must add a function that implements cmd23
Next you must implement read/write functions that mimics HAL_MMC_ReadBlocks_DMA and HAL_MMC_WriteBlocks_DMA but they:
1) always use multiple block commands
2) do not send cmd12 (stop command), you must modify HAL_MMC_IRQHandler
Now you can do all the operations on rpmb
2023-06-12 01:52 AM
Add the function / code needed to communicate the expected length, makes parts like those from SanDisk faster.
2023-06-12 02:01 AM
I don't understand
I should call HAL_MMC_WriteBlocks_DMA(mmc, my_read_counter_command,0,1), but:
1) the func will use CMD24, not CMD25
2) CMD23 is never used
Can you point me to examples using CMD23?
2023-06-25 10:54 PM
no help?
2023-07-10 05:54 AM
to whom it may concern:
First of all, you must add a function that implements cmd23
Next you must implement read/write functions that mimics HAL_MMC_ReadBlocks_DMA and HAL_MMC_WriteBlocks_DMA but they:
1) always use multiple block commands
2) do not send cmd12 (stop command), you must modify HAL_MMC_IRQHandler
Now you can do all the operations on rpmb