Repository navigation
Keep afatfs_poll out of scheduler() to free F7 ITCM_RAM - #12169
sensei-hacker merged 1 commit into
Conversation
…-card code LTO inlines afatfs_poll() into scheduler() through taskRunRealtimeCallbacks(). scheduler() is FAST_CODE, so the SD-card state machine was linked into ITCM_RAM although it only runs on the idle path and waits on a much slower card. Marking afatfs_poll() NOINLINE keeps it in flash behind a single call. The macro expands to nothing on targets without ITCM_RAM, so only F7 and H7 change. ITCM_RAM use drops by 944 B on KAKUTEF7 (16232 to 15288) and 928 B on MATEKF722SE (12360 to 11432); flash is about 80 B smaller on both.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can move or hide resolved findings to focus on what still needs action |
PR Summary by QodoKeep SD-card polling out of scheduler ITCM on F7 and H7
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
RAM / Flash usage vs. base commit
See RAM/flash optimization guide for techniques to reduce usage. |
|
Test firmware build ready — commit Download firmware for PR #12169 251 targets built. Find your board's
|
Summary
On F7 targets,
scheduler()isFAST_CODE, and LTO inlinesafatfs_poll()into it throughtaskRunRealtimeCallbacks(). The SD-card state machine therefore takes ITCM_RAM although it only runs on the idle path and waits on a card that is far slower than the code.Design
afatfs_poll()is markedNOINLINE, so it stays in flash behind one call fromscheduler().NOINLINEexpands to nothing on targets without ITCM_RAM, so only F7 and H7 change. Behaviour is unchanged; this only affects code placement.This matters now because KAKUTEF7 has about 150 B of ITCM_RAM left, and data-ready reads on F7 (#12065) add about 190 B to the
FAST_CODEfunctions and overflow it by 40 B.Testing
Built with stock linker scripts, compared with the parent commit:
MATEKF405, MATEKH743 and SITL also build. The firmware unit tests pass (620/620).
Not tested: SD-card logging on hardware, in SITL or otherwise. The change does not alter control flow, but nobody has run the SD path with it.
Code review
Reviewed with the inav-code-review agent: no critical or important findings.