How to use NVM and EEPROM partition in S32k146?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to use NVM and EEPROM partition in S32k146?

6,936件の閲覧回数
s32k146_ige
Contributor IV

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

ラベル(1)
タグ(2)
0 件の賞賛
返信
7 返答(返信)

6,898件の閲覧回数
s32k146_ige
Contributor IV

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 ? 

0 件の賞賛
返信

6,847件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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

AN11983.png

0 件の賞賛
返信

6,786件の閲覧回数
s32k146_ige
Contributor IV
Dear @Robin_Shen
i am unable to understand here concept of backup EEPROM, i did read the said application note, but failed to grasp if i am using partition setting as 32KB EEPROM and 32kb NVM (DFlash), what actually happens to 32KB EEPROM, as i am going to use bootloader 16KB of NVM is going to be used as Bootloader, so i am left with 16KB of DFlash, but what happens to 32KB backup EEPROM ?
0 件の賞賛
返信

6,749件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

The training video  Benefit from FlexNVM Flash Block Memory in S32K MCUs introduces Emulated EEPROM from 10:08

Hope it helps.

0 件の賞賛
返信

6,917件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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);

flash_partitioning_s32k146.pngTable 4. FlexNVM partition codes for 64 kB FlexNVM devices (S32K142, S32K144, S32K146).png

You can Split FlexNVM for D-Flash(32Kbytes) and E-Flash(32Kbytes):
ret = FLASH_DRV_DEFlashPartition(&flashSSDConfig, 0x02u, 0x03u, 0x0u, false, true);

Split FlexNVM for D-Flash and E-Flash.pngBest 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.
-------------------------------------------------------------------------------

6,912件の閲覧回数
s32k146_ige
Contributor IV

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.

 

0 件の賞賛
返信

6,902件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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:

FLASH Partitioning S32K146 RTM 4.0.3.pngflash_partitioning_s32k146 Debug_RAM.pngflash_partitioning_s32k146 Debug.png