Flash Driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flash Driver

1,545 Views
Shreya_Dave
Contributor I

I have been trying to configure flash Driver using Ebtresos. I have not been able to understand how the cluster division takes place for block configuration. How is the memory utilized for the same?

Is the memory getting reserved for immediate data even when the legacy mode is false. If yes, how is its size defined?

Labels (1)
0 Kudos
5 Replies

1,512 Views
Shreya_Dave
Contributor I

@hungnguyenphi 

the MCAL package i am using is AUTOSAR 4.3 SMCAL RTM 1.0.1 release for the S32K14X platform. 

Yes About Fee, How is a the maximum size of block defined based on number of clusters. and for the legacy mode, is memory reserved either way for immediate block because i have not been able to use all the memory for a block.

0 Kudos

1,496 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello Shreya_Dave,

I would like to answer your question:

  • FeeBlockOverhead = (12 / FEE_VIRTUAL_PAGE_SIZE + 2 )* FEE_VIRTUAL_PAGE_SIZE
  • FeeClusterOverhead = (16 / FEE_VIRTUAL_PAGE_SIZE + 2 ) * FEE_VIRTUAL_PAGE_SIZE
  • Actual_Fee_block_size = (FeeBlockSize / FEE_VIRTUAL_PAGE_SIZE) * FEE_VIRTUAL_PAGE_SIZE + FeeBlockOverhead

if

  • Legacy mode = true
  • FEE_VIRTUAL_PAGE_SIZE = 32

we have two block

  • FeeBlockSize of block 1 = 50
  • FeeBlockSize of block 2 = 70

we have two cluster

  • cluster 1 contain 2 sector each sector has size 2048. Then cluster 1 has size 4096
  • cluster 2 contain 1 sector has size 2048. Then cluster 1 has size 2048

so the:

  • FeeBlockOverhead = 96
  • FeeClusterOverhead = 96
  • Actual_Fee_block_size of block 1 = 50/32 *32 + 96 = 160
  • Actual_Fee_block_size of block 2 = 70/32 *32 + 96 = 192

  • Fee_cluster_size will be sum of all sector in the cluster (Eg if we have two sector in one Fee_cluster, each sector have size 2048. Then the Fee_cluster_size = 2048 + 2048 = 4096)
    The FEE need atleast 2 Fee_cluster. And the calculation will be base on the smallest cluster (if the first cluster has size 2048 and the second cluster has size 4096, then the calculation will be base on 2048)

As far as I know, the condition for legacy mode in the AUTOSAR 4.3 SMCAL RTM 1.0.1 is:

  • Fee_cluster_smallest_size - FeeClusterOverhead - FeeBlockOverhead - 2 * (total_block_size) >= 0

So in this case, it will be:

  • 2048 - 96 - 96 - 2*(160 +192) >= 0.

From what I know, you have created a similar ticket(313450) for this case.

Best regards,

Hung.

0 Kudos

1,489 Views
Shreya_Dave
Contributor I

@hungnguyenphi 

Thanks I understood the calculation. But what is the necessity of atleast two Clusters in the cluster group and how do they exactly work?

0 Kudos

1,471 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @Shreya_Dave 

The algorithm of Fee require atleast two clusters. It is used for "Cluster swap". Please see chapter "3.6.5 Cluster swap" in the Fee_UM for more information.

Best regards,

Hung.

0 Kudos

1,519 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello Shreya_Dave,

1. Could you please explain more about these above questions. 

2. Are you using MCAL package from NXP ? If yes, could you please share the name of the MCAL package.

3. As far as I know, the Fls MCAL driver will configure flash as sector but not block or cluster. I also cannot find the legacy mode(I doubt that you are talking about Fee but I am not sure).

fls.png

Best regards,

Hung.

0 Kudos