Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hello
I'm using custom board with MSP432 MCU on it.
As datasheet I've seen, It looks like that I'm able to program some data(variable) on Flash Information Memory.
I'm trying to write some data on it but it doesn't work.
Questions:
1. Is it possible to write some variable in the region of Flash Information Memory(0x0020_0000 ~ 0x0020_3FFF)?
2. If possible, does this piece of data are stored when the power off?
3. If it doesn't, is there anyway to store some data(variable) which can be changed but should be stored when the power off?
Here is my code of trying
----------------------------------------------------------------------------------------------------------------
FlashCtl_unprotectSector(FLASH_MAIN_MEMORY_SPACE_BANK0,0xFFFFFFFF);
FlashCtl_unprotectSector(FLASH_MAIN_MEMORY_SPACE_BANK1,0xFFFFFFFF);
FlashCtl_unprotectSector(FLASH_INFO_MEMORY_SPACE_BANK0,FLASH_SECTOR0 | FLASH_SECTOR1);
FlashCtl_unprotectSector(FLASH_INFO_MEMORY_SPACE_BANK1,FLASH_SECTOR0 | FLASH_SECTOR1);
flash_ptr = (int*)0x0020102C;
*flash_ptr = c_address[0];
flash_ptr = (int*)0x0020102D;
*flash_ptr = c_address[1];
flash_ptr = (int*)0x0020102E;
*flash_ptr = c_address[2];
FlashCtl_protectSector(FLASH_MAIN_MEMORY_SPACE_BANK1,0xFFFFFFFF);
FlashCtl_protectSector(FLASH_INFO_MEMORY_SPACE_BANK0,FLASH_SECTOR0 | FLASH_SECTOR1);
FlashCtl_protectSector(FLASH_INFO_MEMORY_SPACE_BANK1,FLASH_SECTOR0 | FLASH_SECTOR1);
FlashCtl_disableWordProgramming();
----------------------------------------------------------------------------------------------------------------
//read flash
temp[0] = *tempp;
temp[1] = *tempp;
temp[2] = *tempp;
{
MAIN (RWX) : origin = 0x00000000, length = 0x00040000
INFO (RWX) : origin = 0x00200000, length = 0x00004000 //cheanged to RWX in order to write
SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000
SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000
}
/* If you are building using the command line, or for some reason want to */
/* define them here, you can uncomment and modify these lines as needed. */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone. */
/* */
/* A heap size of 1024 bytes is recommended when you plan to use printf() */
/* for debug output to the console window. */
/* */
/* --heap_size=1024 */
/* --stack_size=512 */
/* --library=rtsv7M4_T_le_eabi.lib */
{
.intvecs : > 0x00000000
.text : > MAIN
.const : > MAIN
.constdata : > MAIN
.cinit : > MAIN
.pinit : > MAIN
.init_array : > MAIN
* : > MAIN
.sysmem : > INFO
.data : > SRAM_DATA
.bss : > SRAM_DATA
.sysmem : > SRAM_DATA
.stack : > SRAM_DATA (HIGH)
}
WDTCTL_SYM = 0x4000480C;
bests regards
Sae Won Park