s32k118 EEPROM Functionality example

cancel
Showing results for 
Search instead for 
Did you mean: 

s32k118 EEPROM Functionality example

Jump to solution
189 Views
종찬박
Contributor II

Hi

I'm trying to use EEPROM Functionality, and refer to AN11983 Rev 0,06/2017

there are examples, but I couldn't access the funcition which in the examples.

this function is flash_launchCommand();

What can I do?

And Can I get the full example code like S32K1xx Series Cookbook(AN5413)?

 

0 Kudos
1 Solution
184 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi,

 

SW examples directly for the AN11983 is not available.

However, the flash_partitioning_s32k118 example can be found in the S32DS: File -> New -> S32DS Project from Example

dianabatrlova_0-1611152895898.png

 

Another available example codes are made for the S32K144:

1. See the attachment.

2. https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/Example-S32K144-EEEPROM-usage/ta-p/110...

3. https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/EXAMPLE-S32K144-EEEPROM-usage-No-SDK/t...

 

To better understand flash commands I strongly recommend you reading the Reference Manual rev 12.1

The flash commands are usually launched from the RAM because some operations on the flash module cannot be executed simultaneously.

The equivalent of that function (flash_launchCommand();) can be found in the mentioned example "flash_partitioning_s32k118"  function "FLASH_DRV_CommandSequence"

Or simply:

/* Clear CCIF to launch command */
FTFx_FSTAT |= FTFx_FSTAT_CCIF_MASK;

/* Wait for previous command to complete */
while ((FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) == 0);

 

I hope it helps,

Best regards.

Diana

View solution in original post

3 Replies
185 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi,

 

SW examples directly for the AN11983 is not available.

However, the flash_partitioning_s32k118 example can be found in the S32DS: File -> New -> S32DS Project from Example

dianabatrlova_0-1611152895898.png

 

Another available example codes are made for the S32K144:

1. See the attachment.

2. https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/Example-S32K144-EEEPROM-usage/ta-p/110...

3. https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/EXAMPLE-S32K144-EEEPROM-usage-No-SDK/t...

 

To better understand flash commands I strongly recommend you reading the Reference Manual rev 12.1

The flash commands are usually launched from the RAM because some operations on the flash module cannot be executed simultaneously.

The equivalent of that function (flash_launchCommand();) can be found in the mentioned example "flash_partitioning_s32k118"  function "FLASH_DRV_CommandSequence"

Or simply:

/* Clear CCIF to launch command */
FTFx_FSTAT |= FTFx_FSTAT_CCIF_MASK;

/* Wait for previous command to complete */
while ((FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) == 0);

 

I hope it helps,

Best regards.

Diana

View solution in original post

174 Views
종찬박
Contributor II

Hi

Thanks for response.

your answer is useful for me.

but, I have another question.

In the example EEEPROM no SDK, when using the write function,

the function 'EEE_Write_ByteArray' execute the line to check FSTAT_CCIF whenever it write 4 byte.

I wonder why FSTAT_CCIF have to be checked.

And When writing the mass data(is bigger than 4 byte), Can I use the memcpy function?

0 Kudos
156 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

 

Please, refer to the AN11983 section "3.6.1 EEE writes"

"Writes to the EEE space launch a EEE operation to store the data within the E-flash memory. Because this is a flash program operation, software must test the CCIF bit to determine if any other flash operations are in progress before writing to the EEE space. Because multiple concurrent writes and read-while-write operations within the same flash block are not allowable, accesses
to the EEE or D-flash space are not allowed until the EEE write is complete. Check CCIF flag to determine if previous Flash or EEEPROM command is finished"

 

>> When writing the mass data(is bigger than 4 byte), Can I use the memcpy function?

No, you should wait for CCIF whenever you write 4 bytes as you can see in the example.

"the records used to back up the EEE data use a word sized data field"

 

I hope it helps.

Best regards,

Diana