You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
i.MX RT: wolfBoot runs with the L1 caches off, image verification is about 20 s slower than it needs to be #990
The i.MX RT HAL (hal/imx_rt.c) does not enable the Cortex-M7 instruction and data caches. The boot ROM leaves both off, so wolfBoot hashes and verifies the image from memory-mapped flash without caches. With software SHA-384 and ECC-384 on a 2.5 MB image this dominates the boot time.
What we measured
Board with an i.MX RT1040 family part, XIP from a QSPI NOR flash, wolfBoot v2.8.0 built with TARGET=imx_rt, SIGN=ECC384, HASH=SHA384, the DCP not used for these algorithms, application image about 2.5 MB. Time from reset until the application answers on the network, three runs each on the same board and application:
wolfBoot build
reset to application answering
as in v2.8.0
27.9 s, 33.4 s, 35.7 s
caches enabled in wolfBoot
10.8 s, 16.5 s, 11.1 s
That is about 20 s less per boot. The application part of the boot is the same in both rows, the difference is the time spent in wolfBoot.
I read hal/imx_rt.c on master (254cfa5): hal_init() still does not enable the caches and hal_prepare_boot() is empty, so I expect the same on master, but I have only run v2.8.0.
What we changed locally
In hal_init(), after the clock setup, we enable the instruction cache and the data cache. In hal_prepare_boot() we disable both again, which also cleans the data cache and drops the instruction cache contents, so the application starts in the state the boot ROM would have left. The flash write and erase functions of the HAL already invalidate the data cache for the range they touch, and we did not have to change them.
With this change we have run swap updates, a rollback of an image that does not confirm itself, and normal boots on our board. We have not tried it with the DCP in use, with encrypted partitions, or on other i.MX RT parts. The example configurations pass DCP_USE_DCACHE=0, and I do not know whether that needs attention when the data cache is on.
Request
Could the i.MX RT HAL enable the L1 caches while wolfBoot runs and hand over to the application with them off, either always or behind a build option?
Activity