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

nRF52840-DK's Board Configuration Leaves 63.5Mb of storage unavailable #3098

Closed
TheConner opened this issue Jul 20, 2022 · 1 comment
Closed

Comments

@TheConner
Copy link
Contributor

TheConner commented Jul 20, 2022

The nRF52840-DK's storage is configured here, partitioning out 0-0x60000 (384 Kb) for the kernel space storage region, and then 0x60000-0x80000 (128 Kb) for userspace storage region. Using the nonvolatile storage test application on the nRF52840-DK, I see only 128 Kb for userspace which is expected under this configuration.

This amount of storage makes sense if Tock was only using the nRF52840's flash storage (1MB total, iirc); however, the nRF52840-DK has 64Mb of external storage on a MX25R6435F SPI/QSPI flash chip. It seems that the NonvolatileStorageComponent for the nRF52840-DK is configured to use the external flash chip, so it should define a larger userspace flash region (or both userspace and kernel space) to enable access to the other 63.5 Mb of flash storage.

My suggestion is to increase the flash regions as follows, to fill all 64Mb of external flash (will follow up with a PR for this)

Kernel: 0-0x60000 (384 Kb, the same amount)
Userspace: 0x60000-0x4000000 (63.625 Mb, fill the rest of available flash)

TheConner added a commit to TheConner/tock that referenced this issue Jul 20, 2022
Increase the userspace storage of the nRF52840-DK to use all of the available external flash on the board. New flash regions are as follows:

Kernel: 0-0x60000 (384 Kb)
Userspace: 0x60000-0x4000000 (63.625 Mb)
For a total of 64Mb.
bors bot added a commit that referenced this issue Jul 21, 2022
3096: Trim zero-length symbol aliases in print_tock_memory_usage r=bradjc a=phil-levis

Some versions of LLVM insert lots of $t and $d symbols; these confuse print_tock_memory_usage's calculation of symbol sizes. This change filters which symbols are considered by only looking at .text symbols that are F (function) or O (object), trimming zero-length symbol aliases.

### Pull Request Overview

This pull request changes print_tock_memory_usage to trim symbols which confuse its size calculations.


### Testing Strategy

This pull request was tested by running the tool under MacOS.


### TODO or Help Wanted




### Documentation Updated

- [x] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [x] Ran `make prepush`.


3099: Enable all storage on nRF52840-DK #3098 r=bradjc a=TheConner

### Pull Request Overview

This PR increases the userspace storage of the nRF52840-DK (re #3098) to use all of the available external flash on the board. New flash regions are as follows:

Kernel: 0-0x60000 (384 Kb)
Userspace: 0x60000-0x4000000 (63.625 Mb)
For a total of 64Mb.

### Testing Strategy

I built and installed the kernel on my nRF52740-DK, and used the  [nonvolatile storage test application](https://github.com/tock/libtock-c/tree/master/examples/tests/nonvolatile_storage) to see how much storage is reported. All tests suceeded, and the correct amount of storage (66715648 bytes, 63.625Mb) is reported.


### TODO or Help Wanted

Regarding testing, ideally there would be a test application to ensure all the flash is functioning correctly, instead of only 512 bytes. 

### Documentation Updated

- [x] N/A

### Formatting

- [x] Ran `make prepush`.


Co-authored-by: Philip Levis <pal@cs.stanford.edu>
Co-authored-by: Conner Bradley <bradley@advtech.ca>
@hudson-ayers
Copy link
Contributor

Fixed by #3099 . Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants