Skip to content
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

kernel/os: Add default irq callback #3100

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Conversation

wes3
Copy link

@wes3 wes3 commented Nov 3, 2023

Added a MYNEWT_VAL named OS_DEFAULT_IRQ_CB which, when enabled, will call a user-defined callback as the first function called in os_default_irq(). This will allow users to define custom functionality when a default irq occurs.

Added a MYNEWT_VAL named OS_DEFAULT_IRQ_CB which, when enabled,
will call a user-defined callback as the first function called
in os_default_irq(). This will allow users to define custom
functionality when a default irq occurs.
@wes3
Copy link
Author

wes3 commented Nov 3, 2023

@benmccrea @andrzej-kaczmarek BTW: I should mention that this PR came about due to the hal_watchdog_tickle() issue for dialog mcu's wiping out the reset reason. I did not want to mess with the os_coredump_cb as was mentioned in that other PR which was closed. I wanted this to be called as the first function in os_default_irq() and be independent of the other MYNEWT_VALs. I only added this to os_fault.c in cm33 as I wanted to see what others thought about this and if desired we can add it to the other os_fault.c modules.

Copy link
Contributor

@vrahane vrahane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrzej-kaczmarek
Copy link
Contributor

I'm not a big fan of this, but I won't oppose it since I don't have any better idea ;)

@wes3
Copy link
Author

wes3 commented Nov 9, 2023

@andrzej-kaczmarek Honestly, I am not the biggest fan of this myself but I was having a hard time thinking of a better way to do this. The only other thought that came to mind was to replace the NMI irq for dialog mcu's. Currently, os_arch_arm.c installs the default irq by doing a NVIC_SetVector. I would need to look at the order at which things are done but maybe this could be done after os_arch_os_init() is called in some dialog specific code. That is my only other thought.

@wes3 wes3 merged commit e5692a7 into apache:master Nov 28, 2023
15 checks passed
@wes3 wes3 deleted the os_default_irq_cb branch May 23, 2024 18:44
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.

4 participants