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.

MSP432P401M: Bank and Sector of Flash Memory

Part Number: MSP432P401M

Hello!

I made my custom board using MSP432P401M.
As far as I know, MSP432P401M has 128KB flash main memory(0x0000_0000 ~ 0x0001_FFFF) and 2 BANKs.
But, I can not find out mapping information of BANK and SECTOR.
Following is what I am guessing the mapping information of it.
0x0000_0000 ~ 0x0000_FFFF, BANK 0(Sector 0 to SECTOR 15), 64KB
0x0001_0000 ~ 0x0001_FFFF, BANK 1(Sector 0 to SECTOR 15), 64KB
Am I correct?
Any comments are appreciated.

Thanks,

  • Hello Seogje,

    From the MSP430P401M datasheet, there are up to 64 sectors for 256k device or 32 sectors if 128k device.

  • Hello Dennis,

    Thank you for your reply.
    The 256KB memory case is not an issue.
    My problem is that I don't know how the Bank and Sector are distributed in the 128KB memory case.

    There are two assumptions.

    The one is as follows.
    0x0000_0000 ~ 0x0000_FFFF, BANK 0(Sector 0 to SECTOR 15), 64KB
    0x0001_0000 ~ 0x0001_FFFF, BANK 1(Sector 0 to SECTOR 15), 64KB

    The other is as follows
    0x0000_0000 ~ 0x0001_FFFF, BANK 0(Sector 0 to Sector 31), 128KB
    In this case, there is no BANK 1 in the 128KB flash memory.

    Which one is correct?

    Thanks & Regards,

  • Hello,

    I think my assumption is correct.
    The Bank and Sector information of Flash Memory for MSP432P401M is as follows.
    0x0000_0000 ~ 0x0000_FFFF, BANK 0(Sector 0 to Sector 15), 64KB
    0x0001_0000 ~ 0x0001_FFFF, BANK 1(Sector 0 to Sector 15), 64KB
    Using above information, I tried to write and read the flash memory.
    The following code is working fine.

    /* DriverLib Includes */
    #include <ti/devices/msp432p4xx/driverlib/driverlib.h>
    /* Standard Includes */
    #include <stdint.h>
    #include <stdbool.h>
    #include <string.h>

    #define CALIBRATION_START 0x0001F000

    uint8_t simulatedCalibrationData[4096];
    uint8_t data[10];
    uint8_t* addr_ptr = (uint8_t*)CALIBRATION_START;

    int main(void)
    {
       MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
       FlashCtl_setWaitState(FLASH_BANK0, 1);
       FlashCtl_setWaitState(FLASH_BANK1, 1);
       MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48);

       memset(simulatedCalibrationData, 0xA4, 4096);

       MAP_FlashCtl_unprotectSector(FLASH_MAIN_MEMORY_SPACE_BANK1,FLASH_SECTOR15);

       if(!MAP_FlashCtl_eraseSector(CALIBRATION_START))
            while(1);

      if(!MAP_FlashCtl_programMemory(simulatedCalibrationData,
       (void*) CALIBRATION_START, 4096))
            while(1);

       MAP_FlashCtl_protectSector(FLASH_MAIN_MEMORY_SPACE_BANK1,FLASH_SECTOR15);

       while (1)
       {
            data[0] = *addr_ptr;
            addr_ptr++;
            data[1] = *addr_ptr;
            __asm(" nop");
       } 
    }

    Thanks,