Skip to content

Conversation

hedger
Copy link
Member

@hedger hedger commented Sep 28, 2024

What's new

  • reduced reserved memory size for system stack
  • +3.5k free RAM for system heap
  • there's an existing MPU region protection for tail of system stack region - no additional checks required
  • fbt: relink elf file on linker script changes

Verification

  • run free in cli on dev and on this brach; compare total heap size
  • run interrupt-heavy tasks
  • try reducing stack size in linker script even further (<=0x100) and observe a HardFault with MMFSR->MSTKERR==1

unstacking for an exception return has caused one or more access violations.
This fault is chained to the handler which means that the original return stack is still present.
The processor has not adjusted the SP from the failing return, and has not performed a new
save. The processor has not written a fault address to the MMFAR. Potential reasons:
a) Stack pointer is corrupted
b) MPU region for the stack changed during execution of the exception handler.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

Copy link

github-actions bot commented Sep 28, 2024

Compiled f7 firmware for commit c4b91f17:

@hedger hedger marked this pull request as ready for review October 14, 2024 17:27
Copy link

PVS-Studio report for commit 80eda2bc:

@skotopes skotopes merged commit 57c438d into dev Oct 14, 2024
11 checks passed
@skotopes skotopes deleted the hedger/lesssysstack branch October 14, 2024 18:26
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.

2 participants