We are currently working on a project using the Nordic nRF5340 and nRF7002 DK, which includes 1MB of internal flash and 2MB of external SPI flash. Our application codebase has grown substantially and is now utilizing approximately 900KB of the internal flash, leaving limited space for adding new features.
To address this constraint, we are exploring the feasibility of moving selected read-only data or less frequently used code sections to the external flash at runtime.
Project Setup:
External Flash Interface: SPI (non-memory-mapped)
SDK Version: nRF Connect SDK v2.6.4
Our Questions:
1. Is it possible to store certain parts of the code or read-only data in SPI-connected external flash while keeping the main application executing from internal flash?
2. What is the recommended approach to structure this setup, given that the external flash is not memory-mapped?
3. Is it necessary to load the contents from external flash into RAM before they can be executed?
4. Are there any example projects or documentation that demonstrate best practices for accessing code/data modules stored in SPI flash at runtime?
Our Goals:
1. Optimize Internal Flash Usage: Free up internal flash by relocating infrequently used code or read-only data to external flash.
2. Maintain Performance: Ensure critical code continues to run from internal flash or RAM for optimal performance.
We would appreciate it if you could share any relevant documentation, examples, or best practices for achieving this configuration using the nRF Connect SDK.