This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP432P401R: How can i program the flash memory using both 2 sectors?

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello.

I'm trying to program the flash memory, but the data size is about 6KB,

So i have to use both 2 sectors(sector 30, 31) in flash main memory.

But it doesn't working....  the console said that "Out of Memory"

those are my code.

#define CALIBRATION_START1 0x0003E000

unsigned int AdjMatrix[ 40 ][ 40 ] = { ... }

int main(void)
{

    //![FlashCtl Program]
     /* Unprotecting Info Bank 0, Sector 0  */
     MAP_FlashCtl_unprotectSector(FLASH_MAIN_MEMORY_SPACE_BANK1,FLASH_SECTOR31);
     MAP_FlashCtl_unprotectSector(FLASH_MAIN_MEMORY_SPACE_BANK1,FLASH_SECTOR30);



     /* Trying to erase the sector. Within this function, the API will
         automatically try to erase the maximum number of tries. If it fails,
          trap in an infinite loop */
     if(!MAP_FlashCtl_eraseSector(CALIBRATION_START1))
         while(1);

     /* Trying to program the memory. Within this function, the API will
         automatically try to program the maximum number of tries. If it fails,
         trap inside an infinite loop */
     if(!MAP_FlashCtl_programMemory(AdjMatrix, (void*) CALIBRATION_START1, sizeof(AdjMatrix)))
                 while(1);


     unsigned int (*A_ptr)[40] = CALIBRATION_START1;

     /* Setting the sector back to protected  */
     MAP_FlashCtl_protectSector(FLASH_MAIN_MEMORY_SPACE_BANK1,FLASH_SECTOR31);
     MAP_FlashCtl_protectSector(FLASH_MAIN_MEMORY_SPACE_BANK1,FLASH_SECTOR30);

...
}

**Attention** This is a public forum