S32K312 EEPROM runs slow after RTD upgrade

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

S32K312 EEPROM runs slow after RTD upgrade

1,142件の閲覧回数
acnhyxgxl1
Contributor II

Hi NXP experts:
I make my development base on S32K312EVB-Q172 , and switching RTD version from 3.0.0 P01 to 5.0.0 HF01 (S32K3_S32M27x Real-Time Drivers ASR R21-11 Version 5.0.0 HF01).
However, the Fee&Fls drivers change a lot between two RTD versions and I encountered some problems, especially the writing process will take longer time than 3.0 version.

Hardware: S32K312EVB-Q172
Software: S32 Design Studio - 3.5 Update14(Build 240924)
RTD: RTD 3.0.0 P01 v.s RTD 5.0.0 HF01


Flash Block size: 8KB
EEPROM number of block: 2 blocks
Block size: Block_0: 0x200; Block_1: 0x500

Reference documents: User Manual for S32K3 Fee Driver UM34FEEASR4.4 Rev0000R2.0.0 Rev. 1.0

RTD 3.0.0

RTD 3.0.0ms123Average
Init0.7820.782460.782820.782427
WriteBlock00.16240.162370.162390.162387
Block10.285980.285970.286050.286
ReadBlock00.584230.584140.584110.58416
Block11.395591.395691.395831.395703

 

 

RTD 5.0.0 HF01

RTD 3.0.0ms1234Average
Init3.582614.5787465.596983.598894.339307
WriteBlock08.065848.0729367.778478.0718722.99728
Block118.4612918.4508918.4787418.4777518.46717
ReadBlock02.21212.208612.213252.20732.210315
Block15.428425.413675.431865.42385.424438

 

1. I tried to copy my setting in RTD 3.0, but some configs are not migratable between 2 versions.
For example, the maximum write size for FLASH can only be 128 bytes in RTD 5.0, at least in the GUI settings.
My config in detail is in the attachment to save space.

RTD_5_0_0-WritePageSize.png

2. The write page size limited to 32 bytes due to data alignment check in RTD 5.0.
I tried to follow my setting in RTD 3.0. Despite the code and compile, the Mem_43 module returns ErrorID 0x04. Which is caused by Fee_WriteToMemAcc and Fee_ReadFromMemAcc
To be more specific, WritePageSize should be the greatest common divisor(GCD) of
1. FEE_VIRTUAL_PAGE_SIZE = 96
2. FEE_BLOCK_OVERHEAD - (2U * FEE_VIRTUAL_PAGE_SIZE) = 32
3. FEE_CLUSTER_OVERHEAD - (2U * FEE_VIRTUAL_PAGE_SIZE) = 32
As for ReadPageSize has to be the GCD of FEE_BLOCK_OVERHEAD = 96

According to RTD_FEE_UM, FEE_VIRTUAL_PAGE_SIZE has default value of 32, and FEE_BLOCK_OVERHEAD will be Ceiling(12/FEE_VIRTUAL_PAGE_SIZE + 2) * FEE_VIRTUAL_PAGE_SIZE = 96.
So the WritePageSize and the ReadPageSize are stuck at 32 and 96 respectively.
Nevertheless, there were no such limitation in RTD 3.0.

 

I would like to know why there are such limitation in RTD 5.0, and how to improve S32K312 EEPROM performance.

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

1,096件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @acnhyxgxl1,

You selected only one sector (batch) in DFlash for FEE: Block_2_S15 at address 0x1001E000.

However, in MemAcc, you selected the same batch twice - once with logical address 0x0 and again with 0x2000 (8192).
This is not valid, as two logical addresses cannot be mapped to the same physical address.

You can refer to the FEE example provided in RTD 5.0.0 for guidance.

Also, note that 128 bytes is the maximum size the hardware (C40) can program in a single operation - this is a hardware limitation.

 

 BR, Daniel

0 件の賞賛
返信

1,080件の閲覧回数
acnhyxgxl
Contributor I

Hi @danielmartynek 

Thanks for your replay!

I made such duplicated setting in MemAcc because I only need 1 cluster and 2 blocks in Fee. Anyway, I made adjustment base on your suggestion. The source code after modification is in the attachment.

However, it doesn't seem like the performance is improved, as below table. I think the performance issue is more relate to MemWritePageSize and MemReadPageSize in MemSectorBatch settings.

RTD 5.0.0ms12345Average
Init3.55834.56275.56643.601 4.5767
WriteBlock08.0478.069259.49258.0712 25.21097
Block118.444318.482618.492318.4736 18.48283
ReadBlock02.212.2232.2252.2318 2.2266
Block15.425.41595.41365.4484 5.425967

 

I tried to increase the W/R page size(align to my Fls setting in RTD 3.0). But it stuck at 32 bytes and 96 bytes respectively because of the of the `MemAcc_ValidateAddressAndLength` in MemAcc module.

1. Is there any guideline about the MemSectorBatch setting, FeeVirtualPageSize and FeeDataBufferSize to improve EEPROM performance?

2. Fls WriteSize set to 256 bytes was available, I'm wondering how this value works in RTD 3.0?

タグ(2)
0 件の賞賛
返信

1,001件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @acnhyxgxl,

Let me check with the RTD FEE owners and get back to you.

0 件の賞賛
返信

951件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @acnhyxgxl,

RTD 5.0.0 is slower because the old FLS implementation has been replaced with a combination of MemAcc and MemInfls. In this setup, MemAcc calls MemInfls for each page size and then checks the status, which results in increased processing time.

Test results (system clock from FIRC, 48MHz)

5.0.0

danielmartynek_1-1750769205897.png

3.0.0

danielmartynek_2-1750769265939.png

5.0.0 at 120MHz, 5.869ms.

Test project attached.

 

We provide descriptions of these parameters in the configuration tool and the User Manual.

The Write/Read Page Size is hardware-dependent. You can find this information in the S32k3xx documentation, as already discussed. If the page size for a device is 32 bytes, you should configure the page size to 32.

danielmartynek_0-1750768646761.png

Fee Virtual Page Size (logical blocks must be aligned) should be a multiple of the Write Page Size. In this case, you can also set it to 32

Fee Data Buffer Size follows this:

danielmartynek_3-1750769404374.png

This affects performance during cluster swapping operations.

 

Regards,

Daniel

 

0 件の賞賛
返信

1,118件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @acnhyxgxl1,

The RTD includes a quality package that contains ProfileReports for each module.

When comparing the execution times of the FEE APIs, there is no significant difference.

  • SW32K3_RTD_4.4_3.0.0_P01_D2303_QualityPackage.zip
  • SW32K3_S32M27x_RTD_R21-11_5.0.0_D2410_QualityPackage.zip

Let me check the projects.

 

 

BR, Daniel

 

0 件の賞賛
返信