Hi @burhanhagi ,
Thank you for your updated information.
I use MCUXPresso IDE generate bootloader and app image separately, then I use JFlash tool to merge bootloader and app image into a hex file.
Please refer Jlink使用技巧之合并烧写文件 - whik - 博客园 (cnblogs.com).

I try to up load my bootloader and app project, but it was limited by exceeding the maximum file size, so I upload the whole project hex file.

hardware: MIMXRT1170-EVKB board
When the sw7 button is pressed the first four times, the LED will light up. When the sw7 button is pressed for the fifth time, the boot loader program will jump to the APP, and the LED light does not need to press the button to flash periodically.
I will show you bootloader critical code. It is just a demo, Please modify and strictly verify according to your needs.

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