-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Circuitpython nickzoic 1042 nrf nvm bytearray 2 #1768
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
Circuitpython nickzoic 1042 nrf nvm bytearray 2 #1768
Conversation
import microcontroller def dump(n = microcontroller.nvm): for i in range(0,len(n)): print ("%02X " % n[i], end="") if i % 16 == 15: print('') microcontroller.nvm[0:4096] = bytes([1,2,3,4,5,6,7,8]) * 512 microcontroller.nvm[4096:8192] = bytes([16,17,18,19]) * 1024 microcontroller.nvm[4090:4101] = b'thisisatest' microcontroller.nvm[100:105] = b'hello' microcontroller.nvm[8000:8007] = b'goodbye' dump()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments. Also BOARD=pca10059 doesn't build.
Also, could you make similar changes to the pca10056 build so it can use nvm? |
Yep, I've added in a catch this so that if CIRCUITPY_INTERNAL_NVM_SIZE isn't defined it defaults to zero. |
OK so I also modified your |
Closing in favor of #1779. Thanks for getting us going! |
nrf nvm: touchups to nickzoic PR #1768
Revert "nrf nvm: touchups to nickzoic PR #1768"
OK, so this is a new pull request at last for #1042, replacing #1610 which I've closed.
This version moves the code for flash access into
ports/nrf/peripherals/nrf/nvm.c
which is used by bothports/nrf/supervisor/internal_flash.c
and byports/nrf/common-hal/nvm/ByteArray.c
.The NVM store uses page(s) at the end of the FATFS page allocation, depending on the size of CIRCUITPY_INTERNAL_NVM_SIZE.