Skip to content

minor refactors in various drivers#6494

Open
TychoVrahe wants to merge 5 commits intomainfrom
tychovrahe/u3/prep/misc
Open

minor refactors in various drivers#6494
TychoVrahe wants to merge 5 commits intomainfrom
tychovrahe/u3/prep/misc

Conversation

@TychoVrahe
Copy link
Contributor

@TychoVrahe TychoVrahe commented Feb 20, 2026

This small PR does some preparation to ease adding support for new MCUs.

@TychoVrahe TychoVrahe self-assigned this Feb 20, 2026
@github-project-automation github-project-automation bot moved this to 🔎 Needs review in Firmware Feb 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d587fc1 and a5f39ed.

📒 Files selected for processing (8)
  • core/SConscript.firmware
  • core/embed/sec/secure_aes/stm32u5/secure_aes.c
  • core/embed/sec/secure_aes/stm32u5/secure_aes_unpriv.c
  • core/embed/sec/storage/stm32u5/storage_salt.c
  • core/embed/sec/tamper/stm32u5/tamper.c
  • core/embed/sys/bsp/inc/trezor_bsp.h
  • core/embed/sys/cpuid/stm32/cpuid.c
  • core/embed/sys/startup/stm32/bootutils.c
💤 Files with no reviewable changes (3)
  • core/embed/sec/secure_aes/stm32u5/secure_aes_unpriv.c
  • core/embed/sys/cpuid/stm32/cpuid.c
  • core/embed/sec/secure_aes/stm32u5/secure_aes.c

Walkthrough

This pull request consolidates hardware abstraction layer header dependencies by centralizing STM32 utility header includes into a shared BSP header (trezor_bsp.h) and removing direct includes from individual source files. The changes also include minor control flow adjustments for power clock initialization and RSOD handling in startup code, plus updates to firmware build configuration for MCU handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes span eight files across build scripts, HAL dependencies, and startup logic. While individual modifications are straightforward (header removals, conditional logic inversions), verifying correctness requires examining the centralization pattern across multiple locations and confirming that relocated headers remain accessible through transitive includes. The build configuration changes and conditional logic inversions demand careful cross-referencing to ensure no compilation or runtime breakage occurs.

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive terms like 'minor refactors' and 'various drivers' that don't convey specific meaningful information about the changeset. Consider a more specific title that highlights the primary refactoring goal, such as 'Consolidate platform-specific includes into BSP' or 'Refactor MCU-specific build logic for easier MCU support'.
Description check ❓ Inconclusive The PR description is too brief and vague, providing only a single sentence about 'preparation to ease adding support for new MCUs' without explaining specific changes or reasons. Expand the description to explain which MCUs are being prepared for, what specific refactoring patterns are being applied, and why these changes ease MCU support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tychovrahe/u3/prep/misc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

en main(all)

model device_test click_test persistence_test
T2T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all) test(all) main(all)

Latest CI run: 22220268016

@TychoVrahe TychoVrahe force-pushed the tychovrahe/u3/prep/misc branch from dfaf445 to a5f39ed Compare February 20, 2026 10:20
@TychoVrahe TychoVrahe marked this pull request as ready for review February 25, 2026 09:47
@TychoVrahe TychoVrahe requested a review from obrusvit as a code owner February 25, 2026 09:47
@TychoVrahe TychoVrahe removed the request for review from obrusvit February 25, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 Needs review

Development

Successfully merging this pull request may close these issues.

1 participant