Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-bootloader EFL/SPI fixes. #17661

Merged
merged 3 commits into from
Jul 13, 2022
Merged

Post-bootloader EFL/SPI fixes. #17661

merged 3 commits into from
Jul 13, 2022

Conversation

tzarc
Copy link
Member

@tzarc tzarc commented Jul 13, 2022

Description

EFL and SPI post-bootloader startup bugs, detected through assertions.

Under normal circumstances program code is mapped to 0x00000000 as well as 0x08000000.
Post-bootloader, only the latter address is correct, so EFL is swapped to using the other location.

Also noted after bootloader is that the flash is already unlocked -- re-unlocking causes a fault and necessitates a restart.
Added explicit invocation of backing_store_lock() during backing_store_init() to force it to be in the correct state.
Invoking it even when locked is fine.

Also noted with debugging enabled that spiUnselect() requires the peripheral to be in the stopped state - with assertions disabled this is ignored, but is obviously "wrong" as far as ChibiOS is concerned. Have removed the call.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@tzarc tzarc requested a review from a team July 13, 2022 12:50
@tzarc tzarc force-pushed the fixup-efl-bootseq branch from bc5c39c to 8e70943 Compare July 13, 2022 12:53
@tzarc tzarc merged commit dc70ba6 into qmk:develop Jul 13, 2022
@tzarc tzarc deleted the fixup-efl-bootseq branch July 13, 2022 14:41
nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
* Fixup read address for EFL driver.

* Fixup sequencing of SPI.

* Lock during init of EFL backing store.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants