Change FlexRam size

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

Change FlexRam size

1,059 Views
ralf1694
Contributor III

Hi. I am using the MK22FX512VLH12 and the FLEXRam feature.

I am initialize the size with DEFlashPartition function. EEEDataSizeCode is 0x37 for 64B and 64B and DEPartitionCode is 0x08 for full eeprom. When I am starting the MK22 the first time, I get the Code 0x00 from the DEFlashPartition function.

But after the first start I get an ACCERR from the DEFlashPartition function.

When I am erase the full chip of the MK22 and start the software, I get the Code 0x00 from the function but after the first start always an ACCERR. Why I get this error has anybody an idea? Can I change the size of FlexRam without erase the full chip?

0 Kudos
Reply
4 Replies

940 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

When the FlexNVM configured for EEPROM function, the FlexRAM only could be access for EEPROM memory size. In customer application, the EEPROM size is 128 bytes, so after data Flash partition, the FlexRAM could be accessed size is 128 bytes.

I would recommend customer to refer TFS Flash Driver Software for Kinetis and ColdFire+ Microcontrollers [MK70FN1M0xxx12] <demo_normal> example, which include EEPROM operation related code.

The default demo path is:

C:\Program Files\Freescale\Standard_Software_Driver_v1.03\C90TFS\Demos\build\MK70FN1M0xxx12\IAR\demo_normal


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

940 Views
ralf1694
Contributor III

I read that the full chip must be erased when calling deflashpartition command. With the JTAG debugger or with the EraseAllBlocks command. But if I erase the whole flash my p-flash is in an erased state too and I can not start the software. So is there an other solution how to solved this problem?

0 Kudos
Reply

940 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

Customer could add below code to detect if the chip was already partitioned or not in FlexNVM initialization code:

if ((SIM_FCFG1 & SIM_FCFG1_DEPART(0xF)) != 0x00000F00)

More detailed info, please check below link:

https://community.nxp.com/message/546287?commentID=546287#comment-546287 

After the FlexNVM was partitioned, the chip need be reset to make sure finish the FlexNVM partition.

Customer also could using P&E Debugger tool or Segger J-Link tool to program FlexNVM partition at data flash IFR.

More detailed info, please check below link:

https://community.nxp.com/message/474165?commentID=474165#comment-474165 

When the chip was partitioned, customer need to check FTFE_FCNFG[EEERDY] bit before EEPROM operation.

The FlexRAM operation does not need to disable the interrupt. The FlexNVM has internal firmware to make sure the write EEPROM data be checked. Customer doesn't need manually check the EEPROM byte.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

940 Views
ralf1694
Contributor III

I have one more question. If I write to FlexRam, should I disable the interrupts? And I have no checksum for my data in den FlexRam(EEE backup). I read that the MK22 read allways the correct data which are written complet. Is that right?

0 Kudos
Reply