Updates the NVM peripheral to use the clock::v2
API
#931
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
As part of the
clock::v2
effort tracked in Issue #912, this PR updates thenvm
to use theclock::v2
API by requiring ownership of itsAhbClk
s andApbClk
. Note that this peripheral is only onthumbv7
targets.The NVM has three AHB bus clocks:
CLK_NVMCTRL_AHB
,CLK_NVMCTRL_CACHE
, andCLK_NVMCTRL_SMEEPROM
. It seems thatCLK_NVMCTRL_AHB
is needed for basic operation, but the documentation does not talk about exactly whatCLK_NVMCTRL_CACHE
andCLK_NVMCTRL_SMEEPROM
are needed for at all. As the thenvm::Nvm
does not seem to do anything with the cache at all, it was assumed thatAhbClk<NvmCtrlCache>
is not needed. However, it is assumed thatAhbClk<NvmCtrlSmeeProm>
is needed for SmartEEPROM functionality, and so this is now required when callingnvm::Nvm::smart_eeprom
, and the clock can be freed withnvm::smart_eeprom::SmartEeprom::free
.Note that automatic wait states are enabled when
clock::v2::clock_system_at_reset
is called so that the notes here about wait states should not be an issue.The following Tier 1 BSP examples are now broken and cannot be fixed until the noted peripherals are also migrated and merged (see the notes about this in Issue #912):
feather_m4/nvm_dsu
(dsu::Dsu
,usb::UsbBus
)feather_m4/smart_eeprom
(usb::UsbBus
)Checklist
#[allow]
certain lints where reasonable, but ideally justify those with a short comment.