Sistick has wrong period
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-01-07 4:53 AM
In HAL_Init(); generated by STMCubeMX
/* Compute TIM1 clock */
uwTimclock = 2*HAL_RCC_GetPCLK2Freq();
is set to 32000000 instead of 216000000
/* Compute the prescaler value to have TIM1 counter clock equal to 1MHz */
uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000) - 1);
prescaler is wrong, 31 instead of 215
What is wrong ?
- Labels:
-
RCC
-
STM32CubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-01-07 6:31 AM
Suggests the system believes it is running at 16 MHz (HSi), and your multiplying that by two when the APB clock is in DIV1 mode.​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-01-07 7:23 AM
Print out SystemCoreClock etc.
Most likely if HSE doesn't start, then neither will the PLL, and it will stay running for HSI which starts the part, all AHB/APB will be at DIV1
Route internal clocks to PA8/MCO and scope
Up vote any posts that you find helpful, it shows what's working..
