-
Notifications
You must be signed in to change notification settings - Fork 3k
[TARGET_STMF0] Fix #1419 baudrateissue #1432
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
Conversation
…_FIX_1419_baudrateissue
Issue was : stdio printf is ok, serial.printf is failing, in case it is inialized as a global variable. It works on mbed version 107. Fix: revert to version 107 for systemxxx.c, mbed_overrides.c + cmsis_nvic.c. Modify cmsis_nvic.c to use direct addressing instead of a pointer (this pointer is not yet initialized when called in systemxx.c) Call HAL_Init in mbed_overrides.c for every platforms.
…_FIX_1419_baudrateissue
There's a failure, see https://travis-ci.org/mbedmicro/mbed/builds/91585087 Please separate pull request to a feature-complete set in future. For instance, this is about fixing a baudrate, but there is vtor change, and others. Edit: Looking at the code, and the commit message. I see that its a bugfix. It was not that much clear at first sight :) |
Hi, Let me try to explain better. I then moved the HAL_Init and SetSysClk functions in mbed_sdk_init() function, when global variables are already initialized. This is the reason why I came back to the previous implementation of Systemxx.c + mbed_override.c. The modification of NVIC_SetVector is a new bug fix for the not-yet-itilialized *vector pointer. |
} | ||
SYSCFG->CFGR1 |= 0x03; // Embedded SRAM mapped at 0x00000000 | ||
vtor_remap = 1; // The vectors remap is done | ||
if (NVIC_vtor_remap == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this global variable, why not to use CFGR1 check if it's MEM_MODE? which is set right below?
I'm looking over these PRs. |
Bump, any progress for this PR? |
Hi,
I think we should not use _start call any more because _mainCRTStartup funciton, It is better that we explicitly write the initialization codes being equivalent to _mainCRTStartup except for the codes cleaning .bss region. I'm more investigating, coding and checking now, This is _mainCRTStartup function generated after linking by the linker.
This is _mainCRTStartup before linking by the linker. (equal to crt0.o)
dinau |
What's the status with this PR? |
Hello @0xc0170, happy new year :) |
[TARGET_STMF0] Fix #1419 baudrateissue
Issue was: stdio printf is ok, serial.printf is failing in case it is initialized as a global variable. But it works on mbed version 107.
Fix: revert to version 107 for systemxx.c, mbed_overrides.c + cmsis_nvic.c
Modify cmsis_nvic.c to use direct addressing instead of a pointer (this pointer is not yet initialized when called from systemxx.c, thus can crash the platform).
Call HAL_Init in mbed_overrides.c for every platforms.