-
Notifications
You must be signed in to change notification settings - Fork 166
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
stm32xx: generate counters for EXTI IRQs #1698
Merged
Merged
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
Since the TOML configuration for EXTI IRQ dispatching in `stm32h7-sys` added in #1693 has a user-provided name for each pin's IRQ, we can generate a nice ringbuf entry (and corresponding entry counter) for each IRQ mapping. This seems nice to have for debugging purposes, so I've added it. When the ringbuf is enabled, `stm32xx-sys` now records a ringbuf entry and corresponding counter for each `gpio_irq_configure` and `gpio_irq_configure` IPC, and for each time an EXTI IRQ is dispatched. This may be useful for debugging cases where a task forgets to enable or disable its IRQ. When the `stm32xx-sys/no-ringbuf` feature flag is set, we skip the IPC events, and just count the number of times we've dispatched each IRQ --- this saves us some RAM while still recording the most interesting information. For example, here's me playing with the button on my Nucleo board: ```console $ cargo xtask humility app/demo-stm32h7-nucleo/app-h753.toml -- ringbuf drv_stm32xx_sys Finished dev [optimized + debuginfo] target(s) in 0.15s Running `target/debug/xtask humility app/demo-stm32h7-nucleo/app-h753.toml -- ringbuf drv_stm32xx_sys` humility: attached via ST-Link V3 humility: ring buffer drv_stm32xx_sys::__RINGBUF in sys: TOTAL VARIANT 3 GpioIrqEnable(button) 2 GpioIrq(button) 1 GpioIrqConfigure NDX LINE GEN COUNT PAYLOAD 0 685 1 1 GpioIrqConfigure { irq: button, rising: false, falling: true } 1 593 1 1 GpioIrqEnable(button) 2 806 1 1 GpioIrq(button) 3 593 1 1 GpioIrqEnable(button) 4 806 1 1 GpioIrq(button) 5 593 1 1 GpioIrqEnable(button) ```
9ab52fc
to
66d8f46
Compare
After a conversation with @cbiffle, I'm going to remove the ringbuf from this change and just generate event counters for IRQ triggers. This is for size reasons — the ringbuf code is pretty big, and it contains panics, and Cliff is currently trying to remove all panics from the sys task. |
Now, we only generate counters, and only if "exti" is enabled. The `sys` task for the STM32H7-Nucleo demo currently uses 2700B of flash and 1476B of RAM.
Okay, as of 2f46737, this PR is now just counters, not ringbuf. |
cbiffle
approved these changes
Apr 2, 2024
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.
Since the TOML configuration for EXTI IRQ dispatching in
stm32h7-sys
added in #1693 has a user-provided name for each pin's IRQ, we can
generate a nice ringbuf entry (and corresponding entry counter) for each
IRQ mapping. This seems nice to have for debugging purposes, so I've
added it.
When the ringbuf is enabled,
stm32xx-sys
now records a ringbuf entryand corresponding counter for each
gpio_irq_configure
andgpio_irq_configure
IPC, and for each time an EXTI IRQ is dispatched.This may be useful for debugging cases where a task forgets to enable or
disable its IRQ. When the
stm32xx-sys/no-ringbuf
feature flag is set,we skip the IPC events, and just count the number of times we've
dispatched each IRQ --- this saves us some RAM while still recording the
most interesting information.
For example, here's me playing with the button on my Nucleo board: