Skip to content

STM32: Fix HSE/HSI clk source detection #1062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2015

Conversation

giulianodianda
Copy link
Contributor

When using online compiler (Keil), SystemInit (and systick stuff) are called
before RW data is initialized, so static and global variables contains
garbage. AHBPrescTable was one of these, used to set a (messed up) systick timeout for HSE to get ready.If it gets ready, no problem, that's why nucleo boards using HSE go straight.
SystemCoreClock variable is affected too, but situation has been already fixed:

  • re-set value in Systeminit()
  • code jumps to Keil C runtime library which populates RW area, so seting SystemCoreClock variable to its initialized value (uint32_t SystemCoreClock = 16000000;)
  • redo hall init does update SytemCoreclock variable

I posted some more info here
http://developer.mbed.org/forum/bugs-suggestions/topic/5600/

Also ported the LSE longer timeout fix to other few platforms.

When using online compiler (Keil) SystemInit (and systick stuff) is call
before RW  data is initialized, so static and global variables contains
garbage. AHBPrescTable was one of these.
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 22, 2015

Thanks for the fixes.

@bcostm Please review, this fix might go up to your sources.

@bcostm
Copy link
Contributor

bcostm commented Apr 22, 2015

It's ok for me. I did the same thing in other Nucleo platforms and I thought it was done for all. Apparently not.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 23, 2015

Thanks @bcostm for review.

0xc0170 added a commit that referenced this pull request Apr 23, 2015
STM32 - Fix HSE/HSI clk source detection
@0xc0170 0xc0170 merged commit b73059c into ARMmbed:master Apr 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants