cancel
Showing results for 
Search instead for 
Did you mean: 

Errors in SDMMC (STA and IDMABSIZE) registers / STM32cubIDE SFRs for STM32L4R9 ?

gorgabab
Associate

Hello

A few days ago, I went through the SDMMC registers using stm32l4r9-discovery.
I am using the "June 2021 RM0432 Rev 9" and haven't found a more recent datasheet for it.

Using stm32cubeide (1.17.0) (window->show view->)SFRs panel, the bits shown in SDMMC1 STA don't match with the datasheet ones in 54.10.11 SDMMC_STAR section as follow. The IDMA labels are missing too in SFRs.

comp_sfr_ds_sdmmc_sta.png

In 54.10.17 (p. 2030/3000), the IDMABNDT attribute is defined for the [12:5] bits (8-bit long value).
On the bit table, the 16th bit is shown as "rw" which is false as the [31:13] are specified as "reserved, must be kept at reset value". (In some stm32 boards, the sdmmc IDMABNDT is defined on [5:16] bits so it just might be a copy-paste error).

My main concerns about this register are the differences between the datasheet and HAL function.

The datasheet specifies a constant bit offset 5 for IDMABNDT, but in the HAL function, the IDMABSIZE is set depending on the BLOCKSIZE (constant 512 bytes) which is unclear/confusing to me.

Let's say My IDMA buffers are 10-block long.
Using datasheet, we have

SDMMC1->IDMABSIZE = ((SDMMC1->IDMABSIZE & 0xffffe01f) | (10 << 5)); // 0xffffe01f is the mask to prevent writes outside [12:5] // value is 8-bit long value
// = 320UL


Using HAL_SDEx_ConfigDMAMultiBuffer, we have

SDMMC1->IDMABSIZE = (uint32_t) (BLOCKSIZE * 10);
// = 5120UL (12 bits long starting to 0 which means a larger number of block would exceed the initial mask [12:5])


The results differ. My tests using the datasheet method worked but not the HAL ones where IDMABSIZE register would still be stuck at 0 after initialization (the mask might block the operation or something), thus blocking the HAL_SDEx_WriteBlocksDMAMultiBuffer operation.

gorgabab_1-1737558264752.png

 

 

 

0 REPLIES 0