Is there someone to answer at this question: is it possible to write a bootloader in flash without datas coming from other areas.
Here I defined
Code: Select all
#define BOOTLOADER_START_ADDR 0x00C0
#define START_PROGRAM_ADDR1 0x0500
#define ROM_SPACE_SECTION __attribute__((section("ROM_PROG1")))
#pragma makesection(ROM_PROG1, 0x700, 2048, CODE)
Code: Select all
void Program1() org START_PROGRAM_ADDR1
{
char Str1[10];
strcpy(Str1,"BBBB");
while(1)
{
delay_ms(250);
}
}
ROM_SPACE_SECTION void Program2()
{
char Str1[10];
strcpy(Str1,"DDDD");
while(1)
{
delay_ms(250);
}
}
But the problem is that "BBB" and "DDD" are in bootloader area , this will be unusable to update prog1 area without modifing bootloader.
Please tell me if you have a solution or not
Bootloader:
Code: Select all
void main() org BOOTLOADER_START_ADDR
{
char Str1[10];
strcpy(Str1,"AAAA");
Program1();
Program2();
}