Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • L lpc43xx-hal
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Embedded Rust
  • lpc43xx-hal
  • Merge requests
  • !35

I²C Pin Ownership Fix

  • Review changes

  • Download
  • Patches
  • Plain diff
Open A Sundbom requested to merge i2c-fix into master Apr 03, 2020
  • Overview 0
  • Commits 2
  • Pipelines 1
  • Changes 4

During testing of a program with constrained memory there would be intermittent HardFaults during IAP calls with very few traces of what went wrong (note: the I²C peripheral/pins were not used). After a bit of tracing it became obvious that the pin abstraction actually creates a 12K large stack post to hold the abstraction, which would leave this program in particular with only 4K of memory and crash as the stack pointer would dip below mapped RAM.

To fix this, the abstraction has been rewritten to abstain from "actual" ownership of the SFSI2C0 member of pac::SCU and instead owns phantom data that represents the ownership. Furthermore the sfsi2c0 member should not be under an immutable borrow when sent to the I²C abstraction, as it most definitely is modified in the constructor.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i2c-fix