Hi,As you said i tried to blink and LED in iap_write_page() function of bootloader section from application.
For this I called appWritePage() from application(the control in turn goes to iap_write page()). Also added the led blinking code in iap_write_page() function. In linker script of bootloader I have
MEMORY
{
text (rx) : ORIGIN = 0x0003f800, LENGTH = 256K-2K
boot (rx) : ORIGIN = 0x0003fffc, LENGTH = 2K
data (rw!x) : ORIGIN = 0x00800190, LENGTH = 32K-500
}
Also In script the boot section is like this
.boot :
{
*(.boot.switch)
*(.boot.write_page)
KEEP(*(.boot.*))
} > boot
When I used ALIGN(256) it showed error that the address not fit in range.
In bootloader.c I defined
__attribute__((section(".boot.write_page"))) void (*iap_write_page)(uint32_t, uint16_t *) = iap_write_page_handler;
__attribute__((section(".boot.switch"))) void (*iap_switch)(void) = iap_switch_handler;
Also in created led.h file I have defined
#define STARTING_ADDRESS (SYS_DEVICE_SIZE / 2)
#define IAP_SWITCH_HANDLER (SYS_DEVICE_SIZE - 4)
#define IAP_WRITE_PAGE_HANDLER (SYS_DEVICE_SIZE - 2)
here SYS_DEVICE_SIZE =262144 .So IAP_SWITCH_HANDLER points to 3fffc.I added LED blinking code in both iap_write_page_handler and iap_switch_handler.but nothing worked.
please clarify me the following
1) Do I need same linker script in application(tried with one but no use)
2)Do I need to specify
.boot :
{
. = ALIGN(256);
*(.boot.switch)
. = ALIGN(256);
*(.boot.write_page)
KEEP(*(.boot.*))
} > boot
If so i have to adjust iap address..Kindly suggest a solution