- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have custom hardware with a CY8C4247LQI and I've written a custom bootloader without using the Bootloader component.
I would like to write a bootloadable application without using the component.
How can I change the application start address in FLASH? I'd like to leave the first 8K for the bootloader.
Thanks in advance,
Paul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This should help, a section on this in ap note -
http://www.cypress.com/?rid=91945 AN89610 - PSoC® 4 and PSoC 5LP ARM Cortex Code Optimization
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dana,
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 */
__attribute__((naked))
static void Bootloader_LaunchBootloadable(uint32 appAddr)
{
__asm volatile(" BX R0\n");
}
Bootloader_LaunchBootloadable(0x2000);
Regards, Paul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Paul,
This seems to be feasible. Are you facing any issue in the project?
Thanks
Ramesh B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
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?
Thanks.