2023-05-15 01:24 AM
So I have two STM32F11E Discovery boards and both have the same problem: When I create a project and choose this exact discovery board from the "Board Selector" so that the template software code is already loaded up and ready to compile, after succesful compilation when I run a simple blink LED programm the software doesn't reach the while loop in main because the clock setup configuration fails even though I have not changed anything except for two lines of code in the while loop which it doesn't even reach.
When I debbug the board it always fails when initiallizing the external 8MHz clock on this line of code SystemClock_Config(). When I look into this function it fails at this line: if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) and after looking into this function aswell the exact error source lies here:
/* Wait till HSE is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET)
{
if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT; // Here is where the timeout error occours
}
}
So the way I understand it is that it waits for the external clock until it's ready and for some reason it times out. I am pretty sure the purpose of these templates is that they work out of the box without any tinkering, however I already tried changing the settings in the Clock Configuration tool and everything seems fine there, no warnings, no issues nothing. Additionally I tried setting the wait time for the HSE higher so that any setup time issues can be ruled out. A hardware manufacturing problem is unlikely since I have the same board twice and both have the same issue. So before I set out to debug the whole clock configuration system of this board I would like to hear if anyone already knows of this problem and has a solution already.
2023-05-15 02:27 AM - edited 2023-11-20 05:29 AM
Which version of the board do you have? There should be a sticker or a silkscreened text with "MB1115" and the version.
Check, if the 8MHz crystal together with related capacitors and serial resistors/jumpers are connected on your board; and also if the connections to STLink's MCO and the pinheaders are disconnected:
JW
2023-05-15 03:55 AM
Thanks for the fast and thorough reply! I have the MB1115-F411VE-D01. The Oscillator as well as the resistors and capacitors of X2 are on the board and I have also checked that that resistors have the correct resistance (0Ohm and 220Ohm) though I haven't measured the capacitors yet but I just don't think it's likely that they would be wrong or fualty on both identical boards. The oscilloscope also shows no clock signal at all on this oscillator (X2), but on the other 8MHz oscillator for the ST-Link controller (X1) it has perfect 8MHz, but I still doubt that it's actually the oscillator that is faulty since both brand new boards have the same issue. I mean if the setup fails in software it makes sense that there is no clock signal coming from the oscillator. Regarding your suggestions: The connection to the MCO is disconnected meaning the jumpers SB14 and SB16 are both open and R66 and C67 are both not on the board.
2023-05-15 04:33 AM
Read out and check/post content of relevant RCC registers at that moment of timeout.
JW
2024-05-15 01:01 PM
I have exactly the same board with exactly the same board.