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.0 | ms | 1 | 2 | 3 | Average |
Init | 0.782 | 0.78246 | 0.78282 | 0.782427 | |
Write | Block0 | 0.1624 | 0.16237 | 0.16239 | 0.162387 |
Block1 | 0.28598 | 0.28597 | 0.28605 | 0.286 | |
Read | Block0 | 0.58423 | 0.58414 | 0.58411 | 0.58416 |
Block1 | 1.39559 | 1.39569 | 1.39583 | 1.395703 |
RTD 5.0.0 HF01
RTD 3.0.0 | ms | 1 | 2 | 3 | 4 | Average |
Init | 3.58261 | 4.578746 | 5.59698 | 3.59889 | 4.339307 | |
Write | Block0 | 8.06584 | 8.07293 | 67.77847 | 8.07187 | 22.99728 |
Block1 | 18.46129 | 18.45089 | 18.47874 | 18.47775 | 18.46717 | |
Read | Block0 | 2.2121 | 2.20861 | 2.21325 | 2.2073 | 2.210315 |
Block1 | 5.42842 | 5.41367 | 5.43186 | 5.4238 | 5.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.
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.
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
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.0 | ms | 1 | 2 | 3 | 4 | 5 | Average |
Init | 3.5583 | 4.5627 | 5.5664 | 3.601 | 4.5767 | ||
Write | Block0 | 8.047 | 8.0692 | 59.4925 | 8.0712 | 25.21097 | |
Block1 | 18.4443 | 18.4826 | 18.4923 | 18.4736 | 18.48283 | ||
Read | Block0 | 2.21 | 2.223 | 2.225 | 2.2318 | 2.2266 | |
Block1 | 5.42 | 5.4159 | 5.4136 | 5.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?
Hi @acnhyxgxl,
Let me check with the RTD FEE owners and get back to you.
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
3.0.0
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.
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:
This affects performance during cluster swapping operations.
Regards,
Daniel
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