-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add NVIC_DisableAll and Cortex_DisableAll functions #3318
Open
kasjer
wants to merge
9
commits into
apache:master
Choose a base branch
from
kasjer:kasjer/cortexm-cleanup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NVIC_Relocate, NVIC_SetVector, NVIC_GetVector prototypes were defined in a lot of places. Now they are put in one header. Signed-off-by: Jerzy Kasenberg <[email protected]>
New function NVIC_DisableAll() disables all interrupts on NVIC. Cortex_DisableAll() disables all interrupts and SysTick Those function are intended to be called from hal_bsp_deinit to disable interrupts before application code reconfigures them from what boot loader set up. Signed-off-by: Jerzy Kasenberg <[email protected]>
For CortexM devices add call to Cortex_DisableAll() that will disable all interrupts before control is passed from bootloader to application Signed-off-by: Jerzy Kasenberg <[email protected]>
Function NVIC_Relocate() was called in SystemInit() which is in file from Nordic. Now call is moved to mynewt specific function hal_system_init that is called just after SystemInit finishes. This is done to leave file from external source as close to origin as possible in case of future update. Signed-off-by: Jerzy Kasenberg <[email protected]>
After NVIC_Relocate() was moved to different header all hal_system_init needs additional include Some leftover code was also cleaned. Signed-off-by: Jerzy Kasenberg <[email protected]>
NVIC_Relocate call was placed in NXP generated file. Now it is moved to hal_system_init function that is way it's done in mynewt Startup code for usbmkw41z now calls hal_system_init as is the case for all mynewt platforms Signed-off-by: Jerzy Kasenberg <[email protected]>
This switches to autogenerated linker scripts for CortexM. Signed-off-by: Jerzy Kasenberg <[email protected]>
NVIC_Relocate call was placed in Ambiq generated file. Now it is moved to hal_system_init function that is way it's done in mynewt hal_bsp_deinit() disable NVIC interrupts as well. Signed-off-by: Jerzy Kasenberg <[email protected]>
NVIC_Relocate call was in two places Now it is only in hal_system_init function that is way it's done in mynewt Signed-off-by: Jerzy Kasenberg <[email protected]>
kasjer
force-pushed
the
kasjer/cortexm-cleanup
branch
from
October 4, 2024 12:37
1a45350
to
4ccc855
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Function
NVIC_DisableAll()
disable all interrupts on NVIC controller.Cortex_DisableAll()
disables all NVIC interrupts and stops SytTick that also can generate interrupt.Call to
Cortex_DisableAll()
is added to all hal_bsp_deinit() functions that are executed before control is passed from the bootloader ot the application.In some cases hal_bsp_deinit was added.
hal_system_init()
was added to platforms that did not have this function.Now
hal_system_init()
callsNVIC_Relocate()
(previously NVIC_Relocate was often called fromSystemInit()
that is usually provided by MCU manufacturer. So mynewt had copies of those files with local modifications that made it harder to maintain in case of upgrade.Same prototypes
were placed in many headers and now are put in just one.
NXP MK8xF now uses common startup code with auto-generated linker script like ST and Nordic chips.
Signed-off-by: Jerzy Kasenberg [email protected]