2024-09-16 07:52 AM
After troubleshooting this issue , i found, that i have a greatly varying startup time.
I have this minimal code:
int main(void)
{
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOC_CLK_ENABLE();
GPIO_InitTypeDef my_GPIO_InitStruct = {0};
// TEST PIN
my_GPIO_InitStruct.Pin = GPIO_PIN_3;
my_GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
my_GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(GPIOC, &my_GPIO_InitStruct);
GPIOC->BSRR = (uint32_t) GPIO_PIN_3;
}
I know that some clock setting needs some time, but this? it varies from 100ms to 1600ms !
Could it be, that the chip is bad?
2024-09-16 07:59 AM - edited 2024-09-16 08:01 AM
You haven't shown what your clock setup is.
How are you measuring the startup time?
Does it make any difference if the startup is from a power cycle, or just a reset?
2024-09-16 11:09 AM
I removed my clock setup to create a minimal code. See the picture for the measurement. I do reset with a wavegen.
I also measured with power cycle: With powercycle it was very constant (2.143s).
But now that i switched back, i can not reproduce this issue anymore. Maybe i got the setup not back as it was with the issue? Or maybe a powercycle removed the issue.
It is not constant at about 200us.