I have a couple question about the function readFlashDataPage().
When we use this function maybe is it necessary to specify an additional parameter for "xcc"?
Does this function take an address or page number?
I try build the flash loader as it shown within xTIMEComposer User Guide:
loader.c:
Code: Select all
extern void* readFlashDataPage(unsigned int addr);
int dpVersion;
unsigned imgAdr;
void init(void)
{
dpVersion = *(unsigned int *)readFlashDataPage(0);
imgAdr = 0;
}
int checkCandidateImageVersion(int v)
{
return (v == dpVersion);
}
void recordCandidateImage(int v, unsigned adr)
{
imgAdr = adr;
}
unsigned reportSelectedImage(void)
{
return imgAdr;
}
Code: Select all
xcc -c loader.c -o loader.o
Code: Select all
xflash --boot-partition-size 0x20000 --factory red_blink.xe --loader loader.o --upgrade 1 blue_blink.xe
then I read the flash, change the value at 0x20000 for "01 00 00 00" (I have tried as LSB and MSB) and write back this image to flash.
I expect that the second image (blue blink) should booting. But it didn't happen.
Any ideas?
PS
I use xTIMEComposer 14.1.0