Fix HAL not properly initialized on F105x series #1310
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the necessary initialization procedures which should be run before user code is called.
premain()
function in main.cpp is essential for the HAL library to initize properly, more specifically it calledHAL_Init
which setup the systick interrupt handler which is necessary for writing a hello world.....The issue #869 has already mentioned this bug but didn't find a solution to it. After some trials and errors and comparasion between assemblies for different products, the patch here is likely solving it.
If possible, is there's any chance we talk about this a bit further because I don't know why this workaround works in fact...
Validation
Demostration:
Detail step-by-step is To-Be-Filled. The following code is a modified blinking LED use loop based
manual_delay()
and HAL provideddelay()
altogether. The originaldelay()
would stuck if HAL_Init is not called beforehand, the same as described in #869.Code formatting
Closing issues
Fixes #869