Code: Select all
bool sdcErase(SDCDriver *sdcp, uint32_t startblk, uint32_t endblk) {
Is this function really needed? It calls nowhere.
Code: Select all
bool sdcErase(SDCDriver *sdcp, uint32_t startblk, uint32_t endblk) {
barthess wrote:Code: Select all
bool sdcErase(SDCDriver *sdcp, uint32_t startblk, uint32_t endblk) {
Is this function really needed? It calls nowhere.
Giovanni wrote:Didn't you add that one or I remember wrong? it is not used anyway.
Giovanni wrote:Edit: Let's make the HLD call the LLD in order to obtain the card size, this way the LLD can decide how to handle the buffer (configuration pointer, static, dynamic or whatever).
Giovanni wrote:In general I would limit changes because 3.0 is looooong overdue.
Giovanni wrote: I made some changes in sdcConnect() in order to make the buffer "less necessary", not it should be required only for MMC cards above 2GB (please verify this, I have no MMC cards).
Giovanni wrote:the bus size is STM32-specific.
Giovanni wrote:question about sdc_detect_bus_clk(), there the command is called twice, is this intentional?
Code: Select all
static bool sdc_detect_bus_clk(SDCDriver *sdcp, sdcbusclk_t *clk) {
uint32_t cmdarg = 0;
uint8_t *scratchpad = sdcp->config->scratchpad;
/* Safe default.*/
*clk = SDC_CLK_25MHz;
/* Use safe default when there is no space for data.*/
if (NULL == scratchpad)
return HAL_SUCCESS;
if (sdc_lld_read_special(sdcp, scratchpad, 64, MMCSD_CMD_SWITCH, cmdarg))
return HAL_FAILED;
if ((sdc_cmd6_extract_info(SD_SWITCH_FUNCTION_SPEED, scratchpad) & 2) == 2) {
cmdarg = sdc_cmd6_construct(SD_SWITCH_SET, SD_SWITCH_FUNCTION_SPEED, 1);
if (sdc_lld_read_special(sdcp, scratchpad, 64, MMCSD_CMD_SWITCH, cmdarg))
return HAL_FAILED;
if (HAL_SUCCESS == sdc_cmd6_check_status(SD_SWITCH_FUNCTION_SPEED, scratchpad))
*clk = SDC_CLK_50MHz;
}
return HAL_SUCCESS;
}
Giovanni wrote:I could live with a 64bytes buffer on the stack, usually the sdcConnect() is called from the main and the stack is available there.
Giovanni wrote:About the bus width, couldn't some low level driver do that automatically?
Giovanni wrote:About the code I don't understand much
Users browsing this forum: No registered users and 4 guests