AnsweredAssumed Answered

Flash Signature Generation LPC43Sxx issues

Question asked by Javier Vallori on Jun 8, 2018
Latest reply on Jul 26, 2018 by jeremyzhou

Hi,

I'm trying to use the Flash Signature Generation on a LPC43Sxx, getting unsuccessful results. I get signatures values with singulars values, and does not changes with the flash values.

 

After an erase flash sector (using IAP functions), I checked in the memory tab of the debug perspective that the flash values of the corresponding flash_address and size change to 0xFFFFFFFF. Then I call the Signature Generation function becoming the following value:

 

         0 80000000 aaaaaaaa aaaaaaaa

 

Later I proceed to write differents values in the same sector (using IAP functions), checking again in the changes in the memory tab, and calling the Signature Generation function becoming the same value:

 

         0 80000000 aaaaaaaa aaaaaaaa

 

Sometimes, only when I run it in step by step in debug mode I get a diferent value, but just happens once, and can not repeat periodically.

 

I run the Signature Generation function in RAM2 out of the flash as the datasheet suggested and with the IRQ disabled.

The code I use is the following:


void hardSig(FLASH_SIG_Type * hard_sign) {

    ram_hardSig();

    hard_sign->word0 = Chip_FMC_GetSignature(SECTOR_BANK, 0);
    hard_sign->word1 = Chip_FMC_GetSignature(SECTOR_BANK, 1);
    hard_sign->word2 = Chip_FMC_GetSignature(SECTOR_BANK, 2);
    hard_sign->word3 = Chip_FMC_GetSignature(SECTOR_BANK, 3);

    DEBUGOUT("Hard_sign: %x ", hard_sign->word0);
    DEBUGOUT("%x ", hard_sign->word1);
    DEBUGOUT("%x ", hard_sign->word2);
    DEBUGOUT("%x\r\n", hard_sign->word3);
}

__RAMFUNC(RAM2) void ram_hardSig()  {

 

   /* Start signature address of the last sector*/
   #define START_ADDR_LAST_SECTOR                 0x1B070000
   #define START_AHB_ADDR_LAST_SECTOR               (START_ADDR_LAST_SECTOR & 0x001FFFF0)

 

   #define SECTOR_BANK            IAP_FLASH_BANK_B

 

   /* Size of each sector */
   #define SECTOR_SIZE                            65536

 

   /* LAST SECTOR */
   #define IAP_LAST_SECTOR                        14

 

   /* Number of bytes to be written to the last sector */
   #define IAP_NUM_BYTES_TO_WRITE                 512

 

    /* Start the signature generator for the last sector */
    //Chip_FMC_ComputeSignatureBlocks(SECTOR_BANK, START_ADDR_LAST_SECTOR, (SECTOR_SIZE / 16));
    Chip_FMC_ComputeSignature(SECTOR_BANK, START_AHB_ADDR_LAST_SECTOR, START_AHB_ADDR_LAST_SECTOR + IAP_NUM_BYTES_TO_WRITE);

 


    /* Check for signature geenration completion */
    while (Chip_FMC_IsSignatureBusy(SECTOR_BANK)) {}
    
}

 

 

One other strange data is that I can not read in the memory tab of the debug perspective the FMSW0/1/2/3 values of the Flash bank A (0x4000 C02C address) or B (0x4000 D02C address), but I can read on address of others modules like timers or uarts:

 

 

Besides, in the Peripheral tab of the debug perspective does not appear the FMC peripheral, but appears of the others peripherals:

 

 

It seems like this model hasn't this Flash Signature Generation Module. But that is very rarely. Has anyone any experience with this module in this MCU model? Any other suggestions?

 

Thank you.

Outcomes