Hi,
I am using S32K146.
I want to use 4Kb EEPROM and 64Kb NVM partition in my project, i tried running code example flash_partitioning_s32k146, which helped me use EEPROM partition.
But i am unable to Write or erase in NVM, The D_Flash size is 0 [ data flash 0 kb emulated eeprom backup 64kb ]as per the flex nvm partition, so the operation is failed.
How to configure the flex nvm partition ?
Thanks
Hey Hi @Robin_Shen
Thanks, This worked, I have one more question?
How to write in 32kB backup eeprom like what should be address ? and how to read back data from NVM(DFlash) or EEPROM ?
When using the EEPROM of S32K1xx, user does not need to write to the EPROM backup address. It is recommended that you read AN11983 Using the S32K1xx EEPROM Functionality
The training video Benefit from FlexNVM Flash Block Memory in S32K MCUs introduces Emulated EEPROM from 10:08
Hope it helps.
Hi
That example configure FlexNVM for maximum E-Flash size 64K
* - EEEDataSizeCode = 0x02u: EEPROM size = 4 Kbytes
* - DEPartitionCode = 0x08u: EEPROM backup size = 64 Kbytes */
ret = FLASH_DRV_DEFlashPartition(&flashSSDConfig, 0x02u, 0x08u, 0x0u, false, true);
You can Split FlexNVM for D-Flash(32Kbytes) and E-Flash(32Kbytes):
ret = FLASH_DRV_DEFlashPartition(&flashSSDConfig, 0x02u, 0x03u, 0x0u, false, true);
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hey Robin thanks for reply,
So going by current configuration, my MCU is configured for 64Kb + 4Kb of EERPOM ? is that right ?
Also how do i access the 64Kb of EEPROM ? as i have checked i can write on 4Kb of EEPROM only
/* Configure FlexRAM as EEPROM and FlexNVM as EEPROM backup region,
* DEFlashPartition will be failed if the IFR region isn't blank.
* Refer to the device document for valid EEPROM Data Size Code
* and FlexNVM Partition Code. For example on S32K146:
* - EEEDataSizeCode = 0x02u: EEPROM size = 4 Kbytes
* - DEPartitionCode = 0x08u: EEPROM backup size = 64 Kbytes */
ret = FLASH_DRV_DEFlashPartition(&flashSSDConfig, 0x02u, 0x08u, 0x0u, false, true);
DEV_ASSERT(STATUS_SUCCESS == ret);
As per mentioned by You, i also tried doing following changes
ret = FLASH_DRV_DEFlashPartition(&flashSSDConfig, 0x02u, 0x03u, 0x0u, false, true);
but this function return Error (0x1) and code is stuck in assert condition. i have attached screenshot of flashSSDConfig variable data.
That example configure all 64 kB FlexNVM as EEPROM backup. But you want to configure 32 kB FlexNVM as Data Flash and 32kB as EEPROM backup? so:
ret = FLASH_DRV_DEFlashPartition(&flashSSDConfig, 0x02u, 0x03u, 0x0u, false, true);
Please notice the NOTE of that example: