Skip to content

arch/arm/stm32*: Cleanup stm32 irq reporting#18606

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
pbarada:test/stm32_irq_debug
Mar 26, 2026
Merged

arch/arm/stm32*: Cleanup stm32 irq reporting#18606
xiaoxiang781216 merged 1 commit into
apache:masterfrom
pbarada:test/stm32_irq_debug

Conversation

@pbarada
Copy link
Copy Markdown
Contributor

@pbarada pbarada commented Mar 25, 2026

Cleanup stm32_irq.c

Summary

  • Marge naming STM32_IRQ_NEXTINT to STM32_IRQ_NEXTINTS across all stm32 variants
  • Rewrite stm32_dumpnvic to remove "Missing logic warning"; dynamically print NVIC interrupt enable/priority registers based on STM32_IRQ_NEXTINTS
  • Replace '%x' format specifier with PRIx32 where used to report register values since uint32_t on stm32 is actually long unsigned int
  • Simplify if/else chane in stm32_irqinfo() that determines irq regaddr/bit
  • There's no stm32_irq.info.c; remove mention from stm32f0l0g0/Make.defs

Impact

User experience: No adaptation required.
Build: No impact.
Hardware: Should not affect ARM-based boards.
Documentation: No impact.
Security: No impact.
Compatibility: No impact.

Testing

Build Host:

  • OS: Ubuntu 24.04.4 LTS
  • Compiler: arm-none-eabi-gcc 13.2.1

Target:

Architecture: ARM (STM32H7x3ZIx)
Board: Nucleo-h743zi2
Configuration: Default nucleo-h743zi2:nsh 

Architecture: ARM (STM32F767ZITx)
Board: Nucleo-f767zi
Configuration: Default nucleo-h767zi:nsh

Architecture: ARM (STM32F446RETx)
Board: Nucleo-f446re
Configuration: Default nucleo-f446re:nsh 

Note, for each configuration, following tweaks performed after configuration/before build to enable stm32_dumpnvic() and ram syslog to see its output on each board:

kconfig-tweak --file .config --enable DEBUG_FEATURES
kconfig-tweak --file .config --enable DEBUG_IRQ --enable DEBUG_IRQ_INFO
kconfig-tweak --file .config --enable ARCH_IRQPRIO
kconfig-tweak --file .config --set-val TASK_NAME_SIZE 16
kconfig-tweak --file .config --disable SYSLOG_DEFAULT
kconfig-tweak --file .config --enable RAMLOG
kconfig-tweak --file .config --disable SYSLOG_INTBUFFER
kconfig-tweak --file .config --enable SYSLOG_TIMESTAMP
kconfig-tweak --file .config --enable SYSLOG_PROCESS_NAME
kconfig-tweak --file .config --enable RAMLOG_SYSLOG
kconfig-tweak --file .config --set-val SYSLOG_DEVPATH /dev/kmsg
kconfig-tweak --file .config --set-val RAMLOG_BUFSIZE 10240
make olddefconfig

nucloeo-h743zi2:


NuttShell (NSH) NuttX-12.12.0
nsh> uname -a
NuttX 12.12.0 eea9d15b41-dirty Mar 25 2026 12:55:07 arm nucleo-h743zi2
nsh> dmesg
[    0.000000] Idle_Task: stm32_dumpnvic: NVIC (initial, irq=179):
[    0.000000] Idle_Task: stm32_dumpnvic:   INTCTRL:    00000000 VECTAB:  08000000
[    0.000000] Idle_Task: stm32_dumpnvic:   IRQ ENAB 0: 00000000 00000000 00000000 00000000
[    0.000000] Idle_Task: stm32_dumpnvic:          128: 00000000 00000000
[    0.000000] Idle_Task: stm32_dumpnvic:   SYSH_PRIO:  00808080 70000000 80800080
[    0.000000] Idle_Task: stm32_dumpnvic:   IRQ PRIO 0: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           16: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           32: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           48: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           64: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           80: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           96: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:          112: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:          128: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:          144: 80808080 00008080 00000000 00000000
[    0.000000] Idle_Task: stm32_dumpnvic:          160: 00000000
nsh>

nucleo-h767zi:

NuttShell (NSH) NuttX-12.12.0
nsh> uname -a
NuttX 12.12.0 eea9d15b41-dirty Mar 25 2026 13:56:40 arm nucleo-f767zi
nsh> dmesg
[    0.000000] Idle_Task: stm32_dumpnvic: NVIC (initial, irq=126):
[    0.000000] Idle_Task: stm32_dumpnvic:   INTCTRL:    00000000 VECTAB:  08000000
[    0.000000] Idle_Task: stm32_dumpnvic:   IRQ ENAB 0: 00000000 00000000 00000000 00000000
[    0.000000] Idle_Task: stm32_dumpnvic:   SYSH_PRIO:  00808080 70000000 80800080
[    0.000000] Idle_Task: stm32_dumpnvic:   IRQ PRIO 0: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           16: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           32: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           48: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           64: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           80: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           96: 80808080 80808080 80808080 00008080
nsh>

nucleo-f446re:

NuttShell (NSH) NuttX-12.12.0
nsh> uname -a
NuttX 12.12.0 eea9d15b41-dirty Mar 25 2026 13:59:05 arm nucleo-f446re
nsh> dmesg
[    0.000000] Idle_Task: stm32_dumpnvic: NVIC (initial, irq=113):
[    0.000000] Idle_Task: stm32_dumpnvic:   INTCTRL:    00000000 VECTAB:  08000000
[    0.000000] Idle_Task: stm32_dumpnvic:   IRQ ENAB 0: 00000000 00000000 00000000 00000000
[    0.000000] Idle_Task: stm32_dumpnvic:   SYSH_PRIO:  00808080 70000000 80800080
[    0.000000] Idle_Task: stm32_dumpnvic:   IRQ PRIO 0: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           16: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           32: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           48: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           64: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           80: 80808080 80808080 80808080 80808080
[    0.000000] Idle_Task: stm32_dumpnvic:           96: 00000080
nsh>

Using modified tools/testbuild.sh compile-tested across all stm32:nsh configurations

Rename STM32_IRQ_NEXTINT to STM32_IRQ_NEXTINTS across all stm32
variants.
In stm32_dumpnvic() dynamically print NVIC enable and priority
registers based on STM32_IRQ_NEXTINTS.
Use PRIx32 format specifier instead of 'x' (since uint32_t on arm is
actually a long unsigned int).
Simplify if/else chain in stm32_irqinfo() to determine irq reg/bit.
There's no stm32_irqinfo.c; remove mention in stm32f0l0g0/Make.defs.

Signed-off-by Peter Barada <peter.barada@gmail.com>
@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Size: L The size of the change in this PR is large labels Mar 25, 2026
@xiaoxiang781216 xiaoxiang781216 merged commit 870c963 into apache:master Mar 26, 2026
35 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants