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

flash: should write_protection be emulated? #15729

Closed
nvlsianpu opened this issue Apr 29, 2019 · 1 comment · Fixed by #17498
Closed

flash: should write_protection be emulated? #15729

nvlsianpu opened this issue Apr 29, 2019 · 1 comment · Fixed by #17498
Labels
area: Documentation area: Flash Enhancement Changes/Updates/Additions to existing features

Comments

@nvlsianpu
Copy link
Collaborator

nvlsianpu commented Apr 29, 2019

According to https://docs.zephyrproject.org/latest/reference/peripherals/flash.html#_CPPv326flash_write_protection_setP6deviceb
write protection might behave different depending on which flash driver is used. Is this possible to relax it completely - so make this API no-operation for a driver. Then this driver would take care on its-own regard its internal protection.

I'm asking because for nRF flash driver write protection is completely emulated already - which will be not necessary if can relax it.

Objective is to clarify the documentation on the driver - not to remove flash protection API. It is clear that for portable code this API is required and have to be used everywhere,

@nvlsianpu nvlsianpu added Enhancement Changes/Updates/Additions to existing features question area: Flash area: Documentation labels Apr 29, 2019
@carlescufi carlescufi changed the title drivers: flash: should write_protection be emulated? flash: should write_protection be emulated? May 28, 2019
@nvlsianpu nvlsianpu assigned nvlsianpu and unassigned nvlsianpu May 28, 2019
@carlescufi
Copy link
Member

carlescufi commented Jun 4, 2019

Proposal:

  • Modify the doc to reflect that this is a NOP on platforms that do not have hardware write protection
  • Document that calls to flash_write() outside of a protect(enable) protect(disable) pair are undefined
  • Return 0 on those platforms that either do not have hardware write protection or it doesn't fit the API

nvlsianpu added a commit to nvlsianpu/zephyr that referenced this issue Dec 4, 2019
On some targets hardware (or middelware) doesn't allow
implement functionality flash protection API -
so fare it have to be emulated by software on such a target.

This patch changes documentation of this API, so on such a targets
API might implements no-operation.

fixes zephyrproject-rtos#15729

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
nashif pushed a commit that referenced this issue Dec 15, 2019
On some targets hardware (or middelware) doesn't allow
implement functionality flash protection API -
so fare it have to be emulated by software on such a target.

This patch changes documentation of this API, so on such a targets
API might implements no-operation.

fixes #15729

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Documentation area: Flash Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants