Hi @radoslawp ,
Thanks for your reply.
I understand your needs, you want CM7 core as master, CM4 core as slave, both CM7 and CM4 are XIP .
Please refer SDK demo as following.
\SDK_2_16_000_MIMXRT1170-EVKB\boards\evkmimxrt1170\demo_apps\hello_world_secondary_core_boot\cm7
\SDK_2_16_000_MIMXRT1170-EVKB\boards\evkmimxrt1170\demo_apps\hello_world_secondary_core_boot\cm4
The following image is shared by RT expert Jay on his blog.

Wish it helps you.
If you still have question about it, please kindly let me know.
Best Regards
mayliu