Thank you for the link. By modifying the CY_APPL_ORIGIN definition in cm0gcc.ld and Cm0RealView.scat I am able to move the code to address 0x2000.
Is it safe to start the main program from the bootloader with the following code borrowed from bootloader.c?
__attribute__((noinline)) /* Workaround for GCC toolchain bug with inlining */
static void Bootloader_LaunchBootloadable(uint32 appAddr)
__asm volatile(" BX R0\n");
This seems to be feasible. Are you facing any issue in the project?
I took the generated cm0gcc.ld script, copied it to a different folder and renamed it. Changed the CY_APPL_ORIGIN value to 0x2000. Then referred to it in Build Settings -> Linker -> General -> Custom Linker Script.
After recompiling I opened the generated cm0gcc.ld file and the CY_APPL_ORIGIN in it is 0. Isn't it supposed to be 0x2000?