Encrypted external memory access
This article describes issues regarding encrypted external memory access by the means of on the fly decryption.
Functionality
Some devices have the capability to set the external memory to be encrypted.
This means that the data present in the external memory is encrypted.
In most cases the final data which is generated by compiler/linker is encrypted in an additional post build step.
This workflow may be different depending on vendor and device.
The decrypted program is only readable by the device itself.
Problems on usage
These encrypted data can cause the following issues, which have to be taken into account, when working with it.
Programming
- When programming the encrypted data the user has to ensure that programming and verify have to be done on the same way.
- J-Link flash loaders normally accesses external memory devices memory mapped for read and directly (via the external memory controller of the device) for write.
- If the device is setup correctly the memory mapped read access is facing the decrypted data, while directly accessed write reflects the encrypted data.
- This behavior will always result in a verify failure after programming.
Solution
This can be solved by a custom flash loader which is reading and writing the memory via the external memory controller of the device.
This will ensure that programmed data can be successfully verified after programming.
- Customers can create their own flash loader with the SEGGER J-Link DSK
- SEGGER can provide a custom flash loader.
If you are interested, please contact SEGGER sales.