2025-08-30 6:35 AM
Hello,
I am using STM32H750VBT6 to perform microSD card write operations. After a number of writes, the CPU sometimes resets during a write operation. At the same time, the Vcore (1.13V) rail shows a voltage drop. The issue is random, but the higher the write frequency, the faster it occurs. Below are details of my hardware, software, and test results.
1. Hardware design
The power supply module:
The power supply is designed with 12V input, generating 3.8V, 3.3V, 1.8V, and 1.13V.
3.3V powers the STM32 VDD pins, and 1.13V powers the VCAP pins.
Each VCAP pin is decoupled with a 0.1 µF capacitor in parallel with a 4.7 µF capacitor (located close, but not on the same plane due to vias).
The SD card interface:
2. Software design
Initialization code generated by STM32CubeMX + HAL library:
void MX_SDMMC1_SD_Init(void)
{
hsd1.Instance = SDMMC1;
hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
hsd1.Init.BusWide = SDMMC_BUS_WIDE_4B;
hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
hsd1.Init.ClockDiv = 0;
if (HAL_SD_Init(&hsd1) != HAL_OK) {
Error_Handler();
}
}
The write function (simplified):
int tfWriteBlock(uint32_t blockPosition, uint32_t numberOfBlocks, const uint8_t *buffer)
{
for (uint32_t i = 0; i < numberOfBlocks; i++) {
// Wait for card ready
while (HAL_SD_GetCardState(&hsd1) != HAL_SD_CARD_TRANSFER) {
osDelay(100);
}
// Write block
if (HAL_SD_WriteBlocks_DMA(&hsd1, buffer, blockPosition + i, 1) != HAL_OK) {
return ERR_FAIL;
}
// Wait for DMA completion
if (xSemaphoreTake(semTFWrite, 100) != pdTRUE) {
return ERR_TIMEOUT;
}
}
return ERR_SUCCESS;
}
DMA complete callback:
void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
{
xSemaphoreGiveFromISR(semTFWrite, NULL);
}
In my testing process, I call the write function every 100 milliseconds, and each time I write 2 blocks.
3. Reset flags after abnormal reboot
I checked reset source flags using __HAL_RCC_GET_FLAG(). The results were:
RCC_FLAG_CPURST = 1
RCC_FLAG_D1RST = 1
RCC_FLAG_D2RST = 1
RCC_FLAG_PORRST = 0
RCC_FLAG_BORRST = 0
RCC_FLAG_PINRST = 0
RCC_FLAG_SFTRST = 0
RCC_FLAG_IWDG1RST = 0
RCC_FLAG_WWDG1RST = 0
RCC_FLAG_LPWR1RST = 0
RCC_FLAG_LPWR2RST = 0
4. microSD card testing
I tested three microSD cards:
Sandisk SDSQUNC-032G-ZN3MN → CPU reset occurs
Kingston SDCS3/64GB → No reset observed
Kingston SDCS2/32GB → No reset observed
So the issue seems to be card-dependent, happening only with the Sandisk card.
5. Power rail observation
Using an oscilloscope, I checked the power rails:
3.8V and 3.3V → stable, no obvious ripple.
1.13V (Vcore) → shows a significant voltage dip during the reset(waveform attached).
Additionally, I noticed that the problem only occurs when the external connector — which normally distributes 3.8V to other boards — is left unconnected. When the connector is attached (and the system is powering another board), the issue does not appear. Here‘s the connector interface:
Question
Has anyone encountered a similar issue? Could this be related to Vcore stability, SDMMC peripheral behavior, or something in the power design? Any suggestions or experiences would be very helpful.
2025-08-30 10:03 AM - edited 2025-08-30 10:09 AM
Hi,
the problem is something in your hardware.
1. vcore from a smps - i would call it dangerous or at least: more problematic than using the internal LDO;
2. i use almost only Sandisk sd-cards, because they are the best/reliable , Kingston often "sick" after some time.
3. >the problem only occurs when the external connector .. is left unconnected. <
-> this obviously shows a problem, some imprecise connection , maybe ground loop , bad ground , etc.
Just strange is your "happening only with the Sandisk card" statement, because the card runs on 3v3 only;
so any internal resulting effect from different kind of cards could be afaik coming from different speed of card,
that card and sdmmc , that the two make up each other, so maybe going to higher speed needs little more current,
but this is only in the range of some mA .
I never seen a cpu core problem coming from a SD-card.
btw
My experience is from using H743 , H7A3, H733, H563 , with many different cards, 2GB...64GB, FAT and exFAT.