Flash signature does not change after flash erase or write

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flash signature does not change after flash erase or write

1,196 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by remcopoelstra on Mon Dec 08 03:30:10 MST 2014
HI,

I'm testing the flash signature generator on the LPC812.
I've written the following simple app:
int main(void) {
uint32_t signature1,signature2;
char buffer[1024];
int i;
uint8_t Result;

SystemCoreClockUpdate();

for (i=0;i<1024;i++)
buffer=i;

Chip_FMC_ComputeSignature(0x3c00,0x3fff);
while (Chip_FMC_IsSignatureBusy());
signature1=Chip_FMC_GetSignature(0);

Result=Chip_IAP_PreSectorForReadWrite(15,15);
Result=Chip_IAP_EraseSector(15,15);

Chip_FMC_ComputeSignature(0x3c00,0x3fff);
while (Chip_FMC_IsSignatureBusy());
signature1=Chip_FMC_GetSignature(0);

Result=Chip_IAP_PreSectorForReadWrite(15,15);
Result=Chip_IAP_CopyRamToFlash(15*1024,buffer,1024);

Chip_FMC_ComputeSignature(0x3c00,0x3fff);
while (Chip_FMC_IsSignatureBusy());
signature2=Chip_FMC_GetSignature(0);

    return 0 ;
}


The memory browser shows that the flash contents are updated as expected, but the signature is always the same. Did I do something wrong?

Regards.

Remco Poelstra


Labels (1)
0 Kudos
Reply
6 Replies

1,051 Views
stype
Contributor II

Check out this thread, possibly this was the problem: LPC4337 IAP erase flash hang 

In one version of LpcOpen, LPC_FMC is being declared as a pointer to a pointer but it is not. It is a pointer to a struct.

 #define LPC_FMC ((LPC_FMC_T * *) LPC_FMCA_BASE)  

Let me know if this has helped, as I was facing some similar issues.

0 Kudos
Reply

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by remcopoelstra on Thu Feb 19 06:19:54 MST 2015
Hi,

I provide address 0x3c00 to 0x3FFF, which should correspond with sector 15 (the one I erase and write in the sample code).
The Chip_FMC_ComputeSignature() function does a >> by 4, to align to 32-bit boundaries. I believe that's all correct.

Regards,

Remco Poelstra
0 Kudos
Reply

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by schisanoa on Wed Feb 18 06:29:44 MST 2015
Are you sure to pass the correct address to the function that calculate the signature?
0 Kudos
Reply

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by remcopoelstra on Wed Feb 18 05:08:10 MST 2015
Hi,

Thanks for your reply.
I'm referring to the signature as calculated by the flash memory controller (FMSW0 register). I want to use it in a secondary bootloader to verify the user application.

Regards,

Remco Poelstra
0 Kudos
Reply

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Feb 18 04:20:50 MST 2015
What 'signature' are you talking about? The checksum at address 0x1c is not a signature it is a simple checksum of the first few words in the vector table. See
http://www.lpcware.com/content/faq/lpcxpresso/image-checksums
0 Kudos
Reply

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by remcopoelstra on Wed Feb 18 04:11:49 MST 2015
I've tried the same code on a LPC824 and it gives the same results, i.e. three times the same signature, while the flash has changed considerably.
Any help would be highly appreciated.

Kind regards,

Remco Poelstra
0 Kudos
Reply