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.

MSPM0G1505: FLASH MEMORY ALLOCATION

Part Number: MSPM0G1505

Want to store something in the flash. How to identify the location where to store?

This is the memory allocation. Is it fine if I store my data at location 0x3000. I have checked it it is empty.

Is there any automated way to find where to store the data, rather than me physically looking at the address?

EDIT 1: 

this is how I am writing to the flash:

void flash_write()
{
    // write the variables pass,ctp,cts,op1,op2 to respective flash locations
    DL_FlashCTL_unprotectSector( FLASHCTL, MAIN_BASE_ADDRESS, DL_FLASHCTL_REGION_SELECT_MAIN);/* Unprotect sector in main memory with ECC generated by hardware */
    gCmdStatus = DL_FlashCTL_eraseMemoryFromRAM( FLASHCTL, MAIN_BASE_ADDRESS, DL_FLASHCTL_COMMAND_SIZE_SECTOR);/* Erase sector in main memory */

    if (gCmdStatus == DL_FLASHCTL_COMMAND_STATUS_FAILED)
    {
        /* If command was not successful, set error flag */
        gErrorType = ERROR_ERASE;
    }
//----------------------------------------------------------------------------------------------------------------------------------------
    if (gErrorType == NO_ERROR) //cts   0x3000
    {
        /* 32-bit write to flash in main memory with ECC generated by hardware */
        DL_FlashCTL_unprotectSector(FLASHCTL, MAIN_BASE_ADDRESS, DL_FLASHCTL_REGION_SELECT_MAIN);
        gCmdStatus = DL_FlashCTL_programMemoryFromRAM32WithECCGenerated(FLASHCTL, (0x3000), &ctp);
       
        if (gCmdStatus == DL_FLASHCTL_COMMAND_STATUS_FAILED)
        {
            /* If command was not successful, set error flag */
            gErrorType = ERROR_32BIT_W;
        }
    }

    if (gErrorType == NO_ERROR) //ctp  0x3008
    {
        /* 8-bit write to flash in main memory */
        DL_FlashCTL_unprotectSector(FLASHCTL, MAIN_BASE_ADDRESS, DL_FLASHCTL_REGION_SELECT_MAIN);
        gCmdStatus = DL_FlashCTL_programMemoryFromRAM8WithECCGenerated( FLASHCTL, 0x3008, &cts);
       
        if (gCmdStatus == DL_FLASHCTL_COMMAND_STATUS_FAILED)
        {
            /* If command was not successful, set error flag */
            gErrorType = ERROR_8BIT_W;
        }
    }
    if (gErrorType == NO_ERROR) //pass   0x3010
    {
        /*
        * 16-bit write to flash in main memory with ECC generated by hardware.
        * The target program address must be a flash word address
        * (8-byte aligned), so we increase the address in increments of 8.
        */
        DL_FlashCTL_unprotectSector(FLASHCTL, MAIN_BASE_ADDRESS, DL_FLASHCTL_REGION_SELECT_MAIN);
        gCmdStatus = DL_FlashCTL_programMemoryFromRAM16WithECCGenerated(FLASHCTL, (0x3010), &pass);
       
        if (gCmdStatus == DL_FLASHCTL_COMMAND_STATUS_FAILED)
        {
            /* If command was not successful, set error flag */
            gErrorType = ERROR_16BIT_W;
        }
    }
    if (gErrorType == NO_ERROR) //op1  0x3018
    {
        /* 8-bit write to flash in main memory */
        DL_FlashCTL_unprotectSector(FLASHCTL, MAIN_BASE_ADDRESS, DL_FLASHCTL_REGION_SELECT_MAIN);
        gCmdStatus = DL_FlashCTL_programMemoryFromRAM8WithECCGenerated( FLASHCTL, 0x3018, &op1);
       
        if (gCmdStatus == DL_FLASHCTL_COMMAND_STATUS_FAILED)
        {
            /* If command was not successful, set error flag */
            gErrorType = ERROR_8BIT_W;
        }
    }

    if (gErrorType == NO_ERROR) //op2  0x3020
    {
        /* 8-bit write to flash in main memory */
        DL_FlashCTL_unprotectSector(FLASHCTL, MAIN_BASE_ADDRESS, DL_FLASHCTL_REGION_SELECT_MAIN);
        gCmdStatus = DL_FlashCTL_programMemoryFromRAM8WithECCGenerated( FLASHCTL, 0x3020, &op2);
       
        if (gCmdStatus == DL_FLASHCTL_COMMAND_STATUS_FAILED)
        {
            /* If command was not successful, set error flag */
            gErrorType = ERROR_8BIT_W;
        }
    }

}
This is how I am reading from the flash:
void flash_remember()
{
    //from each flash location read the value and store it in the respective variables.
    //variables are pass,ctp,cts,op1,op2

    ptrA=(uint8_t*)0x3018;
    // op1 =*ptrA;
    op1_temp =*ptrA;

    ptrA=(uint8_t*)0x3020;
    // op2 =*ptrA;
    op2_temp =*ptrA;

    ptrA=(uint8_t*)0x3008;
    // cts =*ptrA;
    cts_temp =*ptrA;

    ptrB=(uint16_t*)0x3010;
    // pass =*ptrB;
    pass_temp =*ptrB;

    ptrC=(uint32_t*)0x3000;
    // ctp =*ptrC;
    ctp_temp =*ptrC;



}